Skip to content
Merged
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
31 changes: 31 additions & 0 deletions internal/cmd/coinset/get_mempool_items_by_coin_name.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package cmd

import (
"fmt"

"github.com/spf13/cobra"
)

func init() {
rootCmd.AddCommand(getMempoolItemsByCoinName)
}

var getMempoolItemsByCoinName = &cobra.Command{
Use: "get_mempool_items_by_coin_name <coin_name>",
Args: func(cmd *cobra.Command, args []string) error {
if err := cobra.ExactArgs(1)(cmd, args); err != nil {
return err
}
if isHex(args[0]) == true {
return nil
}
return fmt.Errorf("invalid hex value specified: %s", args[0])
},
Short: "Returns mempool items by coin name",
Long: "Returns mempool items by coin name",
Run: func(cmd *cobra.Command, args []string) {
jsonData := map[string]interface{}{}
jsonData["coin_name"] = formatHex(args[0])
makeRequest("get_mempool_items_by_coin_name", jsonData)
},
}
Loading