crossmintTokenLocator function
Implementation
String crossmintTokenLocator(String token, {required String chain}) {
final String trimmed = token.trim();
if (trimmed.isEmpty) {
throw const CrossmintWalletException(
'Wallet token transfer requires a token symbol or token locator.',
);
}
if (trimmed.contains(':')) {
return trimmed;
}
if (_isHexAddress(trimmed)) {
return '$chain:$trimmed';
}
return '$chain:${trimmed.toLowerCase()}';
}