types

package
v0.1.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandChain

type CommandChain struct {
	Info string
	Err  string
}

type CountRsp

type CountRsp struct {
	Count int `json:"count,omitempty"`
}

type CreateNameSpacePayload

type CreateNameSpacePayload struct {
	Admins     []string `json:"admins,omitempty"`
	Name       string   `json:"name,omitempty"`
	Owner      string   `json:"owner,omitempty"`
	Permission string   `json:"permission,omitempty"`
}

type CreateNameSpaceReq

type CreateNameSpaceReq struct {
	From            string   `json:"from,omitempty"`
	Name            string   `json:"name,omitempty"`
	Permission      string   `json:"permission,omitempty"`
	MethodName      string   `json:"methodName,omitempty"`
	AvailableHeight int      `json:"AvailableHeight,omitempty"`
	Owner           string   `json:"owner,omitempty"`
	Admins          []string `json:"admins,omitempty"`
	StorageFee      int64    `json:"storageFee,omitempty"`
}

type Data

type Data struct {
	ID            string                 `json:"ID,omitempty"`
	NID           uint8                  `json:"NID,omitempty"`
	Data          []byte                 `json:"data,omitempty"`
	Labels        map[string]interface{} `json:"labels,omitempty"`
	StorageFee    uint64                 `json:"storageFee,omitempty"`
	LightingProof []byte                 `json:"lightingProof,omitempty"`
	TxHash        string                 `gorm:"column:txhash" json:"txHash,omitempty"`

	MethodName string `json:"methodName,omitempty"`
}

type DataPayload

type DataPayload struct {
	Data        string                 `json:"data"`
	Labels      map[string]interface{} `json:"labels,omitempty"`
	NamespaceID string                 `json:"namespaceID"`
}

type DataUploadMockReq

type DataUploadMockReq struct {
	PrikeyStr string `json:"prikeyStr,omitempty"`

	DataID        string                 `json:"dataID,omitempty"`
	NID           string                 `json:"namespaceID,omitempty"`
	From          string                 `json:"from,omitempty"`
	Data          []byte                 `json:"data,omitempty"`
	Labels        map[string]interface{} `json:"labels,omitempty"`
	StorageFee    uint64                 `json:"storageFee,omitempty"`
	LightingProof []byte                 `json:"lightingProof,omitempty"`
	TxHash        string                 `gorm:"column:txhash" json:"txHash,omitempty"`

	MethodName string `json:"methodName,omitempty"`
}

type DataUploadReq

type DataUploadReq struct {
	DataID     string                 `json:"dataID,omitempty"`
	NID        string                 `json:"namespaceID,omitempty"`
	From       string                 `json:"from,omitempty"`
	RawData    string                 `json:"data,omitempty"`
	Labels     map[string]interface{} `json:"labels,omitempty"`
	StorageFee uint64                 `json:"storageFee,omitempty"`
	TxHash     string                 `gorm:"column:txhash" json:"txHash,omitempty"`

	MethodName string `json:"methodName,omitempty"`

	Timestamp uint64 `gorm:"column:timestamp" json:"timestamp,omitempty"`
}

type DataUploadRsp

type DataUploadRsp struct {
	TxID      string `json:"TxID,omitempty"`
	Timestamp int64  `json:"timestamp,omitempty"`
}

type Datas

type Datas struct {
	BlockHash     string `json:"blockHash,omitempty"`
	BlockNumber   uint64 `json:"blockNumber,omitempty"`
	DAID          string `json:"dataID,omitempty"`
	Datasize      int    `json:"datasize,omitempty"`
	NID           string `json:"namespaceID,omitempty"`
	TransactionID string `json:"transactionID,omitempty"`
	Status        string `json:"status,omitempty"`
	RawData       string `json:"data,omitempty"`
}

type EstimateFee

type EstimateFee struct {
	StorageFee int `json:"storageFee,omitempty"`
}

type EstimateFeeReq

type EstimateFeeReq struct {
	DataSize    int    `json:"dataSize,omitempty"`
	MethodName  string `json:"methodName,omitempty"`
	NamespaceID string `json:"namespaceID,omitempty"`
}

type GetBlockHeaderByNumberReq

type GetBlockHeaderByNumberReq struct {
	BlockNumber int64 `json:"blockNumber,omitempty"`
}

type GetBlockHeaderByNumberRsp

type GetBlockHeaderByNumberRsp struct {
	BlockHash      string         `json:"blockHash,omitempty"`
	ParentHash     string         `json:"parentHash,omitempty"`
	Timestamp      int64          `json:"timestamp,omitempty"`
	Size           int64          `json:"size,omitempty"`
	TransactionIDs TransactionIDs `json:"transactionIDs,omitempty"`
}

type GetDAIDRsp

type GetDAIDRsp struct {
	DAID string `json:"DAID,omitempty"`
}

type GetDataByUserReq

type GetDataByUserReq struct {
	Address string `json:"address,omitempty"`
	Limit   int    `json:"limit,omitempty"`
	Offset  int    `json:"offset,omitempty"`
}

type GetDataByUserRsp

type GetDataByUserRsp struct {
	DataIDs   []string `json:"dataIDs,omitempty"`
	LastIndex int      `json:"lastIndex,omitempty"`
}

type GetDataCallRsp

type GetDataCallRsp struct {
	CallData string `json:"calldata,omitempty"`
}

type GetDataInNamespaceReq

type GetDataInNamespaceReq struct {
	NID    string `json:"namespaceID,omitempty"`
	Limit  int    `json:"limit,omitempty"`
	Offset int    `json:"offset,omitempty"`
}

type GetDataInNamespaceRsp

type GetDataInNamespaceRsp struct {
	DataIDs    []string `json:"dataIDs,omitempty"`
	LastOffset int64    `json:"lastOffset,omitempty"`
}

type GetDataReq

type GetDataReq struct {
	DAID string `json:"dataID,omitempty"`
}

type GetDataRsp

type GetDataRsp struct {
	DataID     string                 `json:"dataID,omitempty" yaml:"dataID,omitempty"`
	NID        string                 `json:"namespaceID,omitempty" yaml:"namespaceID,omitempty"`
	From       string                 `json:"from,omitempty" yaml:"from,omitempty"`
	RawData    string                 `json:"data,omitempty" yaml:"rawData,omitempty"`
	Labels     map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"`
	StorageFee uint64                 `json:"storageFee,omitempty" yaml:"storageFee,omitempty"`
	TxHash     string                 `json:"txHash,omitempty" yaml:"txHash,omitempty"`
	MethodName string                 `json:"methodName,omitempty" yaml:"methodName,omitempty"`
	Timestamp  uint64                 `json:"timestamp,omitempty" yaml:"timestamp,omitempty"`
}

type GetDataStatusReq

type GetDataStatusReq struct {
	DAID string `json:"dataID,omitempty"`
}

type GetDataStatusRsp

type GetDataStatusRsp struct {
	Status string `json:"status,omitempty"`
}

type GetDatasReq

type GetDatasReq struct {
	NID         []string `json:"namespaceID,omitempty"`
	BlockNumber int64    `json:"blockNumber,omitempty"`
}

type GetDatasRsp

type GetDatasRsp struct {
	Datas []*Datas `json:"datas,omitempty"`
	Count int64    `json:"count,omitempty"`
}

type GetInvoiceReq

type GetInvoiceReq struct {
	PublicKeyStr   string `json:"publicKey,omitempty" yaml:"publicKeyStr,omitempty"`
	BitcoinAddress string `json:"bitcoinAddress,omitempty" yaml:"bitcoinAddress,omitempty"`
	StorageFee     int64  `json:"storageFee,omitempty" yaml:"storageFee,omitempty"`
}

type GetLastNamespaceIDReq

type GetLastNamespaceIDReq struct {
}

type GetLastNamespaceIDRsp

type GetLastNamespaceIDRsp struct {
	NID string `json:"namespaceID,omitempty"`
}

type GetLatestBlockNumberRsp

type GetLatestBlockNumberRsp struct {
	BlockNumber int64 `json:"blockNumber,omitempty"`
}

type GetNIDRsp

type GetNIDRsp struct {
	NID string `json:"NID,omitempty"`
}

type GetNamespaceByUserReq

type GetNamespaceByUserReq struct {
	Address string `json:"address,omitempty"`
}

type GetNamespaceByUserRsp

type GetNamespaceByUserRsp struct {
	NamespaceIDs []string `json:"namespaceIDs,omitempty"`
}

type GetNamespaceReq

type GetNamespaceReq struct {
	NID string `json:"namespaceID,omitempty"`
}

type GetNamespaceRsp

type GetNamespaceRsp struct {
	NID             string   `json:"namespaceID,omitempty" yaml:"namespaceID,omitempty"`
	Name            string   `json:"name,omitempty" yaml:"name,omitempty"`
	Admins          []string `json:"admins,omitempty" yaml:"admins,omitempty"`
	Owner           string   `json:"owner,omitempty" yaml:"owner,omitempty"`
	Permission      string   `json:"permission,omitempty" yaml:"permission,omitempty"`
	StorageFee      uint64   `json:"storageFee,omitempty" yaml:"storageFee,omitempty"`
	AvailableHeight int64    `json:"availableHeight,omitempty" yaml:"availableHeight,omitempty"`
	BlockNumber     int64    `json:"blockNumber,omitempty" yaml:"blockNumber,omitempty"`
	MethodName      string   `json:"methodName,omitempty" yaml:"methodName,omitempty"`
}

type GetNamespaceStatusReq

type GetNamespaceStatusReq struct {
	NID string `json:"namespaceID,omitempty"`
}

type GetNamespaceStatusRsp

type GetNamespaceStatusRsp struct {
	Status string `json:"status,omitempty"`
}

type GetNamespacesReq

type GetNamespacesReq struct {
	Limit  int `json:"limit,omitempty"`
	Offset int `json:"offset,omitempty"`
	Filter struct {
		Owner string `json:"owner,omitempty"`
		Admin string `json:"admin,omitempty"`
	} `json:"filter,omitempty"`
}

type GetNamespacesRsp

type GetNamespacesRsp struct {
	Namespaces []struct {
		Name            string   `json:"name,omitempty"`
		Permission      string   `json:"permission,omitempty"`
		AvailableHeight int      `json:"availableHeight,omitempty"`
		Owner           string   `json:"owner,omitempty"`
		Admins          []string `json:"admins,omitempty"`
		NamespaceID     string   `json:"namespaceID,omitempty"`
	} `json:"namespaces,omitempty"`
	LastOffset int `json:"lastOffset,omitempty"`
}

type GetNonceReq

type GetNonceReq struct {
	PublicKeyStr   string `json:"publicKey,omitempty"`
	BitcoinAddress string `json:"bitcoinAddress,omitempty"`
}

type GetNonceRsp

type GetNonceRsp struct {
	Nonce     int    `json:"nonce,omitempty"`
	ErrorInfo string `json:"errorInfo,omitempty"`
	IsSuccess bool   `json:"isSuccess,omitempty"`
}

type GetTotalDataIDsInNamesapceReq

type GetTotalDataIDsInNamesapceReq struct {
	NID string `json:"namespaceID"`
}

type GetTotalDataIDsInNamesapceRsp

type GetTotalDataIDsInNamesapceRsp struct {
	Count int64 `json:"count"`
}

type GetTransactionReq

type GetTransactionReq struct {
	TxID string `json:"transactionID,omitempty"`
}

type GetTransactionRsp

type GetTransactionRsp struct {
	From          string `json:"from"`
	Nonce         int64  `json:"nonce"`
	BlockHash     string `json:"blockHash"`
	BlockNumber   uint64 `json:"blockNumber"`
	StorageFee    uint64 `json:"storageFee"`
	DAID          string `json:"dataID"`
	Datasize      int    `json:"datasize"`
	NID           string `json:"namespaceID"`
	TransactionID string `json:"transactionID"`
	Timestamp     uint64 `json:"timestamp"`
	MethodName    string `json:"methodName"`
	Status        string `json:"status"`
	ContentType   string `json:"contentType"`

	RawData string `json:"data"`
}

type GetTransactionsReq

type GetTransactionsReq struct {
	Limit   int                        `json:"limit,omitempty"`
	Offset  int                        `json:"offset,omitempty"`
	Filters *GetTransactionsReqFilters `json:"filters,omitempty"`
}

type GetTransactionsReqFilters

type GetTransactionsReqFilters struct {
	BlockNumber int    `json:"blockNumber,omitempty"`
	From        string `json:"from,omitempty"`
}

type GetTransactionsRsp

type GetTransactionsRsp struct {
	Transactions []struct {
		From          string `json:"from,omitempty"`
		Nonce         int    `json:"nonce,omitempty"`
		BlockHash     string `json:"blockHash,omitempty"`
		BlockNumber   int    `json:"blockNumber,omitempty"`
		StorageFee    int    `json:"storageFee,omitempty"`
		DataID        string `json:"dataID,omitempty"`
		NamespaceID   string `json:"namespaceID,omitempty"`
		Timestamp     int    `json:"timestamp,omitempty"`
		MethodName    string `json:"methodName,omitempty"`
		ContentType   string `json:"contentType,omitempty"`
		Status        string `json:"status,omitempty"`
		TransactionID string `json:"transactionID,omitempty"`
	} `json:"transactions,omitempty"`
	LastOffset int `json:"lastOffset,omitempty"`
}

type Invoice

type Invoice struct {
	Fee     int    `json:"fee,omitempty"`
	Invoice string `json:"invoice,omitempty"`
}

type Keys

type Keys struct {
	PublicKey  string `json:"public_key,omitempty" yaml:"PublicKey,omitempty"`
	Mnemonic   string `json:"mnemonic,omitempty" yaml:"Mnemonic,omitempty"`
	PrivateKey string `json:"private_key,omitempty" yaml:"PrivateKey,omitempty"`
	FileName   string `json:"file_name,omitempty" yaml:"FileName,omitempty"`
}

type LightningInfo

type LightningInfo struct {
	MacaroonFile string `json:"macaroonFile,omitempty" yaml:"MacaroonFile,omitempty"`
	TlsFile      string `json:"tlsFile,omitempty" yaml:"TlsFile,omitempty"`
	GrpcTarget   string `json:"grpcTarget,omitempty" yaml:"GrpcTarget,omitempty"`
}

type NubitClient

type NubitClient struct {
	*NubitHttp
	Endpoint string
}

type NubitHttp

type NubitHttp struct {
	*http.Client
}

func NewHttp

func NewHttp(c *http.Client) *NubitHttp

type NubitRpc

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

type Options

type Options func(*NubitClient)

type Payee

type Payee struct {
	PublicKey string `json:"publicKey,omitempty"`
	Address   string `json:"address,omitempty"`
}

type PaymentParams

type PaymentParams struct {
	Target              string  `json:"target,omitempty" yaml:"Target,omitempty"`
	AutoPay             bool    `json:"auto_pay,omitempty" yaml:"AutoPay,omitempty"`
	Approve             int     `json:"approve,omitempty"`     //Approve
	EstimateFeeMultiple float64 `json:"estimateFee,omitempty"` // EstimateFeeMultiple Pay at this multiple
	MacaroonFile        string  `json:"macaroonFile,omitempty" yaml:"MacaroonFile,omitempty"`
	FeeLimitSat         int     `json:"feeLimitSat,omitempty"`
	TlsCertFile         string  `json:"tlsCertFile,omitempty" yaml:"TlsCertFile,omitempty"`
	Authorization       string  `json:"authorization,omitempty" yaml:"Authorization,omitempty"`
	XAPIKEY             string  `json:"x-api-key,omitempty" yaml:"x-api-key,omitempty"`
	LndProxyTarget      string  `json:"lndProxyTarget,omitempty" yaml:"lndProxyTarget,omitempty"`
}

type PaymentRequest

type PaymentRequest struct {
	Invoice string `json:"invoice,omitempty" yaml:"Invoice,omitempty"`
	Amount  string `json:"amount,omitempty" yaml:"Amount,omitempty"`
}

type PaymentStatus

type PaymentStatus struct {
	Preimage  string `json:"preimage,omitempty" yaml:"Preimage,omitempty"`
	Route     string `json:"route,omitempty" yaml:"Route,omitempty"`
	Hash      string `json:"hash,omitempty" yaml:"Hash,omitempty"`
	Amount    string `json:"amount,omitempty" yaml:"Amount,omitempty"`
	Success   bool   `json:"success,omitempty" yaml:"Success,omitempty"`
	ErrorCode int    `json:"error_code,omitempty" yaml:"ErrorCode,omitempty"`
	ErrorMsg  string `json:"error_msg,omitempty" yaml:"ErrorMsg,omitempty"`
}

type QueryTxReq

type QueryTxReq struct {
	TxID string `json:"TxID,omitempty"`
}

type SysInfo

type SysInfo struct {
	SysType string `json:"sysType,omitempty" yaml:"sysType,omitempty"`
	Arch    string `json:"arch,omitempty" yaml:"arch,omitempty"`
}

type TransactionBody

type TransactionBody struct {
	BitcoinAddress string `json:"bitcoinAddress,omitempty"`
	MethodName     string `json:"methodName,omitempty"`
	Nonce          int    `json:"nonce"`
	Payload        any    `json:"payload"`
	PublicKey      string `json:"publicKey"`
	StorageFee     int    `json:"storageFee"`
}

type TransactionIDs

type TransactionIDs struct {
	Data      []string `json:"data,omitempty"`
	Namespace []string `json:"namespace,omitempty"`
}

type TransferNamespacePayload

type TransferNamespacePayload struct {
	NamespaceID string `json:"namespaceID,omitempty"`
	Owner       string `json:"owner,omitempty"`
}

type TransferNamespaceReq

type TransferNamespaceReq struct {
	PrikeyStr string `json:"prikeyStr,omitempty"`

	NID        string `json:"namespaceID,omitempty"`
	StorageFee uint64 `json:"storageFee,omitempty"`
	Owner      string `json:"owner,omitempty"`

	MethodName string `json:"methodName,omitempty"`
}

type TxReq

type TxReq struct {
	TransactionBody *TransactionBody `json:"transactionBody,omitempty"`
	Invoice         string           `json:"invoice,omitempty"`
	PreImage        string           `json:"preImage,omitempty"`
	Signature       string           `json:"signature,omitempty"`
}

type TxRsp

type TxRsp struct {
	TxID    string `json:"transactionID,omitempty"`
	Msg     string `json:"msg,omitempty"`
	Success bool   `json:"success,omitempty"`
}

type UpdateNameSpacePayload

type UpdateNameSpacePayload struct {
	Admins      []string `json:"admins,omitempty"`
	Name        string   `json:"name,omitempty"`
	NamespaceID string   `json:"namespaceID,omitempty"`
	Permission  string   `json:"permission,omitempty"`
}

type UpdateNameSpaceReq

type UpdateNameSpaceReq struct {
	NID             int      `json:"NID,omitempty"`
	Name            string   `json:"name,omitempty"`
	Permission      string   `json:"permission,omitempty"`
	MethodName      string   `json:"methodName,omitempty"`
	AvailableHeight int      `json:"AvailableHeight,omitempty"`
	Owner           string   `json:"owner,omitempty"`
	Admins          []string `json:"admins,omitempty"`
}

type UpdateNamespaceReq

type UpdateNamespaceReq struct {
	PrikeyStr string `json:"prikeyStr,omitempty"`

	From            string   `json:"from,omitempty"`
	NID             string   `json:"namespaceID,omitempty"`
	Name            string   `json:"name,omitempty"`
	Admins          []string `json:"admins,omitempty"`
	Owner           string   `json:"owner,omitempty"`
	Permission      string   `json:"permission,omitempty"`
	StorageFee      uint64   `json:"storageFee,omitempty"`
	AvailableHeight int64    `json:"availableHeight,omitempty"`

	BlockNumber      int64 `json:"blockNumber,omitempty"`
	TransactionIndex uint  `json:"transactionIndex,omitempty"`

	MethodName string `json:"methodName,omitempty"`
}

Jump to

Keyboard shortcuts

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