@lumiapassport/ui-kit 1.13.1 → 1.13.3

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.cts CHANGED
@@ -1,16 +1,78 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React$1 from 'react';
3
3
  import React__default, { ReactNode, MutableRefObject, FC, HTMLAttributes, PropsWithChildren } from 'react';
4
- import * as zustand from 'zustand';
5
- import { UserOperationV07, UserOperationV06 } from '@lumiapassport/core/bundler';
6
4
  import * as viem from 'viem';
7
5
  import { Address as Address$1, Hex, Chain, Hash as Hash$1, TransactionReceipt } from 'viem';
6
+ import * as _tanstack_react_query from '@tanstack/react-query';
7
+ import { QueryClient } from '@tanstack/react-query';
8
+ import * as zustand from 'zustand';
9
+ import { UserOperationV07, UserOperationV06 } from '@lumiapassport/core/bundler';
8
10
  import * as class_variance_authority_types from 'class-variance-authority/types';
9
11
  import { VariantProps } from 'class-variance-authority';
10
12
  export { JwtTokens, LoginResponse, VerifyResponse, getValidTokens, jwtTokenManager, logout } from '@lumiapassport/core/auth';
11
13
  import * as wagmi from 'wagmi';
12
- import * as _tanstack_react_query from '@tanstack/react-query';
13
- import { QueryClient } from '@tanstack/react-query';
14
+
15
+ interface TokenBalance {
16
+ address: `0x${string}`;
17
+ name: string;
18
+ symbol: string;
19
+ decimals: number;
20
+ balance: string;
21
+ formattedBalance: string;
22
+ logo?: string;
23
+ }
24
+ interface Asset {
25
+ type: 'native' | 'erc20' | 'erc721' | 'erc1155';
26
+ address?: `0x${string}`;
27
+ name: string;
28
+ symbol: string;
29
+ balance: string;
30
+ formattedBalance: string;
31
+ decimals?: number;
32
+ tokenId?: string;
33
+ logo?: string;
34
+ }
35
+ declare function useAssets(address?: `0x${string}`): {
36
+ nativeBalance: {
37
+ decimals: number;
38
+ formatted: string;
39
+ symbol: string;
40
+ value: bigint;
41
+ };
42
+ tokenBalances: any;
43
+ assets: Asset[];
44
+ getTokenBalance: (tokenAddress: `0x${string}`) => {
45
+ address: `0x${string}`;
46
+ name: string;
47
+ symbol: string;
48
+ decimals: number;
49
+ balance: string;
50
+ formattedBalance: string;
51
+ logo: string;
52
+ };
53
+ refreshBalances: () => Promise<void>;
54
+ isLoading: any;
55
+ isConnected: boolean;
56
+ };
57
+ declare function useTokenInfo(tokenAddress: `0x${string}`): {
58
+ isLoading: any;
59
+ tokenInfo: any;
60
+ } | {
61
+ isLoading: boolean;
62
+ tokenInfo: {
63
+ name: string;
64
+ symbol: string;
65
+ decimals: number;
66
+ address: `0x${string}`;
67
+ };
68
+ };
69
+ declare function useTokenBalance(tokenAddress: `0x${string}`, userAddress?: `0x${string}`): {
70
+ balance: bigint;
71
+ formattedBalance: string;
72
+ tokenInfo: any;
73
+ isLoading: boolean;
74
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<bigint, viem.ReadContractErrorType>>;
75
+ };
14
76
 
15
77
  /**
16
78
  * LumiaPassport Configuration (library copy)
@@ -39,6 +101,17 @@ interface SocialProvider {
39
101
  comingSoon?: boolean;
40
102
  meta?: Record<string, any>;
41
103
  }
104
+ interface ProjectAsset extends Omit<Asset, 'type'> {
105
+ type: 'project';
106
+ balanceQueryKey: string[];
107
+ balanceQuery: () => Promise<{
108
+ cryptoFormatted: number;
109
+ cryptoFiatRate: number;
110
+ cryptoSymbol: string;
111
+ fiatFormatted: number;
112
+ fiatSymbol: string;
113
+ }>;
114
+ }
42
115
  interface LumiaPassportConfig {
43
116
  projectId: string;
44
117
  passkey: {
@@ -68,15 +141,16 @@ interface LumiaPassportConfig {
68
141
  showOnProduction: boolean;
69
142
  };
70
143
  preferedColorMode?: 'light' | 'dark';
144
+ projectAssets?: {
145
+ assets: ProjectAsset[];
146
+ showBalanceAs?: ProjectAsset['symbol'];
147
+ };
71
148
  ui: {
72
149
  title: string;
73
150
  subtitle?: string;
151
+ useExternalIcons?: boolean;
74
152
  dialogClassName?: string;
75
153
  authOrder?: Array<'passkey' | 'email' | 'social' | 'wallet'>;
76
- fonts?: {
77
- base?: string;
78
- heading?: string;
79
- };
80
154
  /** DEPRECATED colors provided by cssv */
81
155
  colors?: {
82
156
  light?: {
@@ -655,7 +729,10 @@ declare const useLumiaPassportBalance: () => {
655
729
  symbol: string;
656
730
  value: bigint;
657
731
  };
658
- currentLumiaRate: number;
732
+ fiatBalance: number;
733
+ cryptoRate: number;
734
+ fiatSymbol: string;
735
+ cryptoSymbol: string;
659
736
  };
660
737
  declare const useLumiaPassportIFrameReady: () => boolean;
661
738
  declare const useLumiaPassportAccountSession: () => AccountSession;
@@ -1115,68 +1192,6 @@ declare function useTransactions(): {
1115
1192
  isConnected: boolean;
1116
1193
  };
1117
1194
 
1118
- interface TokenBalance {
1119
- address: `0x${string}`;
1120
- name: string;
1121
- symbol: string;
1122
- decimals: number;
1123
- balance: string;
1124
- formattedBalance: string;
1125
- logo?: string;
1126
- }
1127
- interface Asset {
1128
- type: 'native' | 'erc20' | 'erc721' | 'erc1155';
1129
- address?: `0x${string}`;
1130
- name: string;
1131
- symbol: string;
1132
- balance: string;
1133
- formattedBalance: string;
1134
- decimals?: number;
1135
- tokenId?: string;
1136
- logo?: string;
1137
- }
1138
- declare function useAssets(address?: `0x${string}`): {
1139
- nativeBalance: {
1140
- decimals: number;
1141
- formatted: string;
1142
- symbol: string;
1143
- value: bigint;
1144
- };
1145
- tokenBalances: any;
1146
- assets: Asset[];
1147
- getTokenBalance: (tokenAddress: `0x${string}`) => {
1148
- address: `0x${string}`;
1149
- name: string;
1150
- symbol: string;
1151
- decimals: number;
1152
- balance: string;
1153
- formattedBalance: string;
1154
- logo: string;
1155
- };
1156
- refreshBalances: () => Promise<void>;
1157
- isLoading: any;
1158
- isConnected: boolean;
1159
- };
1160
- declare function useTokenInfo(tokenAddress: `0x${string}`): {
1161
- isLoading: any;
1162
- tokenInfo: any;
1163
- } | {
1164
- isLoading: boolean;
1165
- tokenInfo: {
1166
- name: string;
1167
- symbol: string;
1168
- decimals: number;
1169
- address: `0x${string}`;
1170
- };
1171
- };
1172
- declare function useTokenBalance(tokenAddress: `0x${string}`, userAddress?: `0x${string}`): {
1173
- balance: bigint;
1174
- formattedBalance: string;
1175
- tokenInfo: any;
1176
- isLoading: boolean;
1177
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<bigint, viem.ReadContractErrorType>>;
1178
- };
1179
-
1180
1195
  interface UserOperation {
1181
1196
  hash: Hash$1;
1182
1197
  sender: `0x${string}`;
package/dist/index.d.ts CHANGED
@@ -1,16 +1,78 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React$1 from 'react';
3
3
  import React__default, { ReactNode, MutableRefObject, FC, HTMLAttributes, PropsWithChildren } from 'react';
4
- import * as zustand from 'zustand';
5
- import { UserOperationV07, UserOperationV06 } from '@lumiapassport/core/bundler';
6
4
  import * as viem from 'viem';
7
5
  import { Address as Address$1, Hex, Chain, Hash as Hash$1, TransactionReceipt } from 'viem';
6
+ import * as _tanstack_react_query from '@tanstack/react-query';
7
+ import { QueryClient } from '@tanstack/react-query';
8
+ import * as zustand from 'zustand';
9
+ import { UserOperationV07, UserOperationV06 } from '@lumiapassport/core/bundler';
8
10
  import * as class_variance_authority_types from 'class-variance-authority/types';
9
11
  import { VariantProps } from 'class-variance-authority';
10
12
  export { JwtTokens, LoginResponse, VerifyResponse, getValidTokens, jwtTokenManager, logout } from '@lumiapassport/core/auth';
11
13
  import * as wagmi from 'wagmi';
12
- import * as _tanstack_react_query from '@tanstack/react-query';
13
- import { QueryClient } from '@tanstack/react-query';
14
+
15
+ interface TokenBalance {
16
+ address: `0x${string}`;
17
+ name: string;
18
+ symbol: string;
19
+ decimals: number;
20
+ balance: string;
21
+ formattedBalance: string;
22
+ logo?: string;
23
+ }
24
+ interface Asset {
25
+ type: 'native' | 'erc20' | 'erc721' | 'erc1155';
26
+ address?: `0x${string}`;
27
+ name: string;
28
+ symbol: string;
29
+ balance: string;
30
+ formattedBalance: string;
31
+ decimals?: number;
32
+ tokenId?: string;
33
+ logo?: string;
34
+ }
35
+ declare function useAssets(address?: `0x${string}`): {
36
+ nativeBalance: {
37
+ decimals: number;
38
+ formatted: string;
39
+ symbol: string;
40
+ value: bigint;
41
+ };
42
+ tokenBalances: any;
43
+ assets: Asset[];
44
+ getTokenBalance: (tokenAddress: `0x${string}`) => {
45
+ address: `0x${string}`;
46
+ name: string;
47
+ symbol: string;
48
+ decimals: number;
49
+ balance: string;
50
+ formattedBalance: string;
51
+ logo: string;
52
+ };
53
+ refreshBalances: () => Promise<void>;
54
+ isLoading: any;
55
+ isConnected: boolean;
56
+ };
57
+ declare function useTokenInfo(tokenAddress: `0x${string}`): {
58
+ isLoading: any;
59
+ tokenInfo: any;
60
+ } | {
61
+ isLoading: boolean;
62
+ tokenInfo: {
63
+ name: string;
64
+ symbol: string;
65
+ decimals: number;
66
+ address: `0x${string}`;
67
+ };
68
+ };
69
+ declare function useTokenBalance(tokenAddress: `0x${string}`, userAddress?: `0x${string}`): {
70
+ balance: bigint;
71
+ formattedBalance: string;
72
+ tokenInfo: any;
73
+ isLoading: boolean;
74
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<bigint, viem.ReadContractErrorType>>;
75
+ };
14
76
 
15
77
  /**
16
78
  * LumiaPassport Configuration (library copy)
@@ -39,6 +101,17 @@ interface SocialProvider {
39
101
  comingSoon?: boolean;
40
102
  meta?: Record<string, any>;
41
103
  }
104
+ interface ProjectAsset extends Omit<Asset, 'type'> {
105
+ type: 'project';
106
+ balanceQueryKey: string[];
107
+ balanceQuery: () => Promise<{
108
+ cryptoFormatted: number;
109
+ cryptoFiatRate: number;
110
+ cryptoSymbol: string;
111
+ fiatFormatted: number;
112
+ fiatSymbol: string;
113
+ }>;
114
+ }
42
115
  interface LumiaPassportConfig {
43
116
  projectId: string;
44
117
  passkey: {
@@ -68,15 +141,16 @@ interface LumiaPassportConfig {
68
141
  showOnProduction: boolean;
69
142
  };
70
143
  preferedColorMode?: 'light' | 'dark';
144
+ projectAssets?: {
145
+ assets: ProjectAsset[];
146
+ showBalanceAs?: ProjectAsset['symbol'];
147
+ };
71
148
  ui: {
72
149
  title: string;
73
150
  subtitle?: string;
151
+ useExternalIcons?: boolean;
74
152
  dialogClassName?: string;
75
153
  authOrder?: Array<'passkey' | 'email' | 'social' | 'wallet'>;
76
- fonts?: {
77
- base?: string;
78
- heading?: string;
79
- };
80
154
  /** DEPRECATED colors provided by cssv */
81
155
  colors?: {
82
156
  light?: {
@@ -655,7 +729,10 @@ declare const useLumiaPassportBalance: () => {
655
729
  symbol: string;
656
730
  value: bigint;
657
731
  };
658
- currentLumiaRate: number;
732
+ fiatBalance: number;
733
+ cryptoRate: number;
734
+ fiatSymbol: string;
735
+ cryptoSymbol: string;
659
736
  };
660
737
  declare const useLumiaPassportIFrameReady: () => boolean;
661
738
  declare const useLumiaPassportAccountSession: () => AccountSession;
@@ -1115,68 +1192,6 @@ declare function useTransactions(): {
1115
1192
  isConnected: boolean;
1116
1193
  };
1117
1194
 
1118
- interface TokenBalance {
1119
- address: `0x${string}`;
1120
- name: string;
1121
- symbol: string;
1122
- decimals: number;
1123
- balance: string;
1124
- formattedBalance: string;
1125
- logo?: string;
1126
- }
1127
- interface Asset {
1128
- type: 'native' | 'erc20' | 'erc721' | 'erc1155';
1129
- address?: `0x${string}`;
1130
- name: string;
1131
- symbol: string;
1132
- balance: string;
1133
- formattedBalance: string;
1134
- decimals?: number;
1135
- tokenId?: string;
1136
- logo?: string;
1137
- }
1138
- declare function useAssets(address?: `0x${string}`): {
1139
- nativeBalance: {
1140
- decimals: number;
1141
- formatted: string;
1142
- symbol: string;
1143
- value: bigint;
1144
- };
1145
- tokenBalances: any;
1146
- assets: Asset[];
1147
- getTokenBalance: (tokenAddress: `0x${string}`) => {
1148
- address: `0x${string}`;
1149
- name: string;
1150
- symbol: string;
1151
- decimals: number;
1152
- balance: string;
1153
- formattedBalance: string;
1154
- logo: string;
1155
- };
1156
- refreshBalances: () => Promise<void>;
1157
- isLoading: any;
1158
- isConnected: boolean;
1159
- };
1160
- declare function useTokenInfo(tokenAddress: `0x${string}`): {
1161
- isLoading: any;
1162
- tokenInfo: any;
1163
- } | {
1164
- isLoading: boolean;
1165
- tokenInfo: {
1166
- name: string;
1167
- symbol: string;
1168
- decimals: number;
1169
- address: `0x${string}`;
1170
- };
1171
- };
1172
- declare function useTokenBalance(tokenAddress: `0x${string}`, userAddress?: `0x${string}`): {
1173
- balance: bigint;
1174
- formattedBalance: string;
1175
- tokenInfo: any;
1176
- isLoading: boolean;
1177
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<bigint, viem.ReadContractErrorType>>;
1178
- };
1179
-
1180
1195
  interface UserOperation {
1181
1196
  hash: Hash$1;
1182
1197
  sender: `0x${string}`;