token

package
v0.0.0-...-d4762d9 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONST_Incetives_Withdrawal_Status_Pending = "pending"
	CONST_Incetives_Withdrawal_Status_Done    = "done"
)
View Source
const (
	CONST_Token_PreLock_Type_Lock   = "lock"
	CONST_Token_PreLock_Type_unlock = "unlock"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountIdWithdrawalId

type AccountIdWithdrawalId struct {
	Id string
}

type AccountIdWithdrawalRequest

type AccountIdWithdrawalRequest struct {
	NodeId    string          `json:"node_id"`   // Node id.
	Created   int             `json:"created"`   // Withdrawal creation time. Unix timestamp.
	Amount    decimal.Decimal `json:"amount"`    // Withdraw amount value.
	NodeFee   decimal.Decimal `json:"node_fee"`  // Node charged withdrawal fee.
	Signature string          `json:"signature"` // Metadata signature.
}

type AccountIdWithdrawalResponse

type AccountIdWithdrawalResponse struct {
	core.Response
	Data *AccountIdWithdrawalId `json:"data"`
}

func PostWithdrawIncentives

func PostWithdrawIncentives(account_id, node_id string, created int, amount decimal.Decimal, node_fee decimal.Decimal) (*AccountIdWithdrawalResponse, error)

type AccountTokensData

type AccountTokensData struct {
	Balance          decimal.Decimal `json:"balance"`            // Token balance.
	PreLockAll       decimal.Decimal `json:"pre_lock_all"`       // Total pre-locked amount.
	PreLockAvailable decimal.Decimal `json:"pre_lock_available"` // Remaining pre-locked amount.
	IncentivesAll    decimal.Decimal `json:"incentives_all"`     // Total incentives.
	IncentivesLocked decimal.Decimal `json:"incentives_locked"`  // Incentives locked on this node.
	IncentivesOnNode decimal.Decimal `json:"incentives_on_node"` // Amount in the node's incentives pool.
}

type AccountTokensResponse

type AccountTokensResponse struct {
	core.Response
	Data *AccountTokensData `json:"data"`
}

func GetAccountTokensData

func GetAccountTokensData(account_id string) (*AccountTokensResponse, error)

type IncentiveByDate

type IncentiveByDate struct {
	Date      string          `json:"date"`      // Incentives date. Unix timestamp.
	Total     decimal.Decimal `json:"total"`     // Total incentives get for today.
	Originals decimal.Decimal `json:"originals"` // Incentives get from original.
	Likes     decimal.Decimal `json:"likes"`     // Incentives get from likes.
	Comments  decimal.Decimal `json:"comments"`  // Incentives get from comments.
	Shares    decimal.Decimal `json:"shares"`    // Incentives get from shares.
	Groups    decimal.Decimal `json:"groups"`    // Incentives get from group management.
}

type IncentivesListResponse

type IncentivesListResponse struct {
	core.Response
	Data []IncentiveByDate `json:"data"`
}

func GetIncentivesList

func GetIncentivesList(account_id string, startDate, endDate, page, pageSize int) (*IncentivesListResponse, error)

type IncentivesWithdrawalListResponse

type IncentivesWithdrawalListResponse struct {
	core.Response
	Data []NodeAccountWithdraw `json:"data"`
}

func GetIncentivesWithdrawalList

func GetIncentivesWithdrawalList(account_id string, startDate, endDate, page, pageSize int, status string) (*IncentivesWithdrawalListResponse, error)

type NodeAccountWithdraw

type NodeAccountWithdraw struct {
	Id           string          `json:"id"`            // Withdrawal id.
	Created      int             `json:"created"`       // Withdrawal created time. Unix timestamp.
	Updated      int             `json:"updated"`       // Withdrawal updated time.
	Amount       decimal.Decimal `json:"amount"`        // Withdrawal amount.
	BalanceAfter decimal.Decimal `json:"balance_after"` // Balance after withdrawal.
	NodeFee      decimal.Decimal `json:"node_fee"`      // Node charged withdrawal fee.
	Status       string          `json:"status"`        // Withdrawal status. "pending", "done" or "cancelled".
	Transaction  *TransactionObj `json:"transaction"`   // Withdrawal transaction object
}

type PreLockTokenId

type PreLockTokenId struct {
	Id string
}

type PreLockTokenResponse

type PreLockTokenResponse struct {
	core.Response
	Data *PreLockTokenId `json:"data"`
}

func PostPreLockTokens

func PostPreLockTokens(user_address string, account_id string, amount decimal.Decimal, nonce string) (*PreLockTokenResponse, error)

type PreLockTokensRequest

type PreLockTokensRequest struct {
	Transaction string `json:"transaction"`
}

type SignPreLock

type SignPreLock struct {
	Amount    decimal.Decimal `json:"amount"`    // Pre lock amount
	Nonce     string          `json:"nonce"`     // User operator nonce id
	Signature string          `json:"signature"` // User signature
}

type TokenPreLock

type TokenPreLock struct {
	Id                string          `json:"id"`                 // Lock id.
	Created           int             `json:"created"`            // Lock creation time. Unix timestamp.
	Atype             string          `json:"type"`               // Pre-lock type. "lock" or "unlock"
	Amount            decimal.Decimal `json:"amount"`             // Pre-lock amount.
	Signature         string          `json:"signature"`          // Metadata signature.
	TransactionHash   string          `json:"transaction_hash"`   // Transaction hash.
	TransactionStatus string          `json:"transaction_status"` // Transaction status. "pending", "done" or "failed"
}

type TokenPreLockListResponse

type TokenPreLockListResponse struct {
	core.Response
	Data []TokenPreLock `json:"data"`
}

func GetTokenPreLockList

func GetTokenPreLockList(account_id string, startDate, endDate, page, pageSize int, qtype string) (*TokenPreLockListResponse, error)

type TransactionObj

type TransactionObj struct {
	Transaction_id     string `json:"transaction_id,omitempty"`      // Transaction hash.
	BlockNumber        int    `json:"block_number,omitempty"`        // Block number of this transaction.
	BlockConfirmations int    `json:"block_confirmations,omitempty"` // Block confirmation time.
	EstimatedTime      int    `json:"estimated_time"`                // Estimated confirmation time. Unix timestamp.
	ConfirmedTime      int    `json:"confirmed_time,omitempty"`      // Confirmation time. Unix timestamp.
}

Jump to

Keyboard shortcuts

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