GetInterchain: perChain + chains options (default first anchor per chain)

Transaction.GetInterchain and Block.GetInterchain take variadic options
(client.WithPerChain / client.WithChains, re-exported as sdk.WithPerChain /
sdk.WithChains) that map to the new prime-node ?perChain=&chains= query params.
Backward compatible: existing no-option calls get the default (one anchor per
chain). client.InterchainQuery builds the suffix; unit-tested.
This commit is contained in:
2026-06-05 10:54:45 -04:00
parent 7d8e23768f
commit 17057ad1f2
7 changed files with 162 additions and 4 deletions

View File

@@ -113,3 +113,15 @@ func NewDragonchainSDKWithHTTPClient(publicID, authKeyID, authKey, baseURL strin
func (sdk *DragonchainSDK) GetClient() *client.Client {
return sdk.client
}
// InterchainOption configures Transaction.GetInterchain / Block.GetInterchain.
// Re-exported from the client package for convenience (e.g. sdk.WithPerChain).
type InterchainOption = client.InterchainOption
// WithPerChain caps interchain anchors returned per public chain (1 = first per
// chain, the default; 0 = all). See client.WithPerChain.
var WithPerChain = client.WithPerChain
// WithChains restricts an interchain trace to specific chain ids ("1" = ETH
// mainnet, "0" = BTC). See client.WithChains.
var WithChains = client.WithChains