@imtbl/auth 2.12.5-alpha.9 → 2.12.6-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/src/types.ts CHANGED
@@ -16,22 +16,47 @@ export enum RollupType {
16
16
  ZKEVM = 'zkEvm',
17
17
  }
18
18
 
19
+ /**
20
+ * Supported EVM chains for user registration
21
+ * Matches EvmChain from @imtbl/wallet but defined here to avoid circular dependency
22
+ */
23
+ export enum EvmChain {
24
+ ZKEVM = 'zkevm',
25
+ ARBITRUM_ONE = 'arbitrum_one',
26
+ }
27
+
28
+ export type ChainAddress = {
29
+ ethAddress: `0x${string}`;
30
+ userAdminAddress: `0x${string}`;
31
+ };
32
+
33
+ export type ZkEvmInfo = ChainAddress;
34
+
19
35
  export type User = {
20
36
  idToken?: string;
21
37
  accessToken: string;
22
38
  refreshToken?: string;
23
39
  profile: UserProfile;
24
40
  expired?: boolean;
25
- [RollupType.ZKEVM]?: {
26
- ethAddress: string;
27
- userAdminAddress: string;
28
- };
41
+ [RollupType.ZKEVM]?: ChainAddress;
42
+ } & {
43
+ [K in Exclude<EvmChain, EvmChain.ZKEVM>]?: ChainAddress;
44
+ };
45
+
46
+ export type PassportChainMetadata = {
47
+ eth_address: string;
48
+ user_admin_address: string;
29
49
  };
30
50
 
51
+ /**
52
+ * Passport metadata
53
+ * - zkEVM: flat fields (zkevm_eth_address, zkevm_user_admin_address)
54
+ * - Other chains: nested objects (arbitrum_one: { eth_address, user_admin_address })
55
+ */
31
56
  export type PassportMetadata = {
32
57
  zkevm_eth_address?: string;
33
58
  zkevm_user_admin_address?: string;
34
- };
59
+ } & Partial<Record<Exclude<EvmChain, EvmChain.ZKEVM>, PassportChainMetadata>>;
35
60
 
36
61
  export interface OidcConfiguration {
37
62
  clientId: string;