@swapper-finance/sdk
Version:
JavaScript SDK form Swapper
14 lines (11 loc) • 412 B
text/typescript
export const shortAddress = (address: string): string => {
return `${address?.substring(0, 5)}...${address?.substring(
address.length - 5,
address.length,
)}`;
};
export const isETHAddressValid = (address: string): boolean => {
return /^0x[a-fA-F0-9]{40}$/.test(address);
};
export const includesIgnoreCase = (value, searchValue) =>
value.toLowerCase().indexOf(searchValue.toLowerCase()) > -1;