Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions engine/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/vultisig/recipes/engine/tron"
"github.com/vultisig/recipes/engine/utxo/bitcoin"
"github.com/vultisig/recipes/engine/utxo/bitcoincash"
"github.com/vultisig/recipes/engine/utxo/dash"
"github.com/vultisig/recipes/engine/utxo/dogecoin"
"github.com/vultisig/recipes/engine/utxo/litecoin"
"github.com/vultisig/recipes/engine/utxo/zcash"
Expand Down Expand Up @@ -82,6 +83,9 @@ func NewChainEngineRegistry() (*ChainEngineRegistry, error) {
// Register Zcash engine
registry.Register(zcash.NewZcash())

// Register Dash engine
registry.Register(dash.NewDash())

// Register Solana engine
solEng, err := solana.NewSolana()
if err != nil {
Expand Down
39 changes: 39 additions & 0 deletions engine/utxo/dash/dash.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package dash

import (
chaindash "github.com/vultisig/recipes/chain/utxo/dash"
"github.com/vultisig/recipes/engine/utxo"
"github.com/vultisig/recipes/types"
"github.com/vultisig/vultisig-go/common"
)

// Dash wraps the generic UTXO engine for Dash.
type Dash struct {
engine *utxo.Engine
}

// NewDash creates a new Dash engine.
func NewDash() *Dash {
return &Dash{
engine: utxo.NewEngine(utxo.Config{
ChainID: "dash",
SupportedChains: []common.Chain{common.Dash},
NetworkParams: chaindash.DashMainNetParams,
}),
}
}

// Supports returns true if this engine supports the given chain.
func (d *Dash) Supports(chain common.Chain) bool {
return d.engine.Supports(chain)
}

// Evaluate validates a transaction against the given rule.
func (d *Dash) Evaluate(rule *types.Rule, txBytes []byte) error {
return d.engine.Evaluate(rule, txBytes)
}

// ExtractTxBytes extracts transaction bytes from a PSBT string.
func (d *Dash) ExtractTxBytes(txData string) ([]byte, error) {
return d.engine.ExtractTxBytes(txData)
}