@dogeos/dogeos-sdk 3.0.7 → 3.0.9-beta.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.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,25 +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"
105
+ export { SignInParams }
106
+
107
+ export declare interface SocialLoginProvider {
108
+ type: SocialLoginType;
109
+ clientId?: string;
110
+ [key: string]: unknown;
92
111
  }
93
112
 
94
- export { SignInParams }
113
+ export declare type SocialLoginType = "google" | "x";
95
114
 
96
115
  export declare type SwitchChainOptions = {
97
116
  chainType: ChainType;
98
117
  chainInfo: Chain;
99
118
  };
100
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
+
101
136
  export declare type UseAccount = {
102
137
  address: string;
103
138
  balance?: string;
104
139
  chainType?: ChainType;
105
140
  chainId?: string;
106
141
  currentWallet?: Connector | null;
107
- currentProvider?: any;
142
+ currentProvider?: WalletProvider;
108
143
  switchChain: (options: SwitchChainOptions) => Promise<boolean>;
109
144
  signMessage?: (params: {
110
145
  message: string;
@@ -115,29 +150,17 @@ export declare type UseAccount = {
115
150
 
116
151
  export declare const useAccount: () => UseAccount;
117
152
 
118
- /**
119
- * Hook to access embedded wallet from anywhere in the app
120
- * Make sure your component is wrapped with WalletConnectProvider
121
- *
122
- * @example
123
- * ```tsx
124
- * const { wallet, isAvailable, message, connectedInfo, isLoading } = useEmbeddedWallet();
125
- *
126
- * if (isLoading) {
127
- * return <div>Loading embedded wallet...</div>;
128
- * }
129
- *
130
- * if (isAvailable && wallet) {
131
- * // Use embedded wallet
132
- * }
133
- * ```
134
- */
135
- export declare const useEmbeddedWallet: () => EmbeddedWalletState;
153
+ export declare interface UserLoginConfig {
154
+ basicLogins?: BasicLoginType[];
155
+ socialLogins?: SocialLoginProvider[];
156
+ }
136
157
 
137
158
  export declare type UseWalletConnect = {
138
159
  isOpenModal: boolean;
139
160
  isConnected: boolean;
140
- connect: (variables?: ConnectVariables) => Promise<ConnectData>;
161
+ isConnecting: boolean;
162
+ error: string;
163
+ connect: (variables: ConnectVariables) => Promise<ConnectData>;
141
164
  disconnect: () => Promise<void>;
142
165
  openModal: () => void;
143
166
  closeModal: () => void;
@@ -162,10 +185,6 @@ export declare const useWalletConnect: () => {
162
185
  export declare const WalletConnectEmbed: ({ className, style }: WalletConnectEmbedProps) => JSX_2.Element | null;
163
186
 
164
187
  declare interface WalletConnectEmbedProps {
165
- /**
166
- * Optional view to display. If not provided, will use the default view based on prodType
167
- */
168
- view?: ModalView;
169
188
  /**
170
189
  * Optional container class name
171
190
  */
@@ -177,10 +196,70 @@ declare interface WalletConnectEmbedProps {
177
196
  }
178
197
 
179
198
  export declare interface WalletConnectKitConfig {
180
- connectors?: WalletConfig[];
181
- chains?: Partial<Record<ChainType, EvmChain[] | any[]>>;
182
- walletConnectConfig?: WalletConnectConfig;
183
- clientId?: string;
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
  }
185
264
 
186
265
  export declare const WalletConnectProvider: ({ children, config }: WalletConnectProviderProps) => JSX_2.Element | null;
@@ -190,29 +269,6 @@ declare interface WalletConnectProviderProps {
190
269
  config?: WalletConnectKitConfig;
191
270
  }
192
271
 
193
- export declare interface WalletProvider {
194
- uuid: string;
195
- name: string;
196
- namespace?: string;
197
- icon: string;
198
- iconBackground?: string;
199
- rdns?: string;
200
- links: {
201
- homepage?: string;
202
- ios_install?: string;
203
- android_install?: string;
204
- chrome_install?: string;
205
- mobile?: string;
206
- qrCode?: string;
207
- edge?: string;
208
- firefox?: string;
209
- opera?: string;
210
- safari?: string;
211
- macos?: string;
212
- windows?: string;
213
- linux?: string;
214
- desktop?: string;
215
- };
216
- }
272
+ export { WalletProvider }
217
273
 
218
274
  export { }