Skip to content

Commit 1e4f72b

Browse files
committed
docs(express): update canonicalAddress API docs
- BSV supports base58 only (not cashaddr) - Update parameter descriptions (cashaddr = BCH-only) - Add BSV deprecation TICKET: WP-6972
1 parent 001c662 commit 1e4f72b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ export const CanonicalAddressRequestParams = {
1414
* Request body for canonical address conversion
1515
*/
1616
export const CanonicalAddressRequestBody = {
17-
/** Address to canonicalize - can be in any supported format (base58, cashaddr, etc.) */
17+
/** Address to canonicalize - can be in any supported format (base58, cashaddr for BCH only, etc.) */
1818
address: t.string,
19-
/** Desired address format: 'base58' or 'cashaddr' (BCH/BSV: defaults to 'base58', LTC: ignored as addresses are returned unchanged) */
19+
/** 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')])),
2121
/** @deprecated Use version instead. Fallback parameter for version. */
2222
scriptHashVersion: optional(t.union([t.literal('base58'), t.literal('cashaddr')])),
@@ -30,18 +30,23 @@ export const CanonicalAddressRequestBody = {
3030
*
3131
* **Supported Coins:**
3232
* - **Bitcoin Cash (BCH/TBCH)**: Converts between base58 and cashaddr formats
33-
* - **Bitcoin SV (BSV/TBSV)**: Converts between base58 and cashaddr formats
33+
* - **Bitcoin SV (BSV/TBSV)**: Supports base58 format only (cashaddr not supported)
3434
* - **Litecoin (LTC/TLTC)**: Returns address unchanged (included for API consistency)
3535
*
3636
* **Address Formats:**
3737
* - **base58**: Traditional Bitcoin-style addresses (e.g., '1BpEi6DfDAUFd7GtittLSdBeYJvcoaVggu', '3CWFddi6m4ndiGyKqzYvsFYagqDLPVMTzC')
3838
* - **cashaddr**: Bitcoin Cash address format with network prefix (e.g., 'bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a')
3939
*
40-
* **BCH/BSV Behavior:**
40+
* **BCH Behavior:**
4141
* - version='base58': Converts any input format to base58 canonical format
4242
* - version='cashaddr': Converts any input format to cashaddr format (adds network prefix if missing)
4343
* - Default (no version): Converts to base58 format
4444
*
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+
*
4550
* **LTC Behavior:**
4651
* - Returns the input address unchanged regardless of version parameter
4752
* - Included for API consistency but performs no transformation

0 commit comments

Comments
 (0)