gowaves

package module
v1.0.27 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: MIT Imports: 12 Imported by: 8

README

gowaves

Go library for Waves blockchain platform

Documentation

Index

Constants

View Source
const (
	DefaultURL         = "https://nodes.wavesnodes.com"
	DefaultPort        = 80
	DefaultMatcherURL  = "https://matcher.waves.exchange"
	DefaultMatcherPort = 443
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivationStatusResponse

type ActivationStatusResponse struct {
	Features []struct {
		ActivationHeight int    `json:"activationHeight"`
		BlockchainStatus string `json:"blockchainStatus"`
		ID               int    `json:"id"`
		NodeStatus       string `json:"nodeStatus"`
	} `json:"features"`
	Height          int `json:"height"`
	NextCheck       int `json:"nextCheck"`
	VotingInterval  int `json:"votingInterval"`
	VotingThreshold int `json:"votingThreshold"`
}

type AddressValidateResponse

type AddressValidateResponse struct {
	Address string `json:"address"`
	Valid   bool   `json:"valid"`
}

type AddressesBalanceResponse

type AddressesBalanceResponse struct {
	Address       string `json:"address"`
	Balance       int    `json:"balance"`
	Confirmations int    `json:"confirmations"`
}

type AddressesResponse added in v1.0.20

type AddressesResponse []string

type AssetsBalanceDistributionResponse

type AssetsBalanceDistributionResponse struct {
	HasNext  bool           `json:"hasNext"`
	LastItem string         `json:"lastItem"`
	Items    map[string]int `json:"items,omitempty"`
}

type AssetsBalanceResponse

type AssetsBalanceResponse struct {
	Address string `json:"address"`
	AssetID string `json:"assetId"`
	Balance int64  `json:"balance"`
}

type AssetsMassTransferRequest

type AssetsMassTransferRequest struct {
	AssetID    string `json:"assetId"`
	Attachment string `json:"attachment"`
	Fee        int    `json:"fee"`
	Sender     string `json:"sender"`
	Timestamp  int    `json:"timestamp"`
	Transfers  []struct {
		Amount    int    `json:"amount"`
		Recipient string `json:"recipient"`
	} `json:"transfers"`
	Version int `json:"version"`
}

type AssetsMassTransferResponse

type AssetsMassTransferResponse struct {
	AssetID         string   `json:"assetId"`
	Attachment      string   `json:"attachment"`
	Fee             int      `json:"fee"`
	ID              string   `json:"id"`
	Proofs          []string `json:"proofs"`
	Sender          string   `json:"sender"`
	SenderPublicKey string   `json:"senderPublicKey"`
	Timestamp       int      `json:"timestamp"`
	TotalAmount     int      `json:"totalAmount"`
	TransferCount   int      `json:"transferCount"`
	Transfers       []struct {
		Amount    int    `json:"amount"`
		Recipient string `json:"recipient"`
	} `json:"transfers"`
	Type    int `json:"type"`
	Version int `json:"version"`
}

type AssetsOrderRequest

type AssetsOrderRequest struct {
	SenderPublicKey  string `json:"senderPublicKey"`
	Sender           string `json:"sender"`
	MatcherPublicKey string `json:"matcherPublicKey"`
	AssetPair        struct {
		AmountAsset string `json:"amountAsset"`
		PriceAsset  string `json:"priceAsset"`
	} `json:"assetPair"`
	OrderType         string   `json:"orderType"`
	Amount            int      `json:"amount"`
	Price             int      `json:"price"`
	Timestamp         int      `json:"timestamp"`
	Expiration        int      `json:"expiration"`
	MatcherFee        int      `json:"matcherFee"`
	MatcherFeeAssetID *string  `json:"matcherFeeAssetId"`
	Proofs            []string `json:"proofs"`
	Signature         string   `json:"signature"`
	Version           int      `json:"version"`
}

type AssetsOrderResponse

type AssetsOrderResponse struct {
	Version          int    `json:"version"`
	ID               string `json:"id"`
	Sender           string `json:"sender"`
	SenderPublicKey  string `json:"senderPublicKey"`
	MatcherPublicKey string `json:"matcherPublicKey"`
	AssetPair        struct {
		AmountAsset string      `json:"amountAsset"`
		PriceAsset  interface{} `json:"priceAsset"`
	} `json:"assetPair"`
	OrderType         string      `json:"orderType"`
	Amount            int         `json:"amount"`
	Price             int         `json:"price"`
	Timestamp         int64       `json:"timestamp"`
	Expiration        int64       `json:"expiration"`
	MatcherFee        int         `json:"matcherFee"`
	Signature         string      `json:"signature"`
	Proofs            []string    `json:"proofs"`
	MatcherFeeAssetID interface{} `json:"matcherFeeAssetId"`
}

type AssetsTransferRequest

type AssetsTransferRequest struct {
	Amount     int    `json:"amount"`
	AssetID    string `json:"assetId,omitempty"`
	Attachment string `json:"attachment,omitempty"`
	Fee        int    `json:"fee"`
	FeeAssetID string `json:"feeAssetId,omitempty"`
	Recipient  string `json:"recipient"`
	Sender     string `json:"sender"`
	Timestamp  int    `json:"timestamp,omitempty"`
}

type AssetsTransferResponse

type AssetsTransferResponse struct {
	Amount          int         `json:"amount"`
	AssetID         string      `json:"assetId"`
	Attachment      string      `json:"attachment"`
	Fee             int         `json:"fee"`
	FeeAsset        interface{} `json:"feeAsset"`
	ID              string      `json:"id"`
	Recipient       string      `json:"recipient"`
	Sender          string      `json:"sender"`
	SenderPublicKey string      `json:"senderPublicKey"`
	Signature       string      `json:"signature"`
	Timestamp       int         `json:"timestamp"`
	Type            int         `json:"type"`
}

type BlocksAtResponse

type BlocksAtResponse struct {
	Version      int    `json:"version"`
	Timestamp    int64  `json:"timestamp"`
	Reference    string `json:"reference"`
	NxtConsensus struct {
		BaseTarget          int    `json:"base-target"`
		GenerationSignature string `json:"generation-signature"`
	} `json:"nxt-consensus"`
	Generator        string `json:"generator"`
	Signature        string `json:"signature"`
	Blocksize        int    `json:"blocksize"`
	TransactionCount int    `json:"transactionCount"`
	Fee              int    `json:"fee"`
	Transactions     []struct {
		Type            int    `json:"type"`
		ID              string `json:"id"`
		Sender          string `json:"sender"`
		SenderPublicKey string `json:"senderPublicKey"`
		Fee             int    `json:"fee"`
		Timestamp       int64  `json:"timestamp"`
		Signature       string `json:"signature"`
		Recipient       string `json:"recipient"`
		Amount          int64  `json:"amount"`
	} `json:"transactions"`
	Height int `json:"height"`
}

type BlocksHeightResponse

type BlocksHeightResponse struct {
	Height int `json:"height"`
}

type DataKeyResponse added in v1.0.25

type DataKeyResponse struct {
	Key   string      `json:"key"`
	Type  string      `json:"type"`
	Value interface{} `json:"value"`
}

type DataResponse added in v1.0.8

type DataResponse []struct {
	Key   string      `json:"key"`
	Type  string      `json:"type"`
	Value interface{} `json:"value"`
}

type NodeStatusResponse

type NodeStatusResponse struct {
	BlockchainHeight int       `json:"blockchainHeight"`
	StateHeight      int       `json:"stateHeight"`
	UpdatedTimestamp int64     `json:"updatedTimestamp"`
	UpdatedDate      time.Time `json:"updatedDate"`
}

type NodeStopResponse

type NodeStopResponse struct {
	Stopped bool `json:"stopped"`
}

type NodeVersionResponse

type NodeVersionResponse struct {
	Version string `json:"version"`
}

type OrderbookCancelRequest

type OrderbookCancelRequest struct {
	Sender    string `json:"sender"`
	OrderID   string `json:"orderId"`
	Timestamp int    `json:"timestamp"`
	Signature string `json:"signature"`
}

type OrderbookCancelResponse

type OrderbookCancelResponse struct {
	Success bool   `json:"success"`
	Status  string `json:"status"`
}

type OrderbookPairResponse

type OrderbookPairResponse struct {
	Timestamp int64 `json:"timestamp"`
	Pair      struct {
		AmountAsset string `json:"amountAsset"`
		PriceAsset  string `json:"priceAsset"`
	} `json:"pair"`
	Bids []struct {
		Amount uint64 `json:"amount"`
		Price  uint64 `json:"price"`
	} `json:"bids"`
	Asks []struct {
		Amount uint64 `json:"amount"`
		Price  uint64 `json:"price"`
	} `json:"asks"`
}

type OrderbookResponse

type OrderbookResponse struct {
	Success bool `json:"success"`
	Message struct {
		Version          int    `json:"version"`
		ID               string `json:"id"`
		Sender           string `json:"sender"`
		SenderPublicKey  string `json:"senderPublicKey"`
		MatcherPublicKey string `json:"matcherPublicKey"`
		AssetPair        struct {
			AmountAsset string `json:"amountAsset"`
			PriceAsset  string `json:"priceAsset"`
		} `json:"assetPair"`
		OrderType         string      `json:"orderType"`
		Amount            int         `json:"amount"`
		Price             int         `json:"price"`
		Timestamp         int64       `json:"timestamp"`
		Expiration        int64       `json:"expiration"`
		MatcherFee        int         `json:"matcherFee"`
		MatcherFeeAssetID interface{} `json:"matcherFeeAssetId"`
		Signature         string      `json:"signature"`
		Proofs            []string    `json:"proofs"`
	} `json:"message"`
	Status string `json:"status"`
}

type OrderbookStatusResponse

type OrderbookStatusResponse struct {
	Success    bool   `json:"success"`
	Ask        int    `json:"ask"`
	BidAmount  int64  `json:"bidAmount"`
	Bid        int    `json:"bid"`
	LastAmount int64  `json:"lastAmount"`
	AskAmount  int64  `json:"askAmount"`
	LastSide   string `json:"lastSide"`
	Status     string `json:"status"`
	LastPrice  int    `json:"lastPrice"`
}

type TransactionsAddressLimitResponse

type TransactionsAddressLimitResponse struct {
	Type            int      `json:"type"`
	ID              string   `json:"id"`
	Sender          string   `json:"sender"`
	SenderPublicKey string   `json:"senderPublicKey"`
	Fee             int      `json:"fee"`
	Timestamp       int64    `json:"timestamp"`
	Proofs          []string `json:"proofs,omitempty"`
	Version         int      `json:"version"`
	AssetID         string   `json:"assetId"`
	Attachment      string   `json:"attachment"`
	TransferCount   int      `json:"transferCount,omitempty"`
	Total           int      `json:"total,omitempty"`
	Transfers       []struct {
		Recipient string `json:"recipient"`
		Amount    int    `json:"amount"`
	} `json:"transfers,omitempty"`
	Height     int         `json:"height"`
	Signature  string      `json:"signature,omitempty"`
	Recipient  string      `json:"recipient,omitempty"`
	FeeAssetID interface{} `json:"feeAssetId,omitempty"`
	FeeAsset   interface{} `json:"feeAsset,omitempty"`
	Amount     int         `json:"amount,omitempty"`
	Order1     struct {
		Version          int    `json:"version"`
		ID               string `json:"id"`
		Sender           string `json:"sender"`
		SenderPublicKey  string `json:"senderPublicKey"`
		MatcherPublicKey string `json:"matcherPublicKey"`
		AssetPair        struct {
			AmountAsset string      `json:"amountAsset"`
			PriceAsset  interface{} `json:"priceAsset"`
		} `json:"assetPair"`
		OrderType         string      `json:"orderType"`
		Amount            int         `json:"amount"`
		Price             int         `json:"price"`
		Timestamp         int64       `json:"timestamp"`
		Expiration        int64       `json:"expiration"`
		MatcherFee        int         `json:"matcherFee"`
		Signature         string      `json:"signature"`
		Proofs            []string    `json:"proofs"`
		MatcherFeeAssetID interface{} `json:"matcherFeeAssetId"`
	} `json:"order1"`
	Order2 struct {
		Version          int    `json:"version"`
		ID               string `json:"id"`
		Sender           string `json:"sender"`
		SenderPublicKey  string `json:"senderPublicKey"`
		MatcherPublicKey string `json:"matcherPublicKey"`
		AssetPair        struct {
			AmountAsset string      `json:"amountAsset"`
			PriceAsset  interface{} `json:"priceAsset"`
		} `json:"assetPair"`
		OrderType         string      `json:"orderType"`
		Amount            int64       `json:"amount"`
		Price             int         `json:"price"`
		Timestamp         int64       `json:"timestamp"`
		Expiration        int64       `json:"expiration"`
		MatcherFee        int         `json:"matcherFee"`
		Signature         string      `json:"signature"`
		Proofs            []string    `json:"proofs"`
		MatcherFeeAssetID interface{} `json:"matcherFeeAssetId"`
	} `json:"order2"`
	Price             int    `json:"price"`
	BuyMatcherFee     int    `json:"buyMatcherFee"`
	SellMatcherFee    int    `json:"sellMatcherFee"`
	ApplicationStatus string `json:"applicationStatus"`
}

type UtilsHashSecureResponse added in v1.0.21

type UtilsHashSecureResponse struct {
	Message string `json:"message"`
	Hash    string `json:"hash"`
}

type WavesMatcherClient

type WavesMatcherClient struct {
	Host   string
	Port   uint
	ApiKey string
}

func (*WavesMatcherClient) DoRequest

func (w *WavesMatcherClient) DoRequest(uri string, method string, body interface{}, resp interface{}) error

func (*WavesMatcherClient) Orderbook

func (*WavesMatcherClient) OrderbookAlt added in v1.0.4

func (w *WavesMatcherClient) OrderbookAlt(aor *proto.OrderV1) (*OrderbookResponse, error)

func (*WavesMatcherClient) OrderbookCancel

func (w *WavesMatcherClient) OrderbookCancel(amountAssetID string, priceAssetID string, ocr *OrderbookCancelRequest) (*OrderbookCancelResponse, error)

func (*WavesMatcherClient) OrderbookMarket

func (w *WavesMatcherClient) OrderbookMarket(aor *AssetsOrderResponse) (*OrderbookResponse, error)

func (*WavesMatcherClient) OrderbookMarketAlt added in v1.0.5

func (w *WavesMatcherClient) OrderbookMarketAlt(aor *proto.OrderV1) (*OrderbookResponse, error)

func (*WavesMatcherClient) OrderbookPair

func (w *WavesMatcherClient) OrderbookPair(amountAssetID string, priceAssetID string, depth int) (*OrderbookPairResponse, error)

func (*WavesMatcherClient) OrderbookStatus

func (w *WavesMatcherClient) OrderbookStatus(amountAssetID string, priceAssetID string) (*OrderbookStatusResponse, error)

type WavesNodeClient

type WavesNodeClient struct {
	Host   string
	Port   uint
	ApiKey string
	Debug  bool
}
var WNC *WavesNodeClient

func (*WavesNodeClient) ActivationStatus

func (w *WavesNodeClient) ActivationStatus() (*ActivationStatusResponse, error)

func (*WavesNodeClient) AddressValidate

func (w *WavesNodeClient) AddressValidate(address string) (*AddressValidateResponse, error)

func (*WavesNodeClient) Addresses added in v1.0.20

func (w *WavesNodeClient) Addresses() (*AddressesResponse, error)

func (*WavesNodeClient) AddressesBalance

func (w *WavesNodeClient) AddressesBalance(address string) (*AddressesBalanceResponse, error)

func (*WavesNodeClient) AddressesBalanceConfirmations added in v1.0.26

func (w *WavesNodeClient) AddressesBalanceConfirmations(address string, confirmations int) (*AddressesBalanceResponse, error)

func (*WavesNodeClient) AddressesData added in v1.0.8

func (w *WavesNodeClient) AddressesData(address string, key string) (*DataResponse, error)

func (*WavesNodeClient) AddressesDataKey added in v1.0.25

func (w *WavesNodeClient) AddressesDataKey(address string, key string) (*DataKeyResponse, error)

func (*WavesNodeClient) AssetsBalance

func (w *WavesNodeClient) AssetsBalance(address string, assetId string) (*AssetsBalanceResponse, error)

func (*WavesNodeClient) AssetsBalanceDistribution

func (w *WavesNodeClient) AssetsBalanceDistribution(assetId string, height int, limit int, after string) (*AssetsBalanceDistributionResponse, error)

func (*WavesNodeClient) AssetsMassTransfer

func (*WavesNodeClient) AssetsOrder

func (*WavesNodeClient) AssetsTransfer

func (*WavesNodeClient) BlocksAt

func (w *WavesNodeClient) BlocksAt(n uint) (*BlocksAtResponse, error)

func (*WavesNodeClient) BlocksHeight

func (w *WavesNodeClient) BlocksHeight() (*BlocksHeightResponse, error)

func (*WavesNodeClient) DoRequest

func (w *WavesNodeClient) DoRequest(uri string, method string, body interface{}, resp interface{}, auth bool) error

func (*WavesNodeClient) NodeStatus

func (w *WavesNodeClient) NodeStatus() (*NodeStatusResponse, error)

func (*WavesNodeClient) NodeStop

func (w *WavesNodeClient) NodeStop() (*NodeStopResponse, error)

func (*WavesNodeClient) NodeVersion

func (w *WavesNodeClient) NodeVersion() (*NodeVersionResponse, error)

func (*WavesNodeClient) TransactionsAddressLimit

func (w *WavesNodeClient) TransactionsAddressLimit(address string, limit uint) ([][]TransactionsAddressLimitResponse, error)

func (*WavesNodeClient) UtilsHashSecure added in v1.0.21

func (w *WavesNodeClient) UtilsHashSecure(message string) (*UtilsHashSecureResponse, error)

Jump to

Keyboard shortcuts

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