Skip to content

Commit c26c02f

Browse files
authored
Merge pull request #7615 from BitGo/WP-6972-fix-docs
docs(express): fix docs for canonical address conversion
2 parents dfaea9e + 06d396d commit c26c02f

File tree

1 file changed

+6
-34
lines changed

1 file changed

+6
-34
lines changed

modules/express/src/typedRoutes/api/v2/canonicalAddress.ts

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import { BitgoExpressError } from '../../schemas/error';
66
* Request parameters for canonical address conversion
77
*/
88
export const CanonicalAddressRequestParams = {
9-
/** Coin identifier - must be ltc, bch, bsv or their testnet equivalents (tltc, tbch, tbsv) */
9+
/** A cryptocurrency or token ticker symbol. */
1010
coin: t.string,
1111
} as const;
1212

1313
/**
1414
* Request body for canonical address conversion
1515
*/
1616
export const CanonicalAddressRequestBody = {
17-
/** Address to canonicalize - can be in any supported format (base58, cashaddr for BCH only, etc.) */
17+
/** Address to canonicalize */
1818
address: t.string,
1919
/** Desired address format: 'base58' (supported by BCH, BSV, LTC) or 'cashaddr' (supported by BCH only). Defaults to 'base58'. LTC ignores this parameter. */
2020
version: optional(t.union([t.literal('base58'), t.literal('cashaddr')])),
@@ -23,38 +23,10 @@ export const CanonicalAddressRequestBody = {
2323
} as const;
2424

2525
/**
26-
* Canonicalize address format
26+
* Canonicalize an LTC or BCH address.
2727
*
28-
* Converts cryptocurrency addresses between different formats. This endpoint is specifically
29-
* designed for coins that support multiple address formats.
30-
*
31-
* **Supported Coins:**
32-
* - **Bitcoin Cash (BCH/TBCH)**: Converts between base58 and cashaddr formats
33-
* - **Bitcoin SV (BSV/TBSV)**: Supports base58 format only (cashaddr not supported)
34-
* - **Litecoin (LTC/TLTC)**: Returns address unchanged (included for API consistency)
35-
*
36-
* **Address Formats:**
37-
* - **base58**: Traditional Bitcoin-style addresses (e.g., '1BpEi6DfDAUFd7GtittLSdBeYJvcoaVggu', '3CWFddi6m4ndiGyKqzYvsFYagqDLPVMTzC')
38-
* - **cashaddr**: Bitcoin Cash address format with network prefix (e.g., 'bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a')
39-
*
40-
* **BCH Behavior:**
41-
* - version='base58': Converts any input format to base58 canonical format
42-
* - version='cashaddr': Converts any input format to cashaddr format (adds network prefix if missing)
43-
* - Default (no version): Converts to base58 format
44-
*
45-
* **BSV Behavior (Deprecated):**
46-
* - version='base58': Converts address to base58 canonical format
47-
* - version='cashaddr': Not supported - will return error "unsupported address format cashaddr for network bitcoinsv"
48-
* - Default (no version): Converts to base58 format
49-
*
50-
* **LTC Behavior:**
51-
* - Returns the input address unchanged regardless of version parameter
52-
* - Included for API consistency but performs no transformation
53-
*
54-
* **Response:** Returns the canonical address string directly (as JSON string primitive).
55-
*
56-
* @operationId express.v2.canonicaladdress
57-
* @tag express
28+
* @operationId express.canonicaladdress
29+
* @tag Express
5830
*/
5931
export const PostCanonicalAddress = httpRoute({
6032
path: '/api/v2/{coin}/canonicaladdress',
@@ -64,7 +36,7 @@ export const PostCanonicalAddress = httpRoute({
6436
body: CanonicalAddressRequestBody,
6537
}),
6638
response: {
67-
/** Successfully converted address. Returns the canonical address string in the requested format. */
39+
/** OK */
6840
200: t.string,
6941
/** Error response (e.g., unsupported coin, invalid address format, invalid version parameter) */
7042
400: BitgoExpressError,

0 commit comments

Comments
 (0)