Skip to content

Commit 9d4a1de

Browse files
committed
fix JSDoc comments
1 parent 72cb916 commit 9d4a1de

File tree

2 files changed

+30
-33
lines changed

2 files changed

+30
-33
lines changed

packages/xrpl/src/models/common/index.ts

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,7 @@ export interface PriceData {
220220
}
221221

222222
/**
223-
* MPTokenMetadata object as per the XLS-89 standard.
224-
* Represents metadata for a Multi-Purpose Token using long-form field names.
225-
* This format is more human-readable and is recommended for client-side usage.
223+
* {@link MPTokenMetadata} object as per the XLS-89 standard.
226224
* Use {@link encodeMPTokenMetadata} utility function to convert to a compact hex string for on-ledger storage.
227225
* Use {@link decodeMPTokenMetadata} utility function to convert from a hex string to this format.
228226
*/
@@ -243,6 +241,14 @@ export interface MPTokenMetadata {
243241
*/
244242
name: string
245243

244+
/**
245+
* Short description of the token.
246+
* Any UTF-8 string.
247+
*
248+
* @example "A yield-bearing stablecoin backed by short-term U.S. Treasuries"
249+
*/
250+
desc?: string
251+
246252
/**
247253
* URI to the token icon.
248254
* Can be a `hostname/path` (HTTPS assumed) or full URI for other protocols (e.g., ipfs://).
@@ -259,22 +265,6 @@ export interface MPTokenMetadata {
259265
*/
260266
asset_class: string
261267

262-
/**
263-
* The name of the issuer account.
264-
* Any UTF-8 string.
265-
*
266-
* @example "Example Yield Co."
267-
*/
268-
issuer_name: string
269-
270-
/**
271-
* Short description of the token.
272-
* Any UTF-8 string.
273-
*
274-
* @example "A yield-bearing stablecoin backed by short-term U.S. Treasuries"
275-
*/
276-
desc?: string
277-
278268
/**
279269
* Optional subcategory of the asset class.
280270
* Required if `asset_class` is "rwa".
@@ -284,6 +274,14 @@ export interface MPTokenMetadata {
284274
*/
285275
asset_subclass?: string
286276

277+
/**
278+
* The name of the issuer account.
279+
* Any UTF-8 string.
280+
*
281+
* @example "Example Yield Co."
282+
*/
283+
issuer_name: string
284+
287285
/**
288286
* List of related URIs (site, dashboard, social media, documentation, etc.).
289287
* Each URI object contains the link, its category, and a human-readable title.
@@ -300,8 +298,7 @@ export interface MPTokenMetadata {
300298
}
301299

302300
/**
303-
* MPTokenMetadataUri object as per the XLS-89 standard.
304-
* Represents a URI entry in the MPTokenMetadata using long-form field names.
301+
* {@link MPTokenMetadataUri} object as per the XLS-89 standard.
305302
* Used within the `uris` array of {@link MPTokenMetadata}.
306303
*/
307304
export interface MPTokenMetadataUri {

packages/xrpl/src/models/transactions/common.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ export function isDomainID(domainID: unknown): domainID is string {
10021002

10031003
/**
10041004
* Shortens long field names to their compact form equivalents.
1005-
* Reverse operation of expandKeys.
1005+
* Reverse operation of {@link expandKeys}.
10061006
*
10071007
* @param input - Object with potentially long field names.
10081008
* @param mappings - Array of field mappings with long and compact names.
@@ -1040,15 +1040,15 @@ function shortenKeys(
10401040
}
10411041

10421042
/**
1043-
* Encodes MPTokenMetadata object to a hex string.
1043+
* Encodes {@link MPTokenMetadata} object to a hex string.
10441044
* Steps:
10451045
* 1. Shorten long field names to their compact form equivalents.
10461046
* 2. Sort the fields alphabetically for deterministic encoding.
10471047
* 3. Stringify the object.
10481048
* 4. Convert to hex.
10491049
*
1050-
* @param mptokenMetadata - MPTokenMetadata to encode.
1051-
* @returns Hex encoded MPTokenMetadata.
1050+
* @param mptokenMetadata - {@link MPTokenMetadata} to encode.
1051+
* @returns Hex encoded {@link MPTokenMetadata}.
10521052
* @throws Error if input is not a JSON object.
10531053
* @category Utilities
10541054
*/
@@ -1091,7 +1091,7 @@ export function encodeMPTokenMetadata(
10911091

10921092
/**
10931093
* Expands compact field names to their long form equivalents.
1094-
* Reverse operation of shortenKeys.
1094+
* Reverse operation of {@link shortenKeys}.
10951095
*
10961096
* @param input - Object with potentially compact field names.
10971097
* @param mappings - Array of field mappings with long and compact names.
@@ -1129,11 +1129,11 @@ function expandKeys(
11291129
}
11301130

11311131
/**
1132-
* Decodes hex encoded MPTokenMetadata to a JSON object with long field names.
1133-
* Converts compact field names back to their long form equivalents.
1132+
* Decodes hex-encoded {@link MPTokenMetadata} into a JSON object.
1133+
* Converts compact field names to their corresponding long-form equivalents.
11341134
*
1135-
* @param input - Hex encoded MPTokenMetadata.
1136-
* @returns Decoded MPTokenMetadata object with long field names.
1135+
* @param input - Hex encoded {@link MPTokenMetadata}.
1136+
* @returns Decoded {@link MPTokenMetadata} object with long field names.
11371137
* @throws Error if input is not valid hex or cannot be parsed as JSON.
11381138
* @category Utilities
11391139
*/
@@ -1187,10 +1187,10 @@ export function decodeMPTokenMetadata(input: string): MPTokenMetadata {
11871187
}
11881188

11891189
/**
1190-
* Validates MPTokenMetadata adheres to XLS-89 standard.
1190+
* Validates {@link MPTokenMetadata} adheres to XLS-89 standard.
11911191
*
1192-
* @param input - Hex encoded MPTokenMetadata.
1193-
* @returns Validation messages if MPTokenMetadata does not adheres to XLS-89 standard.
1192+
* @param input - Hex encoded {@link MPTokenMetadata}.
1193+
* @returns Validation messages if {@link MPTokenMetadata} does not adheres to XLS-89 standard.
11941194
* @category Utilities
11951195
*/
11961196
export function validateMPTokenMetadata(input: string): string[] {

0 commit comments

Comments
 (0)