service

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: AGPL-3.0 Imports: 20 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsString added in v0.0.5

func ContainsString(slice []string, str string) bool

func GenerateNewKeyPair

func GenerateNewKeyPair() (*secp256k1.PrivateKey, *secp256k1.PublicKey)

func Get2wayTLSClient added in v0.0.5

func Get2wayTLSClient(cfg *config.Config) (client *http.Client, err error)

func IsValidHex

func IsValidHex(s string) bool

Types

type ISlip39 added in v0.0.5

type ISlip39 interface {
	Generate(groupThreshold uint8, groups []slip39.GroupDescriptor, secret []byte, password string, iterationExponent uint8, randomGenerator *[0]byte) (result, wordsInEachShare int, sharesBuffer []uint16, err error)
	Random() (random *[0]byte)
	StringsForWords(words []uint16, wordsInEachShare int) (result string, err error)
	Combine(mnemonics [][]uint16, passphrase string) (secret []byte, err error)
	WordsForStrings(strings string, wordsInEachShare int) (words []uint16, err error)
}

type MnemonicsResponse added in v0.0.5

type MnemonicsResponse struct {
	Mnemonics []string `binding:"required" json:"mnemonics"`
	Seed      string   `binding:"required" json:"seed"`
}

type SendTokensRequest added in v0.0.5

type SendTokensRequest struct {
	Recipient string `binding:"required" json:"recipient"`
	Amount    string `binding:"required" json:"amount"`
}

type SendTokensResponse added in v0.0.5

type SendTokensResponse struct {
	TxID string `binding:"required" json:"tx-id"`
}

type ShamirCoordinatorService

type ShamirCoordinatorService struct {
	Router *gin.Engine
	// contains filtered or unexported fields
}

func NewShamirCoordinatorService

func NewShamirCoordinatorService(cfg *config.Config, sscs map[string]client.IShamirShareholderClient, slip39Interface ISlip39, logger log.AppLogger) *ShamirCoordinatorService

func (*ShamirCoordinatorService) CollectMnemonics

func (s *ShamirCoordinatorService) CollectMnemonics() (mnemonics []string, err error)

func (*ShamirCoordinatorService) CollectShares added in v0.0.5

func (s *ShamirCoordinatorService) CollectShares(c *gin.Context)

func (*ShamirCoordinatorService) CreateMnemonics

func (s *ShamirCoordinatorService) CreateMnemonics(hexSecret string) (mnemonics []string, err error)

func (*ShamirCoordinatorService) DeployShares added in v0.0.5

func (s *ShamirCoordinatorService) DeployShares(c *gin.Context)

func (*ShamirCoordinatorService) GetRoutes

func (s *ShamirCoordinatorService) GetRoutes() gin.RoutesInfo

func (*ShamirCoordinatorService) IsWalletLoaded added in v0.0.5

func (s *ShamirCoordinatorService) IsWalletLoaded(rpcURL string, walletname string) (loaded bool, err error)

func (*ShamirCoordinatorService) PrepareWallet added in v0.0.5

func (s *ShamirCoordinatorService) PrepareWallet(passphrase string) (err error)

func (*ShamirCoordinatorService) RecoverSeed

func (s *ShamirCoordinatorService) RecoverSeed(mnemonics []string) (seed string, err error)

func (*ShamirCoordinatorService) Run

func (s *ShamirCoordinatorService) Run() (err error)

func (*ShamirCoordinatorService) SendAsset

func (s *ShamirCoordinatorService) SendAsset(address string, amount string) (txID string, err error)

func (*ShamirCoordinatorService) SendTokens added in v0.0.5

func (s *ShamirCoordinatorService) SendTokens(c *gin.Context)

type Slip39Interface added in v0.0.5

type Slip39Interface struct {
}

func (*Slip39Interface) Combine added in v0.0.5

func (s *Slip39Interface) Combine(mnemonics [][]uint16, passphrase string) (secret []byte, err error)

func (*Slip39Interface) Generate added in v0.0.5

func (s *Slip39Interface) Generate(groupThreshold uint8, groups []slip39.GroupDescriptor, secret []byte, password string, iterationExponent uint8, randomGenerator *[0]byte) (result, wordsInEachShare int, sharesBuffer []uint16, err error)

func (*Slip39Interface) Random added in v0.0.5

func (s *Slip39Interface) Random() (random *[0]byte)

func (*Slip39Interface) StringsForWords added in v0.0.5

func (s *Slip39Interface) StringsForWords(words []uint16, wordsInEachShare int) (result string, err error)

func (*Slip39Interface) WordsForStrings added in v0.0.5

func (s *Slip39Interface) WordsForStrings(strings string, wordsInEachShare int) (words []uint16, err error)

Jump to

Keyboard shortcuts

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