@dogeos/dogeos-sdk 3.0.8 → 3.0.9

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.ts CHANGED
@@ -1,10 +1,14 @@
1
- import { AdaptorChainType } from '@tomo-inc/wallet-adaptor-base';
1
+ import { AdaptorChainType } from '../../../wallet-adaptor-base';
2
2
  import { Chain as Chain_2 } from 'viem/chains';
3
- import { Connector } from '@tomo-inc/wallet-adaptor-base';
3
+ import { Connector } from '../../../wallet-adaptor-base';
4
+ import { default as default_2 } from 'react';
4
5
  import { JSX as JSX_2 } from 'react/jsx-runtime';
5
- import { SignInParams } from '@tomo-inc/wallet-adaptor-base';
6
- import { WalletConfig } from '@tomo-inc/wallet-adaptor-base';
7
- import { WalletConnectConfig } from '@tomo-inc/wallet-connect-protocol';
6
+ import { SignInParams } from '../../../wallet-adaptor-base';
7
+ import { WalletConfig } from '../../../wallet-adaptor-base';
8
+ import { WalletConfig as WalletConfig_2 } from '../../../../wallet-adaptor-base';
9
+ import { WalletProvider } from '@tomo-inc/inject-providers';
10
+
11
+ export declare type BasicLoginType = "email" | "externalWallets";
8
12
 
9
13
  export declare type Chain = {
10
14
  id: number;
@@ -30,7 +34,9 @@ export declare type Chain = {
30
34
  };
31
35
 
32
36
  export declare type ChainInfo = {
33
- icon: any;
37
+ icon: string | default_2.ComponentType<default_2.SVGProps<SVGSVGElement> | {
38
+ className?: string;
39
+ }> | null;
34
40
  name: string;
35
41
  };
36
42
 
@@ -39,8 +45,7 @@ export declare type ChainType = Exclude<AdaptorChainType, "all">;
39
45
  export declare enum ChainTypeEnum {
40
46
  All = "all",
41
47
  EVM = "evm",
42
- Solana = "solana",
43
- Aptos = "aptos"
48
+ Dogecoin = "dogecoin"
44
49
  }
45
50
 
46
51
  export declare interface ConnectData {
@@ -57,19 +62,30 @@ export declare interface ConnectVariables {
57
62
  chainId?: string;
58
63
  }
59
64
 
60
- declare interface EmbeddedWalletState {
61
- wallet: any;
62
- isAvailable: boolean;
63
- message: string | null;
64
- connectedInfo: any;
65
- isLoading: boolean;
66
- }
65
+ export declare type EvmChain = Chain_2;
66
+
67
+ /**
68
+ * Get all available chains
69
+ * Fetches chains from backend API and returns all supported chains in config format
70
+ *
71
+ * @returns Returns formatted chain configuration object containing all available chains
72
+ */
73
+ export declare function getChains(): Promise<Partial<Record<ChainType, EvmChain[] | Chain[]>>>;
67
74
 
68
- declare type EvmChain = Chain_2;
75
+ export declare type GetChainsReturnType = Promise<Partial<Record<ChainType, EvmChain[] | Chain[]>>>;
76
+
77
+ /**
78
+ * Get all available connectors
79
+ * Loads all connectors from @tomo-inc/wallet-adaptor-base including EIP6963, Wallet Standard, and WalletConnect wallets
80
+ *
81
+ * @returns Returns all available wallet connectors
82
+ */
83
+ export declare function getConnectors(): Promise<WalletConfig_2[]>;
84
+
85
+ export declare type GetConnectorsReturnType = Promise<WalletConfig[]>;
69
86
 
70
87
  export declare enum ModalView {
71
88
  Loading = "LOADING",
72
- Logged = "LOGGED",
73
89
  WalletList = "WALLET_LIST",
74
90
  WalletSearch = "WALLET_SEARCH",
75
91
  WalletSelectProviders = "WALLET_SELECT_PROVIDERS",
@@ -86,26 +102,44 @@ export declare enum ModalView {
86
102
  MyDogeSocialLogin = "MYDOGE_SOCIAL_LOGIN"
87
103
  }
88
104
 
89
- export declare enum ProdTypeEnum {
90
- Tomo = "tomo",
91
- MyDoge = "mydoge",
92
- WLFI = "wlfi"
105
+ export { SignInParams }
106
+
107
+ export declare interface SocialLoginProvider {
108
+ type: SocialLoginType;
109
+ clientId?: string;
110
+ [key: string]: unknown;
93
111
  }
94
112
 
95
- export { SignInParams }
113
+ export declare type SocialLoginType = "google" | "x";
96
114
 
97
115
  export declare type SwitchChainOptions = {
98
116
  chainType: ChainType;
99
117
  chainInfo: Chain;
100
118
  };
101
119
 
120
+ export declare type ThemeConfig = {
121
+ themes?: {
122
+ light?: {
123
+ colors?: Record<string, string | Record<string, string>>;
124
+ [key: string]: unknown;
125
+ };
126
+ dark?: {
127
+ colors?: Record<string, string | Record<string, string>>;
128
+ [key: string]: unknown;
129
+ };
130
+ [key: string]: unknown;
131
+ };
132
+ [key: string]: unknown;
133
+ defaultTheme?: "dark" | "light";
134
+ };
135
+
102
136
  export declare type UseAccount = {
103
137
  address: string;
104
138
  balance?: string;
105
139
  chainType?: ChainType;
106
140
  chainId?: string;
107
141
  currentWallet?: Connector | null;
108
- currentProvider?: any;
142
+ currentProvider?: WalletProvider;
109
143
  switchChain: (options: SwitchChainOptions) => Promise<boolean>;
110
144
  signMessage?: (params: {
111
145
  message: string;
@@ -116,29 +150,17 @@ export declare type UseAccount = {
116
150
 
117
151
  export declare const useAccount: () => UseAccount;
118
152
 
119
- /**
120
- * Hook to access embedded wallet from anywhere in the app
121
- * Make sure your component is wrapped with WalletConnectProvider
122
- *
123
- * @example
124
- * ```tsx
125
- * const { wallet, isAvailable, message, connectedInfo, isLoading } = useEmbeddedWallet();
126
- *
127
- * if (isLoading) {
128
- * return <div>Loading embedded wallet...</div>;
129
- * }
130
- *
131
- * if (isAvailable && wallet) {
132
- * // Use embedded wallet
133
- * }
134
- * ```
135
- */
136
- export declare const useEmbeddedWallet: () => EmbeddedWalletState;
153
+ export declare interface UserLoginConfig {
154
+ basicLogins?: BasicLoginType[];
155
+ socialLogins?: SocialLoginProvider[];
156
+ }
137
157
 
138
158
  export declare type UseWalletConnect = {
139
159
  isOpenModal: boolean;
140
160
  isConnected: boolean;
141
- connect: (variables?: ConnectVariables) => Promise<ConnectData>;
161
+ isConnecting: boolean;
162
+ error: string;
163
+ connect: (variables: ConnectVariables) => Promise<ConnectData>;
142
164
  disconnect: () => Promise<void>;
143
165
  openModal: () => void;
144
166
  closeModal: () => void;
@@ -163,10 +185,6 @@ export declare const useWalletConnect: () => {
163
185
  export declare const WalletConnectEmbed: ({ className, style }: WalletConnectEmbedProps) => JSX_2.Element | null;
164
186
 
165
187
  declare interface WalletConnectEmbedProps {
166
- /**
167
- * Optional view to display. If not provided, will use the default view based on prodType
168
- */
169
- view?: ModalView;
170
188
  /**
171
189
  * Optional container class name
172
190
  */
@@ -178,9 +196,70 @@ declare interface WalletConnectEmbedProps {
178
196
  }
179
197
 
180
198
  export declare interface WalletConnectKitConfig {
181
- connectors?: WalletConfig[];
182
- chains?: Partial<Record<ChainType, EvmChain[] | any[]>>;
183
- walletConnectConfig?: WalletConnectConfig;
199
+ /**
200
+ * Connector configuration
201
+ * Must be obtained through getConnectors() method, cannot be passed directly
202
+ * @example
203
+ * ```tsx
204
+ * import { getConnectors } from "@tomo-inc/wallet-connect-kit";
205
+ * const connectors = await getConnectors();
206
+ * ```
207
+ */
208
+ connectors?: Awaited<GetConnectorsReturnType>;
209
+ /**
210
+ * Chain configuration
211
+ * Must be obtained through getChains() method, cannot be passed directly
212
+ * @example
213
+ * ```tsx
214
+ * import { getChains } from "@tomo-inc/wallet-connect-kit";
215
+ * const chains = await getChains();
216
+ * ```
217
+ */
218
+ chains?: Awaited<GetChainsReturnType>;
219
+ /**
220
+ * Default connect chain
221
+ * @default undefined
222
+ * @example
223
+ * ```tsx
224
+ * import { WalletConnectProvider } from "@tomo-inc/wallet-connect-kit";
225
+ * const config: WalletConnectKitConfig = {
226
+ * defaultConnectChain: 'evm',
227
+ * };
228
+ */
229
+ defaultConnectChain?: ChainType;
230
+ /***
231
+ * WalletConnect project ID
232
+ * Make sure to replace the projectId with your own WalletConnect Project ID, if you wish to use WalletConnect!
233
+ * Get your Project ID
234
+ * @url https://cloud.walletconnect.com/
235
+ */
236
+ walletConnectProjectId?: string;
237
+ /**
238
+ * Application metadata
239
+ * @example
240
+ * ```tsx
241
+ * import { WalletConnectProvider } from "@tomo-inc/wallet-connect-kit";
242
+ * const config: WalletConnectKitConfig = {
243
+ * metadata: {
244
+ * name: "My DApp",
245
+ * description: "My decentralized application",
246
+ * url: "https://myapp.com",
247
+ * icons: ["https://myapp.com/icon.png"],
248
+ * },
249
+ * };
250
+ * ```
251
+ */
252
+ metadata?: {
253
+ name: string;
254
+ description: string;
255
+ url: string;
256
+ icons: string[];
257
+ };
258
+ theme?: ThemeConfig;
259
+ login?: UserLoginConfig;
260
+ embeddedWalletConfig?: {
261
+ stage?: "dev" | "pre" | "prod";
262
+ };
184
263
  clientId?: string;
185
264
  }
186
265
 
@@ -191,29 +270,6 @@ declare interface WalletConnectProviderProps {
191
270
  config?: WalletConnectKitConfig;
192
271
  }
193
272
 
194
- export declare interface WalletProvider {
195
- uuid: string;
196
- name: string;
197
- namespace?: string;
198
- icon: string;
199
- iconBackground?: string;
200
- rdns?: string;
201
- links: {
202
- homepage?: string;
203
- ios_install?: string;
204
- android_install?: string;
205
- chrome_install?: string;
206
- mobile?: string;
207
- qrCode?: string;
208
- edge?: string;
209
- firefox?: string;
210
- opera?: string;
211
- safari?: string;
212
- macos?: string;
213
- windows?: string;
214
- linux?: string;
215
- desktop?: string;
216
- };
217
- }
273
+ export { WalletProvider }
218
274
 
219
275
  export { }