Documentation ¶
Index ¶
- func WithAddr(addr string) func(*Options)
- func WithClient(cli *rpcclient.Client) func(*Options)
- func WithDB(db *dao.DB) func(*Options)
- func WithEngin(g *gin.Engine) func(*Options)
- func WithIndexerDB(db *indexer.DB) func(*Options)
- func WithTestNet(testnet bool) func(*Options)
- type CInsDescription
- type CreateCbr20DeployOrderReq
- type Handler
- func (h *Handler) BlockHeight(ctx *gin.Context)
- func (h *Handler) CreateCbr20DeployOrder(ctx *gin.Context)
- func (h *Handler) DB() *dao.DB
- func (h *Handler) Engine() *gin.Engine
- func (h *Handler) EstimateSmartFee(ctx *gin.Context)
- func (h *Handler) GetChainParams() *chaincfg.Params
- func (h *Handler) HomePageStatistics(ctx *gin.Context)
- func (h *Handler) IndexerDB() *indexer.DB
- func (h *Handler) InitRouter()
- func (h *Handler) InscribeOrders(ctx *gin.Context)
- func (h *Handler) Inscriptions(ctx *gin.Context)
- func (h *Handler) L2Networks(ctx *gin.Context)
- func (h *Handler) OrderStatus(ctx *gin.Context)
- func (h *Handler) RpcClient() *rpcclient.Client
- func (h *Handler) Run() error
- type HomePageStatisticsResp
- type InscribeOrderResp
- type InscribeOrdersResp
- type InscriptionEntry
- type InscriptionsReq
- type InscriptionsResp
- type Option
- type Options
- type OrderStatusResp
- type SearchType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithAddr ¶
WithAddr is a function that sets the address option for an Options struct. It takes a string representing the address and returns a function that sets the address option in the Options struct.
func WithClient ¶
WithClient is a function that sets the rpcclient option for an Options struct. It takes a pointer to a rpcclient.Client representing the rpcclient and returns a function that sets the rpcclient option in the Options struct.
func WithDB ¶
WithDB is a function that sets the database option for an Options struct. It takes a pointer to a dao.DB representing the database and returns a function that sets the database option in the Options struct.
func WithEngin ¶
WithEngin is a function that sets the gin engine option for an Options struct. It takes a pointer to a gin.Engine representing the gin engine and returns a function that sets the gin engine option in the Options struct.
func WithIndexerDB ¶
func WithTestNet ¶
WithTestNet is a function that sets the testnet option for an Options struct. It takes a boolean value representing whether to use the testnet or not and returns a function that sets the testnet option in the Options struct.
Types ¶
type CInsDescription ¶
type CreateCbr20DeployOrderReq ¶
type CreateCbr20DeployOrderReq struct { Postage int64 `json:"postage" binding:"min=330,max=10000"` FeatRate int64 `json:"fee_rate" binding:"gt=0"` Ticker string `json:"ticker" binding:"required"` TotalSupply string `json:"total_supply" binding:"required"` LimitPerMint string `json:"limit_per_mint" binding:"required"` L2NetWork string `json:"l2_network" binding:"required"` Contract string `json:"contract" binding:"required"` ReceiveAddress string `json:"receive_address" binding:"required"` }
func (*CreateCbr20DeployOrderReq) Check ¶
func (req *CreateCbr20DeployOrderReq) Check() error
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a struct that holds the options for handling requests.
func New ¶
New is a function that creates a new Handler with the given options. It takes a variadic number of Option functions and applies them to the options of the Handler. It returns a pointer to the newly created Handler and any error that occurred during the creation.
func (*Handler) BlockHeight ¶
BlockHeight return latest block height
func (*Handler) CreateCbr20DeployOrder ¶
func (*Handler) Engine ¶
Engine is a method that returns the gin engine from the options of a Handler.
func (*Handler) EstimateSmartFee ¶
func (*Handler) GetChainParams ¶
GetChainParams is a method that returns the chain parameters based on the testnet option of a Handler. If the testnet option is set to true, it returns the TestNet3Params. Otherwise, it returns the MainNetParams.
func (*Handler) HomePageStatistics ¶
func (*Handler) IndexerDB ¶
IndexerDB is a method that returns the indexer database from the options of a Handler.
func (*Handler) InitRouter ¶
func (h *Handler) InitRouter()
func (*Handler) InscribeOrders ¶
func (*Handler) Inscriptions ¶
func (*Handler) L2Networks ¶
func (*Handler) OrderStatus ¶
func (*Handler) RpcClient ¶
RpcClient is a method that returns the rpcclient from the options of a Handler.
func (*Handler) Run ¶
Run is a method that starts the HTTP server of a Handler. It initializes the router, creates a new HTTP server and starts listening for requests. It also adds an interrupt handler that gracefully shuts down the server when an interrupt signal is received. It returns any error that occurred during the process.
type HomePageStatisticsResp ¶
type InscribeOrderResp ¶
type InscribeOrderResp struct { OrderId string `json:"order_id"` InscriptionId string `json:"inscription_id"` ReceiveAddress string `json:"receive_address"` CommitTxId string `json:"commit_tx_id"` RevealTxId string `json:"reveal_tx_id"` RevealTxValue int64 `json:"reveal_tx_value"` Status int `json:"status"` CreatedAt int64 `json:"created_at"` }
type InscribeOrdersResp ¶
type InscribeOrdersResp struct { Total int64 `json:"total"` List []*InscribeOrderResp `json:"list"` }
type InscriptionEntry ¶
type InscriptionEntry struct { InscriptionId string `json:"inscription_id"` InscriptionNumber int64 `json:"inscription_number"` ContentType string `json:"content_type"` MediaType string `json:"media_type"` ContentLength uint32 `json:"content_length"` Timestamp string `json:"timestamp"` OwnerOutput string `json:"owner_output"` OwnerAddress string `json:"owner_address"` Sat string `json:"sat"` CInsDescription CInsDescription `json:"c_ins_description"` ContentProtocol string `json:"content_protocol"` }
type InscriptionsReq ¶
type InscriptionsReq struct { Search string `json:"search"` Page int `json:"page" binding:"omitempty,min=1"` Limit int `json:"limit" binding:"omitempty,min=1,max=50"` Order string `json:"order" binding:"omitempty,oneof=newest oldest"` Types []string `json:"types" binding:"omitempty,dive,oneof=image text json html"` InscriptionType string `json:"inscription_type" binding:"omitempty,oneof=c-brc-20"` Charms []string `json:"charms" binding:"omitempty,dive,oneof=cursed"` }
func (*InscriptionsReq) Check ¶
func (req *InscriptionsReq) Check() error
type InscriptionsResp ¶
type InscriptionsResp struct { SearchType SearchType `json:"search_type"` Page int `json:"page"` Total int `json:"total"` List []*InscriptionEntry `json:"list"` }
type Option ¶
type Option func(*Options)
Option is a function type that sets a specific option in an Options struct.
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options is a struct that holds the configuration options for a Handler.
type OrderStatusResp ¶
type OrderStatusResp struct { Status tables.OrderStatus `json:"status"` InscriptionId tables.InscriptionId `json:"inscription_id"` }
type SearchType ¶
type SearchType string
const ( SearchTypeUnknown SearchType = "unknown" SearchTypeEmpty SearchType = "empty" SearchTypeInscriptionId SearchType = "inscription_id" SearchTypeInscriptionNumber SearchType = "inscription_number" SearchTypeAddress SearchType = "address" SearchTypeTicker SearchType = "ticker" )