handshake-org / handshake-org/hsd
feature request: covenant library helper functions
Open
covenants
Feature Request
- Dominant language
- JavaScript
- Stars
- 2.1k
- Forks
- 306
- PR merge metrics
- No merged PRs in 30d
Description
Replaces https://github.com/handshake-org/hsd/issues/619
For library users I think we can make covenants easier to navigate. For example, we could add getters for all the covenant items:
```
nameHash
height
renewalBlock
resource
rawName
addressVersion
addressHash
```
Example:
```
// OPEN
const rawName = tx.output[0].covenant.rawName;
// "proofofconcept"
console.log(rawName)
```
Getter functions could throw or return `null` if a datum is requested that is not part of that covenant's items. Setters could be interesting too, or even "options" functions like:
```
covenant.makeOpen({
nameHash,
height
})
```
Contributor guide
Assessment
This issue has not been assessed yet.