Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/snaps-sdk/src/jsx/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,12 @@ export const DropdownStruct: Describe<DropdownElement> = element('Dropdown', {
* A struct for the {@link AddressElement} type.
*/
export const AddressStruct: Describe<AddressElement> = element('Address', {
address: nullUnion([HexChecksumAddressStruct, CaipAccountIdStruct]),
address: selectiveUnion((value) => {
if (typeof value === 'string' && value.startsWith('0x')) {
return HexChecksumAddressStruct;
}
return CaipAccountIdStruct;
}),
truncate: optional(boolean()),
displayName: optional(boolean()),
avatar: optional(boolean()),
Expand Down
Loading