handshake-org / handshake-org/hsd

feature request: covenant library helper functions

Open
#703 1 comment 1 reaction 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.