@embarkai/ui-kit 0.4.59 → 0.4.60

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,4 +1,4 @@
1
- import { BatchOperation as BatchOperation$1 } from '@embarkai/core';
1
+ import { NormalizedAsset, NormalizedAssetType, BatchOperation as BatchOperation$1 } from '@embarkai/core';
2
2
  export { wagmiConfig } from '@embarkai/core';
3
3
  import * as react from 'react';
4
4
  import react__default, { ReactNode, RefObject, FC, HTMLAttributes, ButtonHTMLAttributes, SVGProps } from 'react';
@@ -28,7 +28,7 @@ interface TokenBalance {
28
28
  /**
29
29
  * Asset type classification
30
30
  */
31
- type AssetType = 'native' | 'erc20' | 'erc721' | 'erc1155' | 'erc3643';
31
+ type AssetType = NormalizedAssetType;
32
32
  /**
33
33
  * NFT metadata from token instance
34
34
  */
@@ -76,29 +76,19 @@ interface AssetListError {
76
76
  /**
77
77
  * Represents a token or NFT asset
78
78
  */
79
- interface Asset {
79
+ interface Asset extends NormalizedAsset {
80
80
  /** Asset type classification */
81
- type: AssetType;
82
81
  /** Contract address (undefined for native token) */
83
- address?: `0x${string}`;
84
82
  /** Human-readable token name */
85
- name: string;
86
83
  /** Token symbol (e.g., "LUMIA", "USDC") */
87
- symbol: string;
88
84
  /** Raw balance as string (wei for fungible, count for NFT) */
89
- balance: string;
90
85
  /** Human-readable formatted balance */
91
- formattedBalance: string;
92
86
  /** Decimal precision (undefined for NFTs) */
93
- decimals?: number;
94
87
  /** USD rate reported by explorer when available */
95
88
  exchangeRateUsd?: string;
96
89
  /** NFT token ID (only for ERC721/ERC1155) */
97
- tokenId?: string;
98
90
  /** Token logo URL */
99
- logo?: string;
100
91
  /** NFT image URL (only for ERC721/ERC1155) */
101
- image?: string;
102
92
  /** NFT metadata (only for ERC721/ERC1155) */
103
93
  nftMetadata?: NFTMetadata;
104
94
  /** Security token compliance status (only for ERC3643) */
@@ -111,7 +101,15 @@ declare function useAssets(address?: `0x${string}`): {
111
101
  symbol: string;
112
102
  value: bigint;
113
103
  };
114
- tokenBalances: any;
104
+ tokenBalances: ({
105
+ error?: undefined;
106
+ result: unknown;
107
+ status: "success";
108
+ } | {
109
+ error: Error;
110
+ result?: undefined;
111
+ status: "failure";
112
+ })[];
115
113
  assets: Asset[];
116
114
  getTokenBalance: (tokenAddress: `0x${string}`) => {
117
115
  address: `0x${string}`;
@@ -123,7 +121,7 @@ declare function useAssets(address?: `0x${string}`): {
123
121
  logo: string;
124
122
  };
125
123
  refreshBalances: () => Promise<void>;
126
- isLoading: any;
124
+ isLoading: boolean;
127
125
  isConnected: boolean;
128
126
  };
129
127
  declare function useTokenInfo(tokenAddress: `0x${string}`): {
@@ -182,14 +180,6 @@ interface ProjectAsset extends Omit<Asset, 'type'> {
182
180
  balanceQuery: () => Promise<ProjectAssetBalance>;
183
181
  hideInPortfolio?: boolean;
184
182
  }
185
- interface AssetRateQueryInput {
186
- symbol: string;
187
- address?: `0x${string}`;
188
- }
189
- interface AssetRateQueryResult {
190
- symbol: string;
191
- price: string;
192
- }
193
183
  /**
194
184
  * Token configuration for custom token watching.
195
185
  * Used when chain doesn't have Blockscout API or for project-specific tokens.
@@ -236,9 +226,9 @@ interface ProviderConfig {
236
226
  allowedWallets?: string[];
237
227
  };
238
228
  preferedColorMode?: 'light' | 'dark';
229
+ showBalanceAs?: Asset['symbol'];
239
230
  projectAssets?: {
240
231
  assets: ProjectAsset[];
241
- showBalanceAs?: ProjectAsset['symbol'];
242
232
  };
243
233
  /**
244
234
  * Host-provided portfolio data overrides.
@@ -248,8 +238,6 @@ interface ProviderConfig {
248
238
  portfolio?: {
249
239
  tokenBalancesQuery?: (address: `0x${string}`) => Promise<BlockscoutTokenBalance[]>;
250
240
  tokenBalancesQueryKey?: readonly unknown[];
251
- assetRateQuery?: (input: AssetRateQueryInput) => Promise<AssetRateQueryResult | null>;
252
- assetRateQueryKey?: readonly unknown[];
253
241
  };
254
242
  /**
255
243
  * Custom tokens to monitor per chain.
@@ -1887,10 +1875,6 @@ declare function createAccountAbstractionError(params: {
1887
1875
 
1888
1876
  declare function getExplorerUrl(): string;
1889
1877
 
1890
- /**
1891
- * Hook for fetching all assets from Blockscout API
1892
- */
1893
-
1894
1878
  interface UseBlockscoutAssetsOptions {
1895
1879
  /** Wallet address to query */
1896
1880
  address: Address$1 | undefined;
@@ -1927,16 +1911,6 @@ interface UseBlockscoutAssetsResult {
1927
1911
  /** Timestamp of last successful fetch */
1928
1912
  lastUpdated: number | null;
1929
1913
  }
1930
- /**
1931
- * React hook for fetching all assets from Blockscout API
1932
- *
1933
- * @example
1934
- * ```tsx
1935
- * const { assets, isLoading, error, refreshBalances } = useBlockscoutAssets({
1936
- * address: '0x...',
1937
- * });
1938
- * ```
1939
- */
1940
1914
  declare function useBlockscoutAssets(options: UseBlockscoutAssetsOptions): UseBlockscoutAssetsResult;
1941
1915
 
1942
1916
  interface Transaction {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BatchOperation as BatchOperation$1 } from '@embarkai/core';
1
+ import { NormalizedAsset, NormalizedAssetType, BatchOperation as BatchOperation$1 } from '@embarkai/core';
2
2
  export { wagmiConfig } from '@embarkai/core';
3
3
  import * as react from 'react';
4
4
  import react__default, { ReactNode, RefObject, FC, HTMLAttributes, ButtonHTMLAttributes, SVGProps } from 'react';
@@ -28,7 +28,7 @@ interface TokenBalance {
28
28
  /**
29
29
  * Asset type classification
30
30
  */
31
- type AssetType = 'native' | 'erc20' | 'erc721' | 'erc1155' | 'erc3643';
31
+ type AssetType = NormalizedAssetType;
32
32
  /**
33
33
  * NFT metadata from token instance
34
34
  */
@@ -76,29 +76,19 @@ interface AssetListError {
76
76
  /**
77
77
  * Represents a token or NFT asset
78
78
  */
79
- interface Asset {
79
+ interface Asset extends NormalizedAsset {
80
80
  /** Asset type classification */
81
- type: AssetType;
82
81
  /** Contract address (undefined for native token) */
83
- address?: `0x${string}`;
84
82
  /** Human-readable token name */
85
- name: string;
86
83
  /** Token symbol (e.g., "LUMIA", "USDC") */
87
- symbol: string;
88
84
  /** Raw balance as string (wei for fungible, count for NFT) */
89
- balance: string;
90
85
  /** Human-readable formatted balance */
91
- formattedBalance: string;
92
86
  /** Decimal precision (undefined for NFTs) */
93
- decimals?: number;
94
87
  /** USD rate reported by explorer when available */
95
88
  exchangeRateUsd?: string;
96
89
  /** NFT token ID (only for ERC721/ERC1155) */
97
- tokenId?: string;
98
90
  /** Token logo URL */
99
- logo?: string;
100
91
  /** NFT image URL (only for ERC721/ERC1155) */
101
- image?: string;
102
92
  /** NFT metadata (only for ERC721/ERC1155) */
103
93
  nftMetadata?: NFTMetadata;
104
94
  /** Security token compliance status (only for ERC3643) */
@@ -111,7 +101,15 @@ declare function useAssets(address?: `0x${string}`): {
111
101
  symbol: string;
112
102
  value: bigint;
113
103
  };
114
- tokenBalances: any;
104
+ tokenBalances: ({
105
+ error?: undefined;
106
+ result: unknown;
107
+ status: "success";
108
+ } | {
109
+ error: Error;
110
+ result?: undefined;
111
+ status: "failure";
112
+ })[];
115
113
  assets: Asset[];
116
114
  getTokenBalance: (tokenAddress: `0x${string}`) => {
117
115
  address: `0x${string}`;
@@ -123,7 +121,7 @@ declare function useAssets(address?: `0x${string}`): {
123
121
  logo: string;
124
122
  };
125
123
  refreshBalances: () => Promise<void>;
126
- isLoading: any;
124
+ isLoading: boolean;
127
125
  isConnected: boolean;
128
126
  };
129
127
  declare function useTokenInfo(tokenAddress: `0x${string}`): {
@@ -182,14 +180,6 @@ interface ProjectAsset extends Omit<Asset, 'type'> {
182
180
  balanceQuery: () => Promise<ProjectAssetBalance>;
183
181
  hideInPortfolio?: boolean;
184
182
  }
185
- interface AssetRateQueryInput {
186
- symbol: string;
187
- address?: `0x${string}`;
188
- }
189
- interface AssetRateQueryResult {
190
- symbol: string;
191
- price: string;
192
- }
193
183
  /**
194
184
  * Token configuration for custom token watching.
195
185
  * Used when chain doesn't have Blockscout API or for project-specific tokens.
@@ -236,9 +226,9 @@ interface ProviderConfig {
236
226
  allowedWallets?: string[];
237
227
  };
238
228
  preferedColorMode?: 'light' | 'dark';
229
+ showBalanceAs?: Asset['symbol'];
239
230
  projectAssets?: {
240
231
  assets: ProjectAsset[];
241
- showBalanceAs?: ProjectAsset['symbol'];
242
232
  };
243
233
  /**
244
234
  * Host-provided portfolio data overrides.
@@ -248,8 +238,6 @@ interface ProviderConfig {
248
238
  portfolio?: {
249
239
  tokenBalancesQuery?: (address: `0x${string}`) => Promise<BlockscoutTokenBalance[]>;
250
240
  tokenBalancesQueryKey?: readonly unknown[];
251
- assetRateQuery?: (input: AssetRateQueryInput) => Promise<AssetRateQueryResult | null>;
252
- assetRateQueryKey?: readonly unknown[];
253
241
  };
254
242
  /**
255
243
  * Custom tokens to monitor per chain.
@@ -1887,10 +1875,6 @@ declare function createAccountAbstractionError(params: {
1887
1875
 
1888
1876
  declare function getExplorerUrl(): string;
1889
1877
 
1890
- /**
1891
- * Hook for fetching all assets from Blockscout API
1892
- */
1893
-
1894
1878
  interface UseBlockscoutAssetsOptions {
1895
1879
  /** Wallet address to query */
1896
1880
  address: Address$1 | undefined;
@@ -1927,16 +1911,6 @@ interface UseBlockscoutAssetsResult {
1927
1911
  /** Timestamp of last successful fetch */
1928
1912
  lastUpdated: number | null;
1929
1913
  }
1930
- /**
1931
- * React hook for fetching all assets from Blockscout API
1932
- *
1933
- * @example
1934
- * ```tsx
1935
- * const { assets, isLoading, error, refreshBalances } = useBlockscoutAssets({
1936
- * address: '0x...',
1937
- * });
1938
- * ```
1939
- */
1940
1914
  declare function useBlockscoutAssets(options: UseBlockscoutAssetsOptions): UseBlockscoutAssetsResult;
1941
1915
 
1942
1916
  interface Transaction {