Skip to content

Commit 124c68a

Browse files
committed
docs(canton): document heightId block lookups
Document that Canton block endpoints require the canonical heightId, which combines the ledger offset with its version. This prevents integrations from using the resettable numeric height and receiving block-not-found responses. Ticket: CHALO-1391 Session-Id: aac79c39-de9d-43ad-95cc-a5eeff6b03f4 Task-Id: 26024075-bd80-4b4b-928c-179360ccf2bf
1 parent b46bf75 commit 124c68a

1 file changed

Lines changed: 39 additions & 1 deletion

File tree

modules/sdk-coin-canton/README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,45 @@ const sdk = new BitGoAPI();
2323
sdk.register('canton', Canton.createInstance);
2424
```
2525

26-
## Development
26+
## Block lookup
27+
28+
Canton block identifiers are ledger offsets rather than conventional blockchain
29+
block hashes. A ledger can be reset, so the offset is only unique together with
30+
the ledger version.
31+
32+
When looking up a Canton block, use the transfer's `heightId` value from the
33+
Get Transfer API response as the `{height}` path parameter. Do not use the
34+
plain numeric `height` value: it represents only the ledger offset and can
35+
refer to a different ledger after a reset.
36+
37+
```text
38+
GET /api/v2/canton/public/block/{heightId}
39+
```
40+
41+
For example, a transfer response containing:
42+
43+
```json
44+
{
45+
"height": 6291143,
46+
"heightId": "006291143-6a85688d879741a95e3940b671adb39b"
47+
}
48+
```
49+
50+
must be followed by:
51+
52+
```text
53+
GET /api/v2/canton/public/block/006291143-6a85688d879741a95e3940b671adb39b
54+
```
55+
56+
A request using `/public/block/6291143` can return `block not found`, even
57+
when the transfer exists. The `heightId` is the canonical Canton block
58+
identifier and includes both the offset and the ledger version.
59+
60+
This is a Canton-specific exception to the usual block lookup pattern. For
61+
other coins, use the block identifier documented for that coin; for coins
62+
with conventional, non-resetting block heights, the numeric `height` can be
63+
used. No other coin-specific `heightId` exception is defined by this package.
64+
2765

2866
Most of the coin implementations are derived from `@bitgo/sdk-core`, `@bitgo/statics`, and coin specific packages. These implementations are used to interact with the BitGo API and BitGo platform services.
2967

0 commit comments

Comments
 (0)