dcrm

package
v0.0.0-...-590ca12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DcrmToAddress used in dcrm sign and accept
	DcrmToAddress = "0x00000000000000000000000000000000000000dc"
	// DcrmWalletServiceID to make dcrm signer
	DcrmWalletServiceID = 30400
)

Variables

View Source
var (
	ErrGetSignStatusTimeout = errors.New("getSignStatus timeout")
	ErrGetSignStatusFailed  = errors.New("getSignStatus failure")
)

get dcrm sign status error

View Source
var (

	// ServerDcrmUser dcrm initiator for sign
	ServerDcrmUser common.Address
)

Functions

func AcceptSign

func AcceptSign(raw string) (string, error)

AcceptSign call dcrm_acceptSign

func BuildDcrmRawTx

func BuildDcrmRawTx(nonce uint64, payload []byte) (string, error)

BuildDcrmRawTx build dcrm raw tx

func DoAcceptSign

func DoAcceptSign(keyID, agreeResult string, msgHash, msgContext []string) (string, error)

DoAcceptSign accept sign

func DoSign

func DoSign(msgHash, msgContext []string) (string, error)

DoSign dcrm sign msgHash with context msgContext

func DoSignOne

func DoSignOne(msgHash, msgContext string) (string, error)

DoSignOne dcrm sign single msgHash with context msgContext

func GetDcrmUser

func GetDcrmUser() common.Address

GetDcrmUser returns the dcrm user of specified keystore

func GetEnode

func GetEnode() (string, error)

GetEnode call dcrm_getEnode

func GetGroupID

func GetGroupID() string

GetGroupID return dcrm group id

func GetSignGroups

func GetSignGroups() []string

GetSignGroups get sign subgroups

func GetSignNonce

func GetSignNonce() (uint64, error)

GetSignNonce call dcrm_getSignNonce

func IsSwapServer

func IsSwapServer() bool

IsSwapServer returns if this dcrm user is the swap server

func LoadKeyStore

func LoadKeyStore(keyfile, passfile string) error

LoadKeyStore load keystore

func SetDcrmGroup

func SetDcrmGroup(group, thresh, mod string)

SetDcrmGroup set dcrm group

func SetDcrmRPCAddress

func SetDcrmRPCAddress(url string)

SetDcrmRPCAddress set dcrm node rpc address

func SetSignGroups

func SetSignGroups(groups []string)

SetSignGroups set sign subgroups

func SetSignPubkey

func SetSignPubkey(pubkey string)

SetSignPubkey set dcrm account public key

func Sign

func Sign(raw string) (string, error)

Sign call dcrm_sign

Types

type AcceptData

type AcceptData struct {
	TxType     string
	Key        string
	Accept     string
	MsgHash    []string
	MsgContext []string
	TimeStamp  string
}

AcceptData accpet data

type DataEnode

type DataEnode struct {
	Enode string
}

DataEnode enode

type DataResult

type DataResult struct {
	Result string `json:"result"`
}

DataResult result

type DataResultResp

type DataResultResp struct {
	Status string
	Tip    string
	Error  string
	Data   *DataResult
}

DataResultResp result response

type GetEnodeResp

type GetEnodeResp struct {
	Status string
	Tip    string
	Error  string
	Data   *DataEnode
}

GetEnodeResp enode response

type GetGroupByIDResp

type GetGroupByIDResp struct {
	Status string
	Tip    string
	Error  string
	Data   *GroupInfo
}

GetGroupByIDResp group response

type GroupInfo

type GroupInfo struct {
	GID    string
	Count  int
	Enodes []string
}

GroupInfo group info

func GetGroupByID

func GetGroupByID(groupID string) (*GroupInfo, error)

GetGroupByID call dcrm_getGroupByID

type SignData

type SignData struct {
	TxType     string
	PubKey     string
	MsgHash    []string
	MsgContext []string
	Keytype    string
	GroupID    string
	ThresHold  string
	Mode       string
	TimeStamp  string
}

SignData sign data

type SignInfoData

type SignInfoData struct {
	Account    string
	GroupID    string
	Key        string
	KeyType    string
	Mode       string
	MsgHash    []string
	MsgContext []string
	Nonce      string
	PubKey     string
	ThresHold  string
	TimeStamp  string
}

SignInfoData sign info

func GetCurNodeSignInfo

func GetCurNodeSignInfo() ([]*SignInfoData, error)

GetCurNodeSignInfo call dcrm_getCurNodeSignInfo

type SignInfoResp

type SignInfoResp struct {
	Status string
	Tip    string
	Error  string
	Data   []*SignInfoData
}

SignInfoResp sign info response

type SignReply

type SignReply struct {
	Enode     string
	Status    string
	TimeStamp string
	Initiator string
}

SignReply sign reply

type SignStatus

type SignStatus struct {
	Status    string
	Rsv       []string
	Tip       string
	Error     string
	AllReply  []*SignReply
	TimeStamp string
}

SignStatus sign status

func GetSignStatus

func GetSignStatus(key string) (*SignStatus, error)

GetSignStatus call dcrm_getSignStatus

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL