-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbsv_specific.go
More file actions
24 lines (20 loc) · 647 Bytes
/
Copy pathbsv_specific.go
File metadata and controls
24 lines (20 loc) · 647 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package whatsonchain
import (
"context"
)
// BSVService is the interface for BSV-specific endpoints
type BSVService interface {
GetOpReturnData(ctx context.Context, txHash string) (string, error)
TokenService
}
// GetOpReturnData gets OP_RETURN data by transaction hash (BSV-only endpoint)
//
// For more information: https://docs.whatsonchain.com/#get-op_return-data-by-tx-hash
func (c *Client) GetOpReturnData(ctx context.Context, txHash string) (string, error) {
// Only available for BSV
if c.Chain() != ChainBSV {
return "", ErrBSVChainRequired
}
url := c.buildURL("/tx/%s/opreturn", txHash)
return requestString(ctx, c, url)
}