diff options
Diffstat (limited to 'src/client/utils.ts')
-rw-r--r-- | src/client/utils.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/client/utils.ts b/src/client/utils.ts new file mode 100644 index 0000000..cd9c8ba --- /dev/null +++ b/src/client/utils.ts @@ -0,0 +1,20 @@ +// Simple utility to determine DigiByte address type based on prefix + +export type DigiByteAddressType = 'DigiByte (DGB)' | 'DigiAsset (DGA)' | 'Unknown'; + +export function getDigiByteAddressType(address: string | undefined | null): DigiByteAddressType { + if (!address) { + return 'Unknown'; + } + if (address.startsWith('dgb1')) { + return 'DigiByte (DGB)'; + } + // Add other prefixes if DigiAssets use a distinct one, e.g., 'dga1' + // For now, assume non-DGB is DigiAsset, but this might need refinement + // depending on actual DigiAsset address formats. + else { + // Assuming DigiAssets might start differently or be the fallback + // This is a placeholder assumption. + return 'DigiAsset (DGA)'; // Placeholder - ADJUST BASED ON ACTUAL DGA PREFIX + } +}
\ No newline at end of file |