api

package
v0.0.0-...-b5ced08 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateWalletRequest

type CreateWalletRequest struct {
	Name       string   `json:"name" binding:"required"`
	Threshold  int      `json:"threshold" binding:"required,min=2"` // 签名所需的最少节点数,至少为2
	TotalParts int      `json:"total_parts" binding:"required,min=2"`
	PartyIDs   []string `json:"party_ids" binding:"required"`
}

CreateWalletRequest 创建钱包请求

type RefreshRequest

type RefreshRequest struct {
	WalletID string `json:"wallet_id" binding:"required"`
}

RefreshRequest 刷新密钥分片请求

type ReshareRequest

type ReshareRequest struct {
	WalletID     string   `json:"wallet_id" binding:"required"`
	OldThreshold int      `json:"old_threshold" binding:"required,min=1"`
	OldPartyIDs  []string `json:"old_party_ids" binding:"required"`
	NewThreshold int      `json:"new_threshold" binding:"required,min=1"`
	NewPartyIDs  []string `json:"new_party_ids" binding:"required"`
}

ReshareRequest 重分享请求

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server HTTP API服务器

func NewServer

func NewServer(cfg *config.APIConfig, walletMgr *wallet.Manager, p2pHost *p2p.P2PHost) *Server

NewServer 创建API服务器

func (*Server) Start

func (s *Server) Start() error

Start 启动服务器

func (*Server) Stop

func (s *Server) Stop() error

Stop 停止服务器

type SignMessageRequest

type SignMessageRequest struct {
	WalletID  string   `json:"wallet_id" binding:"required"`
	Message   string   `json:"message" binding:"required"`
	SignerIDs []string `json:"signer_ids" binding:"required"`
}

SignMessageRequest 签名消息请求

Jump to

Keyboard shortcuts

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