@lifi/sdk
Version:
LI.FI Any-to-Any Cross-Chain-Swap SDK
26 lines • 768 B
JavaScript
import { isSVMAddress } from './isSVMAddress.js';
// Subject to change
// https://github.com/Bonfida/sns-sdk?tab=readme-ov-file#sdk-proxy
export const getSNSAddress = async (name) => {
try {
if (!name.endsWith('.sol')) {
return;
}
// const rpcUrl = await getRpcUrl(ChainId.SOL)
const snsWorkerUrl = `https://sns-sdk-proxy.bonfida.workers.dev/resolve/${name}`;
const response = await fetch(snsWorkerUrl);
if (!response.ok) {
return;
}
const data = await response.json();
if (!isSVMAddress(data.result)) {
return;
}
return data.result;
}
catch (_) {
// ignore
return;
}
};
//# sourceMappingURL=getSNSAddress.js.map