From d6d6e4a245a6d6ce41f038d67472eaca7bd5c88c Mon Sep 17 00:00:00 2001 From: john Date: Thu, 26 Mar 2026 15:50:41 +0100 Subject: [PATCH] Add JSDoc to encodeMuxed() with @throws and @param tags Closes #125 --- packages/core-ts/src/muxed/encode.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/core-ts/src/muxed/encode.ts b/packages/core-ts/src/muxed/encode.ts index 5d4fd39..17844be 100644 --- a/packages/core-ts/src/muxed/encode.ts +++ b/packages/core-ts/src/muxed/encode.ts @@ -4,6 +4,16 @@ const { Account, MuxedAccount, StrKey } = StellarSdk; const MAX_UINT64 = 18446744073709551615n; +/** + * Encodes a muxed Stellar address using a base G address and numeric ID. + * + * @param baseG - The base G address (Ed25519 public key) to mux with + * @param id - The numeric ID to append to the base address (must be uint64) + * @returns The encoded muxed address string + * @throws {TypeError} When the ID parameter is not a bigint + * @throws {RangeError} When the ID is outside the uint64 range (0 to 18446744073709551615) + * @throws {Error} When the base G address is not a valid Ed25519 public key + */ export function encodeMuxed(baseG: string, id: bigint): string { if (typeof id !== "bigint") { throw new TypeError(`ID must be a bigint, received ${typeof id}`);