mintersdk

package module
v0.0.0-...-5129838 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2019 License: MIT Imports: 25 Imported by: 6

README

Minter Golang SDK

About

Minter Blockchain Golang SDK https://minter.network

Actual for Minter version 1.0.x.

Installing

go get github.com/ValidatorCenter/minter-go-sdk

Updating

go get -u github.com/ValidatorCenter/minter-go-sdk

Using Minter

Create MinterSDK instance.

import m "github.com/ValidatorCenter/minter-go-sdk"

sdk := m.SDK{
		MnAddress: "http://156.123.34.5:8841", // example of a node url
		ChainMainnet: false, // Main=>true, Test=>false
}

Structures for receiving data from the blockchain already have tags: json, bson and gorm. This means that you can immediately write them correctly to a database that uses one of these tags.

GetAddress

Returns the balance of given account and the number of outgoing transaction.

GetAddress("Mx...MinterAddress" string): map[string]float32, int, error

Example
blnc, amnTx, err := sdk.GetAddress("Mxdc7fcc63930bf81ebdce12b3bcef57b93e99a157")

// result blnc: {MTN: 1000000, TESTCOIN: 2000000}
// result amnTx: 134
GetStatus

Returns node status info.

GetStatus(): struct, error

GetMinGas

Returns current min gas price.

GetMinGas(): int64, error

GetValidators

Returns list of active validators.

GetValidators(): struct, error

GetValidatorsBlock

Returns a list of validators of a block by its number.

GetValidatorsBlock("blockNumber" int): struct, error

EstimateCoinBuy

Return estimate of buy coin transaction.

EstimateCoinBuy("coinToBuy" string, "coinToSell" coinToBuy, "valueToBuy" int64): struct, error

EstimateCoinSell

Return estimate of sell coin transaction.

EstimateCoinSell("coinToSell" string, "coinToBuy" string, "valueToSell" int64): struct, error

EstimateTxCommission

Return estimate of commission in GasCoin.

EstimateTxCommission("Mt...hash" string): float32, error

GetCoinInfo

Returns information about coin.

GetCoinInfo("COIN_SYMBOL" string): struct, error

GetBlock

Returns block data at given height.

GetBlock("height" int): struct, error

GetEvents

Returns events at given height.

GetEvents("height" int): struct, error

GetTransaction

Returns transaction info.

GetTransaction("Mt...hash" string): struct, error

GetCandidate

Returns candidate’s info by provided public_key. It will respond with 404 code if candidate is not found.

GetCandidate("Mp..." string): struct, error

GetCandidates

Returns list of candidates.

GetCandidates(): struct, error

NewMnemonic

Returns new seed-phrase.

NewMnemonic(): string, error

AuthMnemonic

CLOSED: Authorization by seed-phrase.

AuthMnemonic("seed-phrase" string): "address" string, "private-key" string, error

GetAddressPrivateKey

Returns address of the wallet by provided private key.

GetAddressPrivateKey("private-key" string): "Mx..." string, error

GetVAddressPubKey

Returns validator-address by provided public key.

GetVAddressPubKey("Mp..." string): string

Sign transaction

Returns a signed tx

Example
  • Sign the SendCoin transaction.
package main

import (
	"fmt"

	m "github.com/ValidatorCenter/minter-go-sdk"
)

func main() {
	sdk := m.SDK{
		MnAddress:     "https://minter-node-1.testnet.minter.network",
		AccPrivateKey: "your private key",
		ChainMainnet: false, // Main=>true, Test=>false
	}

	sndDt := m.TxSendCoinData{
		Coin:      "MNT",
		ToAddress: "Mxe64baa7d71c72e6914566b79ac361d139be22dc7",
		Value:     10,
		GasCoin:   "MNT",
		GasPrice:  1,
	}

	resHash, err := sdk.TxSendCoin(&sndDt)
	if err != nil {
		panic(err)
	}
	fmt.Println(resHash)

}
Example
  • Sign the MultiSendCoin transaction (max=100tx).
package main

import (
	"fmt"

	m "github.com/ValidatorCenter/minter-go-sdk"
)

func main() {
	sdk := m.SDK{
		MnAddress:     "https://minter-node-1.testnet.minter.network",
		AccPrivateKey: "...",
		ChainMainnet: false, // Main=>true, Test=>false
	}

	cntList := []m.TxOneSendCoinData{}

	// First address
	cntList = append(cntList, TxOneSendCoinData{
		Coin:      "MNT",
		ToAddress: "Mxe64baa7d71c72e6914566b79ac361d139be22dc7", //Кому переводим
		Value:     10,
	})

	// Second address
	cntList = append(cntList, TxOneSendCoinData{
		Coin:      "VALIDATOR",
		ToAddress: "Mxe64baa7d71c72e6914566b79ac361d139be22dc7", //Кому переводим
		Value:     16,
	})

	mSndDt := m.TxMultiSendCoinData{
		List:     cntList,
		GasCoin:  "MNT",
		GasPrice: 1,
	}

	resHash, err := sdk.TxMultiSendCoin(&mSndDt)
	if err != nil {
		panic(err)
	}
	fmt.Println(resHash)

}
Example
  • Sign the SellCoin transaction.
package main

import (
	"fmt"

	m "github.com/ValidatorCenter/minter-go-sdk"
)

func main() {
	sdk := m.SDK{
		MnAddress:     "https://minter-node-1.testnet.minter.network",
		AccPrivateKey: "your private key",
		ChainMainnet: false, // Main=>true, Test=>false
	}

	slDt := m.TxSellCoinData{
		CoinToSell:  "MNT",
		CoinToBuy:   "ABCDEF24",
		ValueToSell: 10,
		GasCoin:     "MNT",
		GasPrice:    1,
	}

	resHash, err := sdk.TxSellCoin(&slDt)
	if err != nil {
		panic(err)
	}
	fmt.Println(resHash)

}
Example
  • Sign the SellAllCoin transaction.
package main

import (
	"fmt"

	m "github.com/ValidatorCenter/minter-go-sdk"
)

func main() {
	sdk := m.SDK{
		MnAddress:     "https://minter-node-1.testnet.minter.network",
		AccPrivateKey: "your private key",
		ChainMainnet: false, // Main=>true, Test=>false
	}

	slAllDt := m.TxSellAllCoinData{
		CoinToSell: "MNT",
		CoinToBuy:  "ABCDEF24",
		GasCoin:    "MNT",
		GasPrice:   1,
	}

	resHash, err := sdk.TxSellAllCoin(&slAllDt)
	if err != nil {
		panic(err)
	}
	fmt.Println(resHash)

}
Example
  • Sign the BuyCoin transaction.
package main

import (
	"fmt"

	m "github.com/ValidatorCenter/minter-go-sdk"
)

func main() {
	sdk := m.SDK{
		MnAddress:     "https://minter-node-1.testnet.minter.network",
		AccPrivateKey: "your private key",
		ChainMainnet: false, // Main=>true, Test=>false
	}

	buyDt := m.TxBuyCoinData{
		CoinToSell: "ABCDEF23",
		CoinToBuy:  "MNT",
		ValueToBuy: 1,
		// Gas
		GasCoin:  "MNT",
		GasPrice: 1,
	}

	resHash, err := sdk.TxBuyCoin(&buyDt)
	if err != nil {
		panic(err)
	}
	fmt.Println(resHash)

}

Example
  • Sign the CreateCoin transaction.
package main

import (
	"fmt"

	m "github.com/ValidatorCenter/minter-go-sdk"
)

func main() {
	sdk := m.SDK{
		MnAddress:     "https://minter-node-1.testnet.minter.network",
		AccPrivateKey: "your private key",
		ChainMainnet: false, // Main=>true, Test=>false
	}

	creatDt := m.TxCreateCoinData{
		Name:                 "Test coin 24",
		Symbol:               "ABCDEF24",
		InitialAmount:        100,
		InitialReserve:       100,
		ConstantReserveRatio: 50,
		// Gas
		GasCoin:  "MNT",
		GasPrice: 1,
	}

	resHash, err := sdk.TxCreateCoin(&creatDt)
	if err != nil {
		panic(err)
	}
	fmt.Println(resHash)

}
Example
  • Sign the DeclareCandidacy transaction.
package main

import (
	"fmt"

	m "github.com/ValidatorCenter/minter-go-sdk"
)

func main() {
	sdk := m.SDK{
		MnAddress:     "https://minter-node-1.testnet.minter.network",
		AccPrivateKey: "your private key",
		ChainMainnet: false, // Main=>true, Test=>false
	}

	declDt := m.TxDeclareCandidacyData{
		PubKey:     "Mp2891198c692c351bc55ac60a03c82649fa920f7ad20bd290a0c4e774e916e9de", // "Mp....",
		Commission: 10,                                                                   // 10%
		Coin:       "MNT",
		Stake:      100,
		// Gas
		GasCoin:  "MNT",
		GasPrice: 1,
	}

	resHash, err := sdk.TxDeclareCandidacy(&declDt)
	if err != nil {
		panic(err)
	}
	fmt.Println(resHash)
}
Example
  • Sign the Delegate transaction.
package main

import (
	"fmt"

	m "github.com/ValidatorCenter/minter-go-sdk"
)

func main() {
	sdk := m.SDK{
		MnAddress:     "https://minter-node-1.testnet.minter.network",
		AccPrivateKey: "your private key",
		ChainMainnet: false, // Main=>true, Test=>false
	}

	delegDt := m.TxDelegateData{
		Coin:     "MNT",
		PubKey:   "Mp5c87d35a7adb055f54140ba03c0eed418ddc7c52ff7a63fc37a0e85611388610",
		Stake:    100,
		GasCoin:  "MNT",
		GasPrice: 1,
	}

	resHash, err := sdk.TxDelegate(&delegDt)
	if err != nil {
		panic(err)
	}
	fmt.Println(resHash)

}
Example
  • Sign the SetCandidate transaction.
package main

import (
	"fmt"

	m "github.com/ValidatorCenter/minter-go-sdk"
)

func main() {
	sdk := m.SDK{
		MnAddress:     "https://minter-node-1.testnet.minter.network",
		AccPrivateKey: "your private key",
		ChainMainnet: false, // Main=>true, Test=>false
	}

	sndDt := m.TxSetCandidateData{
		PubKey:   "Mp2891198c692c351bc55ac60a03c82649fa920f7ad20bd290a0c4e774e916e9de",
		Activate: true, //true-"on", false-"off"
		GasCoin:  "MNT",
		GasPrice: 1,
	}

	resHash, err := sdk.TxSetCandidate(&sndDt)
	if err != nil {
		panic(err)
	}
	fmt.Println(resHash)

}
Example
  • Sign the Unbound transaction.
package main

import (
	"fmt"

	m "github.com/ValidatorCenter/minter-go-sdk"
)

func main() {
	sdk := m.SDK{
		MnAddress:     "https://minter-node-1.testnet.minter.network",
		AccPrivateKey: "your private key",
		ChainMainnet: false, // Main=>true, Test=>false
	}

	unbDt := m.TxUnbondData{
		PubKey:   "Mp5c87d35a7adb055f54140ba03c0eed418ddc7c52ff7a63fc37a0e85611388610",
		Coin:     "MNT",
		Value:    10,
		GasCoin:  "MNT",
		GasPrice: 1,
	}

	resHash, err := sdk.TxUnbond(&unbDt)
	if err != nil {
		panic(err)
	}
	fmt.Println(resHash)

}
Example
  • Transaction for editing existing candidate
package main

import (
	"fmt"

	m "github.com/ValidatorCenter/minter-go-sdk"
)

func main() {
	sdk := m.SDK{
		MnAddress:     "https://minter-node-1.testnet.minter.network",
		AccPrivateKey: "your private key",
		ChainMainnet: false, // Main=>true, Test=>false
	}

	edtCDt := m.TxEditCandidateData{
		PubKey:   "Mp09f3548f7f4fc38ad2d0d8f805ec2cc1e35696012f95b8c6f2749e304a91efa2",
		RewardAddress: "Mx7a86fb0d770062decdca3dc5fed15800d5a65000",
		OwnerAddress: "Mx58a1441883708813ba546345a0ed0ce765f1dad1",
		GasCoin:  "MNT",
		GasPrice: 1,
	}

	resHash, err := sdk.TxEditCandidate(&edtCDt)
	if err != nil {
		panic(err)
	}
	fmt.Println(resHash)

}
Create Minter Check
  • Create check
package main

import (
	"fmt"

	m "github.com/ValidatorCenter/minter-go-sdk"
)

func main() {
	sdk := m.SDK{
		MnAddress:     "https://minter-node-1.testnet.minter.network",
		AccPrivateKey: "...",
		ChainMainnet: false, // Main=>true, Test=>false
	}

	chDt := m.TxCreateCkeckData{
		Coin:     "MNT",
		Stake:    10,
		Password: "pswrd123",
		Nonce:    102,
	}

	resCheck, err := sdk.TxCreateCheck(&chDt)
	if err != nil {
		panic(err)
	}
	fmt.Println(resCheck)	
	// Mc.......
}
  • Redeem check
package main

import (
	"fmt"

	m "github.com/ValidatorCenter/minter-go-sdk"
)

func main() {
	sdk := m.SDK{
		MnAddress:     "https://minter-node-1.testnet.minter.network",
		AccPrivateKey: "...",
		ChainMainnet: false, // Main=>true, Test=>false
	}
	
	rchDt := m.TxRedeemCheckData{
		Check:    "Mc....",
		Password: "pswrd123",
		GasCoin:  "MNT",
		GasPrice: 1,
	}

	resHash, err := sdk.TxRedeemCheck(&rchDt)
	if err != nil {
		panic(err)
	}
	fmt.Println("HashTx:", resHash)
}

Documentation

Index

Constants

View Source
const (
	TX_SendData             int = iota + 1 //1
	TX_SellCoinData                        //2
	TX_SellAllCoinData                     //3
	TX_BuyCoinData                         //4
	TX_CreateCoinData                      //5
	TX_DeclareCandidacyData                //6
	TX_DelegateDate                        //7
	TX_UnbondData                          //8
	TX_RedeemCheckData                     //9
	TX_SetCandidateOnData                  //10
	TX_SetCandidateOffData                 //11
	TX_CreateMultisigData                  //12
	TX_MultisendData                       //13
	TX_EditCandidateData                   //14
)
View Source
const (
	CoinSymbolLength = 10
)

Variables

This section is empty.

Functions

func AuthMnemonic

func AuthMnemonic(seedPhr string) (string, string, error)

Авторизация по Seed-фразе

func GetAddressPrivateKey

func GetAddressPrivateKey(privateKey string) (string, error)

Получение адреса по приватному ключу

func GetBaseCoin

func GetBaseCoin() string

Возвращает базовую монету

func GetVAddressPubKey

func GetVAddressPubKey(pubkey string) string

Получение адреса валидатора по открытому ключу

func NewMnemonic

func NewMnemonic() string

Генерация новой Seed-фразы

Types

type AddrssResponse

type AddrssResponse struct {
	Balance            map[string]string `json:"balance" bson:"balance" gorm:"balance" db:"balance"`
	TransactionCountTx string            `json:"transaction_count" bson:"-" gorm:"-" db:"-"`
}

func (AddrssResponse) MarshalEasyJSON

func (v AddrssResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (AddrssResponse) MarshalJSON

func (v AddrssResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*AddrssResponse) UnmarshalEasyJSON

func (v *AddrssResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*AddrssResponse) UnmarshalJSON

func (v *AddrssResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type BlockEvResponse

type BlockEvResponse struct {
	Events []BlockEventsResponse `json:"events" bson:"events" gorm:"events" db:"events"`
}

func (BlockEvResponse) MarshalEasyJSON

func (v BlockEvResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (BlockEvResponse) MarshalJSON

func (v BlockEvResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*BlockEvResponse) UnmarshalEasyJSON

func (v *BlockEvResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*BlockEvResponse) UnmarshalJSON

func (v *BlockEvResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type BlockEventsResponse

type BlockEventsResponse struct {
	Type  string         `json:"type" bson:"type" gorm:"type" db:"type"`
	Value EventValueData `json:"value" bson:"value" gorm:"value" db:"value"`
}

func (BlockEventsResponse) MarshalEasyJSON

func (v BlockEventsResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (BlockEventsResponse) MarshalJSON

func (v BlockEventsResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*BlockEventsResponse) UnmarshalEasyJSON

func (v *BlockEventsResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*BlockEventsResponse) UnmarshalJSON

func (v *BlockEventsResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type BlockResponse

type BlockResponse struct {
	Hash          string                    `json:"hash" bson:"hash" gorm:"hash" db:"hash"`
	HeightTx      string                    `json:"height" bson:"-" gorm:"-" db:"-"`
	Height        int                       `json:"height_i32" bson:"height_i32" gorm:"height_i32" db:"height_i32"`
	Time          time.Time                 `json:"time" bson:"time" gorm:"time" db:"time"`
	NumTxsTx      string                    `json:"num_txs" bson:"-" gorm:"-" db:"-"`
	NumTxs        int                       `json:"num_txs_i32" bson:"num_txs_i32" gorm:"num_txs_i32" db:"num_txs_i32"`
	TotalTxsTx    string                    `json:"total_txs" bson:"-" gorm:"-" db:"-"`
	TotalTxs      int                       `json:"total_txs_i32" bson:"total_txs_i32" gorm:"total_txs_i32" db:"total_txs_i32"`
	Transactions  []TransResponse           `json:"transactions" bson:"transactions" gorm:"transactions" db:"transactions"`
	BlockRewardTx string                    `json:"block_reward" bson:"-" gorm:"-" db:"-"`
	BlockReward   float32                   `json:"block_reward_f32" bson:"block_reward_f32" gorm:"block_reward_f32" db:"block_reward_f32"`
	SizeTx        string                    `json:"size" bson:"-" gorm:"-" db:"-"`
	Size          int                       `json:"size_i32" bson:"size_i32" gorm:"size_i32" db:"size_i32"`
	Validators    []BlockValidatorsResponse `json:"validators" bson:"validators" gorm:"validators" db:"validators"`
	Proposer      string                    `json:"proposer" bson:"proposer" gorm:"proposer" db:"proposer"` // PubKey пропозер блока
}

func (BlockResponse) MarshalEasyJSON

func (v BlockResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (BlockResponse) MarshalJSON

func (v BlockResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*BlockResponse) UnmarshalEasyJSON

func (v *BlockResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*BlockResponse) UnmarshalJSON

func (v *BlockResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type BlockValidatorsResponse

type BlockValidatorsResponse struct {
	PubKey string `json:"pub_key" bson:"pub_key" gorm:"pub_key" db:"pub_key"`
	Signed bool   `json:"signed,bool" bson:"signed" gorm:"signed" db:"signed"` // подписал-true, или пропустил false
}

func (BlockValidatorsResponse) MarshalEasyJSON

func (v BlockValidatorsResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (BlockValidatorsResponse) MarshalJSON

func (v BlockValidatorsResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*BlockValidatorsResponse) UnmarshalEasyJSON

func (v *BlockValidatorsResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*BlockValidatorsResponse) UnmarshalJSON

func (v *BlockValidatorsResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type CandidateInfo

type CandidateInfo struct {
	RewardAddress    string        `json:"reward_address" bson:"reward_address" gorm:"reward_address" db:"reward_address"` // Адрес кошелька "Mx..." вознаграждения
	OwnerAddress     string        `json:"owner_address" bson:"owner_address" gorm:"owner_address" db:"owner_address"`     // Адрес кошелька "Mx..." основной
	TotalStakeTx     string        `json:"total_stake" bson:"-" gorm:"-" db:"-"`
	TotalStake       float32       `json:"total_stake_f32" bson:"total_stake_f32" gorm:"total_stake_f32" db:"total_stake_f32"`
	PubKey           string        `json:"pub_key" bson:"pub_key" gorm:"pub_key" db:"pub_key"`
	CommissionTx     string        `json:"commission" bson:"-" gorm:"-" db:"-"`
	CreatedAtBlockTx string        `json:"created_at_block" bson:"-" gorm:"-" db:"-"`
	Commission       int           `json:"commission_i32" bson:"commission_i32" gorm:"commission_i32" db:"commission_i32"`
	CreatedAtBlock   int           `json:"created_at_block_i32" bson:"created_at_block_i32" gorm:"created_at_block_i32" db:"created_at_block_i32"`
	StatusInt        int           `json:"status" bson:"status" gorm:"status" db:"status"` // числовое значение статуса: 1 - Offline, 2 - Online
	Stakes           []stakes_info `json:"stakes" bson:"stakes" gorm:"stakes" db:"stakes"` // Только у: Candidate(по PubKey)
}

структура кандидата/валидатора (экспортная)

func (CandidateInfo) MarshalEasyJSON

func (v CandidateInfo) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CandidateInfo) MarshalJSON

func (v CandidateInfo) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CandidateInfo) UnmarshalEasyJSON

func (v *CandidateInfo) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CandidateInfo) UnmarshalJSON

func (v *CandidateInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type CoinInfoResponse

type CoinInfoResponse struct {
	Name             string  `json:"name" bson:"name" gorm:"name" db:"name"`
	Symbol           string  `json:"symbol" bson:"symbol" gorm:"symbol" db:"symbol"`
	VolumeTx         string  `json:"volume" bson:"-" gorm:"-" db:"-"`
	Volume           float32 `json:"volume_f32" bson:"volume_f32" gorm:"volume_f32" db:"volume_f32"`
	CRRTx            string  `json:"crr" bson:"-" gorm:"-" db:"-"`
	CRR              int     `json:"crr_i32" bson:"crr_i32" gorm:"crr_i32" db:"crr_i32"`
	ReserveBalanceTx string  `json:"reserve_balance" bson:"-" gorm:"-" db:"-"`
	ReserveBalance   float32 `json:"reserve_balance_f32" bson:"reserve_balance_f32" gorm:"reserve_balance_f32" db:"reserve_balance_f32"`
}

func (CoinInfoResponse) MarshalEasyJSON

func (v CoinInfoResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CoinInfoResponse) MarshalJSON

func (v CoinInfoResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CoinInfoResponse) UnmarshalEasyJSON

func (v *CoinInfoResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CoinInfoResponse) UnmarshalJSON

func (v *CoinInfoResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type CoinSymbol

type CoinSymbol [CoinSymbolLength]byte

type ErrorStruct

type ErrorStruct struct {
	Code     int           `json:"code"`
	Message  string        `json:"message"`
	Data     string        `json:"data"`
	TxResult ErrorTxResult `json:"tx_result"`
}

func (ErrorStruct) MarshalEasyJSON

func (v ErrorStruct) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ErrorStruct) MarshalJSON

func (v ErrorStruct) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ErrorStruct) UnmarshalEasyJSON

func (v *ErrorStruct) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ErrorStruct) UnmarshalJSON

func (v *ErrorStruct) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ErrorTxResult

type ErrorTxResult struct {
	Code int    `json:"code"`
	Log  string `json:"log"`
}

func (ErrorTxResult) MarshalEasyJSON

func (v ErrorTxResult) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ErrorTxResult) MarshalJSON

func (v ErrorTxResult) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ErrorTxResult) UnmarshalEasyJSON

func (v *ErrorTxResult) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ErrorTxResult) UnmarshalJSON

func (v *ErrorTxResult) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type EstimateResponse

type EstimateResponse struct {
	WillPay    float32 `json:"will_pay" bson:"will_pay" gorm:"will_pay" db:"will_pay"`
	WillGet    float32 `json:"will_get" bson:"will_get" gorm:"will_get" db:"will_get"`
	Commission float32 `json:"commission" bson:"commission" gorm:"commission" db:"commission"`
}

для запроса о стоимости монет

func (EstimateResponse) MarshalEasyJSON

func (v EstimateResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EstimateResponse) MarshalJSON

func (v EstimateResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EstimateResponse) UnmarshalEasyJSON

func (v *EstimateResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EstimateResponse) UnmarshalJSON

func (v *EstimateResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type EventValueData

type EventValueData struct {
	Role            string  `json:"role" bson:"role" gorm:"role" db:"role"` //DAO,Developers,Validator,Delegator
	Address         string  `json:"address" bson:"address" gorm:"address" db:"address"`
	AmountTx        string  `json:"amount" bson:"-" gorm:"-" db:"-"`
	Amount          float32 `json:"amount_f32" bson:"amount_f32" gorm:"amount_f32" db:"amount_f32"`
	Coin            string  `json:"coin" bson:"coin" gorm:"coin" db:"coin"`
	ValidatorPubKey string  `json:"validator_pub_key" bson:"validator_pub_key" gorm:"validator_pub_key" db:"validator_pub_key"`
}

func (EventValueData) MarshalEasyJSON

func (v EventValueData) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EventValueData) MarshalJSON

func (v EventValueData) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EventValueData) UnmarshalEasyJSON

func (v *EventValueData) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EventValueData) UnmarshalJSON

func (v *EventValueData) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ResultNetwork

type ResultNetwork struct {
	Version             string    `json:"version" bson:"version" gorm:"version" db:"version"`
	LatestBlockHash     string    `json:"latest_block_hash" bson:"-" gorm:"-" db:"-"`
	LatestAppHash       string    `json:"latest_app_hash" bson:"-" gorm:"-" db:"-"`
	LatestBlockHeightTx string    `json:"latest_block_height" bson:"-" gorm:"-" db:"-"`
	LatestBlockHeight   int       `json:"latest_block_height_i32" bson:"latest_block_height_i32" gorm:"latest_block_height_i32" db:"latest_block_height_i32"`
	LatestBlockTime     time.Time `json:"latest_block_time" bson:"-" gorm:"-" db:"-"`
}

func (ResultNetwork) MarshalEasyJSON

func (v ResultNetwork) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ResultNetwork) MarshalJSON

func (v ResultNetwork) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ResultNetwork) UnmarshalEasyJSON

func (v *ResultNetwork) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ResultNetwork) UnmarshalJSON

func (v *ResultNetwork) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type SDK

type SDK struct {
	MnAddress     string // адрес мастер ноды с открытым портом API
	AccAddress    string // адрес кошелька/аккаунта "Mx..."
	AccPrivateKey string // приватный ключ кошелька/аккаунта
	Debug         bool   // Режим дебага
	ChainMainnet  bool   // Main=true, Test=false
}

func (*SDK) DebugLog

func (c *SDK) DebugLog(status string, msg string, body interface{})

func (*SDK) EstimateCoinBuy

func (c *SDK) EstimateCoinBuy(coinBuy string, coinSell string, valueBuy int64) (EstimateResponse, error)

Стоимость покупки value монет

func (*SDK) EstimateCoinSell

func (c *SDK) EstimateCoinSell(coinSell string, coinBuy string, valueSell int64) (EstimateResponse, error)

Стоимость продажи value монет

func (*SDK) EstimateTxCommission

func (c *SDK) EstimateTxCommission(tx string) (float32, error)

Возвращает оценку сколько комиссия

func (*SDK) GetAddress

func (c *SDK) GetAddress(usrAddr string) (map[string]float32, uint32, error)

узнаем баланс и количество транзакций

func (*SDK) GetBlock

func (c *SDK) GetBlock(id int) (BlockResponse, error)

получаем содержимое блока по его ID

func (*SDK) GetCandidate

func (c *SDK) GetCandidate(candidateHash string) (CandidateInfo, error)

func (*SDK) GetCandidates

func (c *SDK) GetCandidates() ([]CandidateInfo, error)

Возвращает список нод валидаторов и кандидатов

func (*SDK) GetCoinInfo

func (c *SDK) GetCoinInfo(coinSmbl string) (CoinInfoResponse, error)

получение доп.данных о монете: volume, reserve_balance

func (*SDK) GetEvents

func (c *SDK) GetEvents(id int) (BlockEvResponse, error)

получаем содержимое событий блока по его ID

func (*SDK) GetMinGas

func (c *SDK) GetMinGas() (int64, error)

получение минимального значения газа на данный момент

func (*SDK) GetStatus

func (c *SDK) GetStatus() (ResultNetwork, error)

получение сколько всего блоков в сети

func (*SDK) GetTransaction

func (c *SDK) GetTransaction(hash string) (TransResponse, error)

получаем содержимое транзакции по её хэшу

func (*SDK) GetValidators

func (c *SDK) GetValidators() ([]result_valid, error)

Возвращает список валидаторов

func (*SDK) GetValidatorsBlock

func (c *SDK) GetValidatorsBlock(blockN int) ([]result_valid, error)

Возвращает список валидаторов по номеру блока (у мастерноды должен быть включен keep_state_history)

func (*SDK) SetTransaction

func (c *SDK) SetTransaction(strRlpEnc string) (string, error)

Исполнение транзакции закодированной RLP

func (*SDK) TxBuyCoin

func (c *SDK) TxBuyCoin(t *TxBuyCoinData) (string, error)

Транзакция - Купить монету

func (*SDK) TxBuyCoinRLP

func (c *SDK) TxBuyCoinRLP(t *TxBuyCoinData) (string, error)

func (*SDK) TxCreateCheck

func (c *SDK) TxCreateCheck(t *TxCreateCkeckData) (string, error)

НЕ!Транзакция - Создание чека

func (*SDK) TxCreateCoin

func (c *SDK) TxCreateCoin(t *TxCreateCoinData) (string, error)

Транзакция - Создание монеты

func (*SDK) TxCreateCoinRLP

func (c *SDK) TxCreateCoinRLP(t *TxCreateCoinData) (string, error)

func (*SDK) TxDeclareCandidacy

func (c *SDK) TxDeclareCandidacy(t *TxDeclareCandidacyData) (string, error)

Транзакция - Декларирования мастерноды в кандидаты

func (*SDK) TxDeclareCandidacyRLP

func (c *SDK) TxDeclareCandidacyRLP(t *TxDeclareCandidacyData) (string, error)

func (*SDK) TxDelegate

func (c *SDK) TxDelegate(t *TxDelegateData) (string, error)

Транзакция - Делегирование

func (*SDK) TxDelegateRLP

func (c *SDK) TxDelegateRLP(t *TxDelegateData) (string, error)

func (*SDK) TxEditCandidate

func (c *SDK) TxEditCandidate(t *TxEditCandidateData) (string, error)

Транзакция - Декларирования мастерноды в кандидаты

func (*SDK) TxEditCandidateRLP

func (c *SDK) TxEditCandidateRLP(t *TxEditCandidateData) (string, error)

func (*SDK) TxMultiSendCoin

func (c *SDK) TxMultiSendCoin(t *TxMultiSendCoinData) (string, error)

Транзакция - Передача монет нескольким адресатам

func (*SDK) TxMultiSendCoinRLP

func (c *SDK) TxMultiSendCoinRLP(t *TxMultiSendCoinData) (string, error)

func (*SDK) TxRedeemCheck

func (c *SDK) TxRedeemCheck(t *TxRedeemCheckData) (string, error)

Транзакция - Погашение чека (обналичивание)

func (*SDK) TxRedeemCheckRLP

func (c *SDK) TxRedeemCheckRLP(t *TxRedeemCheckData) (string, error)

func (*SDK) TxSellAllCoin

func (c *SDK) TxSellAllCoin(t *TxSellAllCoinData) (string, error)

Транзакция - Продажи всех монет

func (*SDK) TxSellAllCoinRLP

func (c *SDK) TxSellAllCoinRLP(t *TxSellAllCoinData) (string, error)

func (*SDK) TxSellCoin

func (c *SDK) TxSellCoin(t *TxSellCoinData) (string, error)

Транзакция - Продажи монет

func (*SDK) TxSellCoinRLP

func (c *SDK) TxSellCoinRLP(t *TxSellCoinData) (string, error)

func (*SDK) TxSendCoin

func (c *SDK) TxSendCoin(t *TxSendCoinData) (string, error)

Транзакция - Передача монет

func (*SDK) TxSendCoinRLP

func (c *SDK) TxSendCoinRLP(t *TxSendCoinData) (string, error)

func (*SDK) TxSetCandidate

func (c *SDK) TxSetCandidate(t *TxSetCandidateData) (string, error)

Транзакция - Вкл./выкл мастерноду в валидаторы

func (*SDK) TxSetCandidateRLP

func (c *SDK) TxSetCandidateRLP(t *TxSetCandidateData) (string, error)

func (*SDK) TxUnbond

func (c *SDK) TxUnbond(t *TxUnbondData) (string, error)

Транзакция - Отозвать монеты из делегированных в валидатора

func (*SDK) TxUnbondRLP

func (c *SDK) TxUnbondRLP(t *TxUnbondData) (string, error)

type SendOneData

type SendOneData struct {
	To    string `json:"to"`
	Coin  string `json:"coin"`
	Value string `json:"value"`
}

Не заносится в БД

func (SendOneData) MarshalEasyJSON

func (v SendOneData) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (SendOneData) MarshalJSON

func (v SendOneData) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*SendOneData) UnmarshalEasyJSON

func (v *SendOneData) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SendOneData) UnmarshalJSON

func (v *SendOneData) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type TransData

type TransData struct {
	//=== type1 - TYPE_SEND
	To string `json:"to"`
	//Coin   string `json:"coin"`
	//Value  string `json:"value"`
	//=== type2 - TYPE_SELL_COIN
	ValueToSell string `json:"value_to_sell"`
	//CoinToSell string `json:"coin_to_sell"`
	//CoinToBuy  string `json:"coin_to_buy"`
	//=== type3 - TYPE_SELL_ALL_COIN
	//CoinToSell string `json:"coin_to_sell"`
	//CoinToBuy  string `json:"coin_to_buy"`
	//=== type4 - TYPE_BUY_COIN
	CoinToBuy  string `json:"coin_to_buy"`
	ValueToBuy string `json:"value_to_buy"`
	CoinToSell string `json:"coin_to_sell"`
	//=== type5 - TYPE_CREATE_COIN
	Name                 string `json:"name"`                   // название монеты
	CoinSymbol           string `json:"symbol"`                 // символ монеты
	InitialAmount        string `json:"initial_amount"`         //  Amount of coins to issue. Issued coins will be available to sender account.
	InitialReserve       string `json:"initial_reserve"`        // Initial reserve in base coin.
	ConstantReserveRatio string `json:"constant_reserve_ratio"` // should be from 10 to 100 (в %).
	//=== type6 - TYPE_DECLARE_CANDIDACY
	Address    string `json:"address"`
	Commission int    `json:"commission,string"`
	//Stake	string `json:"stake"`
	//PubKey  string `json:"pub_key"`
	//Coin    string `json:"coin"`
	//=== type7 - TYPE_DELEGATE
	Stake string `json:"stake"` // УДАЛИТЬ: с 0.15.* стало Value  string `json:"value"`
	//PubKey  string `json:"pub_key"`
	//Coin    string `json:"coin"`
	//=== type8 - TYPE_UNBOUND
	PubKey string `json:"pub_key"`
	Coin   string `json:"coin"`
	Value  string `json:"value"`
	//=== type9 - TYPE_REDEEM_CHECK
	RawCheck string `json:"raw_check"`
	Proof    string `json:"proof"`
	//=== type10 - TYPE_SET_CANDIDATE_ONLINE
	//=== type11 - TYPE_SET_CANDIDATE_OFFLINE
	//=== type13 - TYPE_MULTISEND
	List []SendOneData `json:"list"`
	//=== type14 -
	RewardAddress string `json:"reward_address"`
	OwnerAddress  string `json:"owner_address"`
}

Не заносится в БД

func (TransData) MarshalEasyJSON

func (v TransData) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (TransData) MarshalJSON

func (v TransData) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*TransData) UnmarshalEasyJSON

func (v *TransData) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*TransData) UnmarshalJSON

func (v *TransData) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type TransResponse

type TransResponse struct {
	Hash        string       `json:"hash" bson:"hash" gorm:"hash" db:"hash"`
	RawTx       string       `json:"raw_tx" bson:"raw_tx" gorm:"raw_tx" db:"raw_tx"`
	HeightTx    string       `json:"height" bson:"-" gorm:"-" db:"-"` //(!) В блоке у транзакции нет HEIGHT блока
	Height      int          `json:"height_i32" bson:"height_i32" gorm:"height_i32" db:"height_i32"`
	Index       int          `json:"index" bson:"index" gorm:"index" db:"index_i32"`
	From        string       `json:"from" bson:"from" gorm:"from" db:"from"`
	NonceTx     string       `json:"nonce" bson:"-" gorm:"-" db:"-"`
	Nonce       int          `json:"nonce_i32" bson:"nonce_i32" gorm:"nonce_i32" db:"nonce_i32"`
	GasPriceTx  int          `json:"gas_price" bson:"-" gorm:"-" db:"-"` // TODO: с версии 0.19 стало числом, переписать gas_price_i32!
	GasPrice    int          `json:"gas_price_i32" bson:"gas_price_i32" gorm:"gas_price_i32" db:"gas_price_i32"`
	GasCoin     string       `json:"gas_coin" bson:"gas_coin" gorm:"gas_coin" db:"gas_coin"`
	GasUsedTx   string       `json:"gas" bson:"-" gorm:"-" db:"-"`
	GasUsed     int          `json:"gas_used_i32" bson:"gas_used_i32" gorm:"gas_used_i32" db:"gas_used_i32"`
	Type        int          `json:"type" bson:"type" gorm:"type" db:"type"`
	DataTx      TransData    `json:"data" bson:"-" gorm:"-" db:"-"`
	Data        interface{}  `json:"-" bson:"data" gorm:"data" db:"data"`
	Payload     string       `json:"payload" bson:"payload" gorm:"payload" db:"payload"`
	Tags        tagKeyValue2 `json:"tags" bson:"tags" gorm:"tags" db:"tags"` // TODO: нет необходимости в нём, пока из Покупки/Продажи результат обмена tx.return не вынесут на уровень выше
	Code        int          `json:"code" bson:"code" gorm:"code" db:"code"` // если не 0, то ОШИБКА, читаем лог(Log)
	Log         string       `json:"log" bson:"log" gorm:"log" db:"log"`
	ServiceData []byte       `json:"service_data" bson:"service_data" gorm:"service_data" db:"service_data"` //TODO: ?
}

func (TransResponse) MarshalEasyJSON

func (v TransResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (TransResponse) MarshalJSON

func (v TransResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*TransResponse) UnmarshalEasyJSON

func (v *TransResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*TransResponse) UnmarshalJSON

func (v *TransResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type TransSendResponse

type TransSendResponse struct {
	Code int    `json:"code" bson:"code" gorm:"code" db:"code"`
	Log  string `json:"log" bson:"log" gorm:"log" db:"log"`
	Data string `json:"data" bson:"data" gorm:"data" db:"data"`
	Hash string `json:"hash" bson:"hash" gorm:"hash" db:"hash"`
}

func (TransSendResponse) MarshalEasyJSON

func (v TransSendResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (TransSendResponse) MarshalJSON

func (v TransSendResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*TransSendResponse) UnmarshalEasyJSON

func (v *TransSendResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*TransSendResponse) UnmarshalJSON

func (v *TransSendResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type TxBuyCoinData

type TxBuyCoinData struct {
	CoinToSell string
	CoinToBuy  string
	ValueToBuy float32
	// Other
	Payload string
	// Gas
	GasCoin  string
	GasPrice int64
}

Структура данных для Покупки монет

type TxCreateCkeckData

type TxCreateCkeckData struct {
	Coin     string
	Stake    float32
	Password string
	Nonce    uint64
}

Структура данных для Создания монеты

type TxCreateCoinData

type TxCreateCoinData struct {
	Name                 string
	Symbol               string
	InitialAmount        int64
	InitialReserve       int64
	ConstantReserveRatio uint
	// Other
	Payload string
	// Gas
	GasCoin  string
	GasPrice int64
}

Структура данных для Создания монеты

type TxDeclareCandidacyData

type TxDeclareCandidacyData struct {
	PubKey     string // брать или с http://locallhost:3000 или с файла в conf/
	Commission uint
	Coin       string
	Stake      int64
	// Other
	Payload string
	// Gas
	GasCoin  string
	GasPrice int64
}

Структура данных для Декларирования мастерноды в кандидаты

type TxDelegateData

type TxDelegateData struct {
	PubKey string
	Coin   string
	Stake  float32
	// Other
	Payload string
	// Gas
	GasCoin  string
	GasPrice int64
}

Структура данных для Делегирования

type TxEditCandidateData

type TxEditCandidateData struct {
	PubKey        string
	RewardAddress string
	OwnerAddress  string
	// Other
	Payload string
	// Gas
	GasCoin  string
	GasPrice int64
}

Структура данных для Статус кандидата вкл/выкл

type TxMultiSendCoinData

type TxMultiSendCoinData struct {
	List []TxOneSendCoinData
	// Other
	Payload string
	// Gas
	GasCoin  string
	GasPrice int64
}

Структура данных для Передачи монет нескольком адресатам

type TxOneSendCoinData

type TxOneSendCoinData struct {
	Coin      string
	ToAddress string
	Value     float32
}

type TxRedeemCheckData

type TxRedeemCheckData struct {
	Check    string
	Password string
	// Other
	Payload string
	// Gas
	GasCoin  string
	GasPrice int64
}

type TxSellAllCoinData

type TxSellAllCoinData struct {
	CoinToSell string
	CoinToBuy  string
	// Other
	Payload string
	// Gas
	GasCoin  string
	GasPrice int64
}

Структура данных для Продажи всех монет

type TxSellCoinData

type TxSellCoinData struct {
	CoinToSell  string
	CoinToBuy   string
	ValueToSell float32
	// Other
	Payload string
	// Gas
	GasCoin  string
	GasPrice int64
}

Структура данных для Продажи монет

type TxSendCoinData

type TxSendCoinData struct {
	Coin      string
	ToAddress string
	Value     float32
	// Other
	Payload string
	// Gas
	GasCoin  string
	GasPrice int64
}

Структура данных для Передачи монет

type TxSetCandidateData

type TxSetCandidateData struct {
	PubKey   string
	Activate bool // Вкл./выкл мастерноду
	// Other
	Payload string
	// Gas
	GasCoin  string
	GasPrice int64
}

Структура данных для Статус кандидата вкл/выкл

type TxUnbondData

type TxUnbondData struct {
	PubKey string
	Coin   string
	Value  int64
	// Other
	Payload string
	// Gas
	GasCoin  string
	GasPrice int64
}

Структура данных для Отзыва монет

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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