@@ -7,9 +7,15 @@ import { createSnapComponent } from '../component';
7
7
*
8
8
* @property address - The (Ethereum) address to display. This should be a
9
9
* valid Ethereum address, starting with `0x`, or a valid CAIP-10 address.
10
+ * @property truncate - Whether to truncate the address. Defaults to `true`.
11
+ * @property displayName - Whether to show the account name. Defaults to `false`.
12
+ * @property avatar - Whether to show the address avatar. Defaults to `true`.
10
13
*/
11
14
export type AddressProps = {
12
15
address : `0x${string } ` | CaipAccountId ;
16
+ truncate ?: boolean | undefined ;
17
+ displayName ?: boolean | undefined ;
18
+ avatar ?: boolean | undefined ;
13
19
} ;
14
20
15
21
const TYPE = 'Address' ;
@@ -22,13 +28,20 @@ const TYPE = 'Address';
22
28
* @param props - The props of the component.
23
29
* @param props.address - The address to display. This should be a
24
30
* valid Ethereum address, starting with `0x`, or a valid CAIP-10 address.
31
+ * @param props.truncate - Whether to truncate the address. Defaults to `true`.
32
+ * @param props.displayName - Whether to show the account name. Defaults to `false`.
33
+ * @param props.avatar - Whether to show the address avatar. Defaults to `true`.
25
34
* @returns An address element.
26
35
* @example
27
36
* <Address address="0x1234567890123456789012345678901234567890" />
28
37
* @example
29
38
* <Address address="eip155:1:0x1234567890123456789012345678901234567890" />
30
39
* @example
31
40
* <Address address="bip122:000000000019d6689c085ae165831e93:128Lkh3S7CkDTBZ8W7BbpsN3YYizJMp8p6" />
41
+ * @example
42
+ * <Address address="0x1234567890123456789012345678901234567890" truncate={false} avatar={false} />
43
+ * @example
44
+ * <Address address="0x1234567890123456789012345678901234567890" displayName={true} />
32
45
*/
33
46
export const Address = createSnapComponent < AddressProps , typeof TYPE > ( TYPE ) ;
34
47
0 commit comments