The Problem
JavaScript’sNumber type is a 64-bit float, which cannot safely represent all 64-bit integers (specifically those above 2^53 - 1).
The Solution
Stellar Address Kit always returns theroutingId as a string to avoid any precision loss.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Handling muxed deposits in TypeScript.
Number type is a 64-bit float, which cannot safely represent all 64-bit integers (specifically those above 2^53 - 1).
routingId as a string to avoid any precision loss.
import { extractRouting } from 'stellar-address-kit';
const result = extractRouting({
address: "MA7Q...QD"
});
// ALWAYS use the string value for DB lookups
const userId = result.routingId;
if (result.warnings.some(w => w.code === 'JS_PRECISION_LOSS')) {
// This would trigger if you tried to pass a number that was too large
}