getInterchain: perChain + chains options (default first anchor per chain); bump 1.5.0
transaction.getInterchain / block.getInterchain take an optional
{ perChain?, chains? } that maps to prime-node's ?perChain=&chains= params.
Default (no options) returns one anchor per chain. Shared buildInterchainQuery
helper + InterchainOptions type, exported; jest-tested.
This commit is contained in:
18
README.md
18
README.md
@@ -145,6 +145,24 @@ await sdk.transactionType.delete('my-type');
|
||||
const block = await sdk.block.get('block-id');
|
||||
```
|
||||
|
||||
### Interchain trace
|
||||
|
||||
`transaction.getInterchain` / `block.getInterchain` trace a prime block to the
|
||||
public-chain anchors covering it. By default they return the **first anchor per
|
||||
chain** (anchor proofs are chained, so the earliest per chain is the meaningful
|
||||
one). Tune with options:
|
||||
|
||||
```typescript
|
||||
// Default: first anchor per chain (ETH, BTC, …)
|
||||
const trace = await sdk.block.getInterchain('42');
|
||||
|
||||
// Up to 3 anchors per chain
|
||||
await sdk.block.getInterchain('42', { perChain: 3 });
|
||||
|
||||
// All anchors, only the ETH-mainnet chain ("1"); "0" = BTC
|
||||
await sdk.block.getInterchain('42', { perChain: 0, chains: ['1'] });
|
||||
```
|
||||
|
||||
### Proof Measure (public, unauthenticated)
|
||||
|
||||
`proof-measure` is a separate, **public, unauthenticated** Dragonchain service
|
||||
|
||||
Reference in New Issue
Block a user