peatio

package
v0.0.0-...-45d6dea Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Balance

type Balance struct {
	UID     string `json:"uid"`
	Balance string `json:"balance"`
	Locked  string `json:"locked"`
}

type Beneficiary

type Beneficiary struct {
	ID          int               `json:"id"`
	Currency    string            `json:"currency"`
	Name        string            `json:"name"`
	Description string            `json:"description"`
	Data        datatypes.JSONMap `json:"data"` //-- contains account number, bank, asset code
	State       string            `json:"state"`
	Sent_At     string            `json:"sent_at"`
}

type BlockchainCurrency

type BlockchainCurrency struct {
	ID                  string                 `json:"id"`
	CurrencyID          string                 `json:"currency_id"`
	BlockchainKey       string                 `json:"blockchain_key"`
	ParentID            string                 `json:"parent_id"`
	Status              string                 `json:"status"`
	DepositEnabled      bool                   `json:"deposit_enabled"`
	WithdrawEnabled     bool                   `json:"withdrawal_enabled"`
	DepositFee          string                 `json:"deposit_fee"`
	MinDepositAmount    string                 `json:"min_deposit_amount"`
	WithdrawFee         string                 `json:"withdraw_fee"`
	MinWithdrawAmount   string                 `json:"min_withdraw_amount"`
	BaseFactor          uint64                 `json:"base_factor"`
	MinCollectionAmount string                 `json:"min_collection_amount"`
	Options             map[string]interface{} `json:"options"`
}

type ChangeDepositStateParams

type ChangeDepositStateParams struct {
	TID   string `json:"tid"`
	State string `json:"state"`
}

type Client

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

Client is peatio management api client instance

func New

func New(URL, jwtIssuer, jwtAlgo, jwtPrivateKey string) (*Client, error)

New return peatio management api client

func (*Client) ChangeDepositState

func (p *Client) ChangeDepositState(params ChangeDepositStateParams) (*Deposit, *mngapi.APIError)

func (*Client) CreateBeneficiary

func (p *Client) CreateBeneficiary(params CreateBeneficiaryParams) (*Beneficiary, *mngapi.APIError)

func (*Client) CreateBlockchainCurrency

func (p *Client) CreateBlockchainCurrency(params CreateBlockchainCurrencyParams) (*BlockchainCurrency, *mngapi.APIError)

func (*Client) CreateCurrency

func (p *Client) CreateCurrency(params CreateCurrencyParams) (*Currency, *mngapi.APIError)

func (*Client) CreateDeposit

func (p *Client) CreateDeposit(params CreateDepositParams) (*Deposit, *mngapi.APIError)

CreateDeposit call peatio management api to create new deposit

func (*Client) CreateEngine

func (p *Client) CreateEngine(params CreateEngineParams) (*Engine, *mngapi.APIError)

CreateEngine call peatio management api to create new engine

func (*Client) CreateMarket

func (p *Client) CreateMarket(params CreateMarketParams) (*Market, *mngapi.APIError)

func (*Client) CreateMember

func (p *Client) CreateMember(params CreateMemberParams) (*Member, *mngapi.APIError)

func (*Client) CreateWallet

func (p *Client) CreateWallet(params CreateWalletParams) (*Wallet, *mngapi.APIError)

CreateWallet call peatio management api to create wallet

func (*Client) CreateWithdraw

func (p *Client) CreateWithdraw(params CreateWithdrawParams) (*Withdraw, *mngapi.APIError)

CreateWithdraw call peatio management api to create new withdraw

func (*Client) GenerateDepositAddress

func (p *Client) GenerateDepositAddress(params GenerateDepositAddressParams) (*PaymentAddress, *mngapi.APIError)

GenerateDepositAddress call peatio management api to generate new deposit address

func (*Client) GetAccountBalance

func (p *Client) GetAccountBalance(params GetAccountBalanceParams) (*Balance, *mngapi.APIError)

GetAccountBalance call peatio management api to get account balance

func (*Client) GetBeneficiaries

func (p *Client) GetBeneficiaries(params GetBeneficiariesParams) (*[]Beneficiary, *mngapi.APIError)

func (*Client) GetBlockchainCurrencyByID

func (p *Client) GetBlockchainCurrencyByID(id string) (*BlockchainCurrency, *mngapi.APIError)

GetBlockchainCurrencyByID call peatio management api to get blockchain currency information by id

func (*Client) GetCurrenciesList

func (p *Client) GetCurrenciesList(params CurrenciesListParams) (*[]Currency, *mngapi.APIError)

GetCurrenciesList call peatio management api to get currency information by code name

func (*Client) GetCurrencyByCode

func (p *Client) GetCurrencyByCode(code string) (*Currency, *mngapi.APIError)

GetCurrencyByCode call peatio management api to get currency information by code name

func (*Client) GetDepositByID

func (p *Client) GetDepositByID(tid string) (*Deposit, *mngapi.APIError)

GetDepositByID call peatio management api to get deposit information by transaction ID

func (*Client) GetDeposits

func (p *Client) GetDeposits(params GetDepositsParams) ([]*Deposit, *mngapi.APIError)

GetDeposits call peatio management api to get deposits as paginated collection

func (*Client) GetEngines

func (p *Client) GetEngines(params GetEngineParams) ([]*Engine, *mngapi.APIError)

GetEngines call peatio management api to get engines

func (*Client) GetMarketByID

func (p *Client) GetMarketByID(id string) (*Market, *mngapi.APIError)

func (*Client) GetMarkets

func (p *Client) GetMarkets() ([]*Market, *mngapi.APIError)

GetMarkets call peatio management api to get all markets

func (*Client) GetWalletByID

func (p *Client) GetWalletByID(id int) (*Wallet, *mngapi.APIError)

func (*Client) GetWallets

func (p *Client) GetWallets() ([]*Wallet, *mngapi.APIError)

GetWallets call peatio management api to get wallets

func (*Client) GetWithdrawByID

func (p *Client) GetWithdrawByID(tid string) (*Withdraw, *mngapi.APIError)

GetWithdrawByID call peatio management api to get withdraw information by transaction ID

func (*Client) GetWithdrawsList

func (p *Client) GetWithdrawsList(params WithdrawsListParams) (*[]Withdraw, *mngapi.APIError)

GetCurrenciesList call peatio management api to get currency information by code name

func (*Client) PerformActionOnWithdraw

func (p *Client) PerformActionOnWithdraw(params PerformActionOnWithdrawParams) (*Withdraw, *mngapi.APIError)

/--- PerformActionOnWithdraw calls peatio manaagement api to perform action on withdraw

func (*Client) UpdateBlockchainCurrency

func (p *Client) UpdateBlockchainCurrency(params UpdateBlockchainCurrencyParams) (*BlockchainCurrency, *mngapi.APIError)

func (*Client) UpdateCurrency

func (p *Client) UpdateCurrency(params UpdateCurrencyParams) (*Currency, *mngapi.APIError)

func (*Client) UpdateEngine

func (p *Client) UpdateEngine(params UpdateEngineParams) (*Engine, *mngapi.APIError)

UpdateEngine call peatio management api to update engine

func (*Client) UpdateMarket

func (p *Client) UpdateMarket(params UpdateMarketParams) (*Market, *mngapi.APIError)

UpdateMarket call peatio management api to update market

func (*Client) UpdateWallet

func (p *Client) UpdateWallet(params UpdateWalletParams) (*Wallet, *mngapi.APIError)

UpdateWallet call peatio management api to update wallet

type CreateBeneficiaryParams

type CreateBeneficiaryParams struct {
	Currency      string            `json:"currency"`
	Name          string            `json:"name"`
	BlockchainKey string            `json:"blockchain_key"`
	Description   string            `json:"description,omitempty"`
	Data          datatypes.JSONMap `json:"data"`
	UID           string            `json:"uid"`
	State         string            `json:"state,omitempty"`
}

type CreateBlockchainCurrencyParams

type CreateBlockchainCurrencyParams struct {
	CurrencyID          string            `json:"currency_id"`
	BlockchainKey       string            `json:"blockchain_key,omitempty"`
	BaseFactor          int64             `json:"base_factor,omitempty"`
	ParentID            string            `json:"parent_id,omitempty"`
	DepositFee          string            `json:"deposit_fee,omitempty"`
	MinDepositAmount    string            `json:"min_deposit_amount,omitempty"`
	MinCollectionAmount string            `json:"min_collection_amount,omitempty"`
	WithdrawFee         string            `json:"withdraw_fee,omitempty"`
	MinWithdrawAmount   string            `json:"min_withdraw_amount,omitempty"`
	DepositEnabled      bool              `json:"deposit_enabled,omitempty"`
	WithdrawEnabled     bool              `json:"withdrawal_enabled,omitempty"`
	Status              string            `json:"status,omitempty"`
	Options             datatypes.JSONMap `json:"options"`
}

type CreateCurrencyParams

type CreateCurrencyParams struct {
	Code        string `json:"code"`
	Type        string `json:"type,omitempty"`
	Position    int64  `json:"position,omitempty"`
	Name        string `json:"name,omitempty"`
	Precision   int64  `json:"precision,omitempty"`
	Price       string `json:"price,omitempty"`
	Status      string `json:"status,omitempty"`
	IconURL     string `json:"icon_url,omitempty"`
	Description string `json:"description,omitempty"`
	Homepage    string `json:"homepage,omitempty"`
}

type CreateDepositParams

type CreateDepositParams struct {
	UID           string  `json:"uid"`
	TID           string  `json:"tid,omitempty"`
	Currency      string  `json:"currency"`
	BlockchainKey string  `json:"blockchain_key"`
	Amount        float64 `json:"amount"`
	State         string  `json:"state,omitempty"`
	TransferType  string  `json:"transfer_type,omitempty"`
}

type CreateEngineParams

type CreateEngineParams struct {
	Name   string `json:"name"`
	Driver string `json:"driver"`
	UID    string `json:"uid"`
	URL    string `json:"url"`
	State  int    `json:"state"`
	Key    string `json:"key"`
	Secret string `json:"secret"`
}

type CreateMarketParams

type CreateMarketParams struct {
	BaseCurrency    string `json:"base_currency"`
	QuoteCurrency   string `json:"quote_currency"`
	State           string `json:"state"`
	EngineName      string `json:"engine_name"`
	AmountPrecision int64  `json:"amount_precision"`
	PricePrecision  int64  `json:"price_precision"`
	MinPrice        string `json:"min_price"`
	MaxPrice        string `json:"max_price"`
	MinAmount       string `json:"min_amount"`
	Position        int64  `json:"position"`
}

type CreateMemberParams

type CreateMemberParams struct {
	Email string `json:"email"`
	UID   string `json:"uid"`
	Level int    `json:"level"`
	Role  string `json:"role"`
	State string `json:"state"`
	Group string `json:"group"`
}

type CreateWalletParams

type CreateWalletParams struct {
	BlockchainKey string         `json:"blockchain_key"`
	Name          string         `json:"name"`
	Kind          string         `json:"kind"`
	Gateway       string         `json:"gateway"`
	Address       string         `json:"address"`
	Currencies    pq.StringArray `json:"currencies,omitempty"`
	Settings      Settings       `json:"settings,omitempty" gorm:"embedded;embedded_prefix:set_"`
	MaxBalance    string         `json:"max_balance,omitempty"`
	Status        string         `json:"status,omitempty"`
}

type CreateWithdrawParams

type CreateWithdrawParams struct {
	UID           string  `json:"uid"`
	TID           string  `json:"tid,omitempty"`
	RID           string  `json:"rid,omitempty"`
	BeneficiaryID string  `json:"beneficiary_id,omitempty"`
	BlockchainKey string  `json:"blockchain_key"`
	Currency      string  `json:"currency"`
	Amount        float64 `json:"amount"`
	Note          string  `json:"note,omitempty"`
	Action        string  `json:"action,omitempty"`
	TransferType  string  `json:"transfer_type,omitempty"`
	AdditionalFee bool    `json:"additional_fee,omitempty"`
}

type CurrenciesListParams

type CurrenciesListParams struct {
	Type string `json:"type,omitempty"`
}

type Currency

type Currency struct {
	ID          string               `json:"id"`
	Name        string               `json:"name"`
	Description string               `json:"description"`
	Homepage    string               `json:"homepage"`
	Price       string               `json:"price"`
	Status      string               `json:"status"`
	Type        string               `json:"type"`
	Precision   uint64               `json:"precision"`
	Position    uint64               `json:"position"`
	IconURL     string               `json:"icon_url"`
	Code        string               `json:"code"`
	Networks    []BlockchainCurrency `json:"networks"`
}

type Deposit

type Deposit struct {
	ID                      uint64  `json:"id"`
	TID                     string  `json:"tid"`
	BlockchainKey           string  `json:"blockchain_key"`
	Currency                string  `json:"currency"`
	Address                 string  `json:"address"`
	UID                     string  `json:"uid"`
	Type                    string  `json:"type"`
	Amount                  string  `json:"amount"`
	State                   string  `json:"state"`
	CreatedAt               string  `json:"created_at"`
	CompletedAt             *string `json:"completed_at"`
	BlockchainTxID          string  `json:"blockchain_txid,omitempty"`
	BlockchainConfirmations string  `json:"blockchain_confirmations,omitempty"`
	TransferType            string  `json:"transfer_type"`
}

type Engine

type Engine struct {
	ID     int    `json:"id"`
	Name   string `json:"name"`
	Driver string `json:"driver"`
	UID    string `json:"uid"`
	URL    string `json:"url"`
	State  string `json:"state"`
}

type GenerateDepositAddressParams

type GenerateDepositAddressParams struct {
	UID           string `json:"uid"`
	Currency      string `json:"currency"`
	BlockchainKey string `json:"blockchain_key,omitempty"`
	Remote        bool   `json:"remote,omitempty"`
}

type GetAccountBalanceParams

type GetAccountBalanceParams struct {
	UID      string `json:"uid"`
	Currency string `json:"currency"`
}

type GetBeneficiariesParams

type GetBeneficiariesParams struct {
	UID      string `json:"uid"`
	Currency string `json:"currency,omitempty"`
	State    string `json:"state,omitempty"`
}

type GetDepositsParams

type GetDepositsParams struct {
	UID           string `json:"uid,omitempty"`
	FromID        int64  `json:"from_id,omitempty"`
	Currency      string `json:"currency,omitempty"`
	BlockchainKey string `json:"blockchain_key,omitempty"`
	Page          int64  `json:"page,omitempty"`
	Limit         int64  `json:"limit,omitempty"`
	State         string `json:"state,omitempty"`
}

type GetEngineParams

type GetEngineParams struct {
	Name string `json:"name"`
}

type Market

type Market struct {
	ID              string `json:"id"`
	Name            string `json:"name"`
	BaseUnit        string `json:"base_unit"`
	QuoteUnit       string `json:"quote_unit"`
	MinPrice        string `json:"min_price"`
	MaxPrice        string `json:"max_price"`
	MinAmount       string `json:"min_amount"`
	AmountPrecision int    `json:"amount_precision"`
	PricePrecision  int    `json:"price_precision"`
	State           string `json:"state"`
	Position        int    `json:"position"`
	EngineID        int    `json:"engine_id"`
	CreatedAt       string `json:"created_at"`
	UpdatedAt       string `json:"updated_at"`
}

type Member

type Member struct {
	UID   string `json:"uid"`
	Email string `json:"email"`
	Level int    `json:"level"`
	Role  string `json:"role"`
	Group string `json:"group"`
	State string `json:"state"`
}

type PaymentAddress

type PaymentAddress struct {
	UID           string   `json:"uid"`
	Address       string   `json:"address"`
	BlockchainKey string   `json:"blockchain_key"`
	Currencies    []string `json:"currencies"`
	State         string   `json:"state"`
	Remote        bool     `json:"remote"`
}

type PerformActionOnWithdrawParams

type PerformActionOnWithdrawParams struct {
	TID    string `json:"tid"`
	Action string `json:"action"`
}

type Settings

type Settings struct {
	URI    string `json:"uri,omitempty"`
	Secret string `json:"secret,omitempty"`
}

type UpdateBlockchainCurrencyParams

type UpdateBlockchainCurrencyParams struct {
	ID                  string            `json:"id"`
	DepositFee          string            `json:"deposit_fee,omitempty"`
	MinDepositAmount    string            `json:"min_deposit_amount,omitempty"`
	MinCollectionAmount string            `json:"min_collection_amount,omitempty"`
	WithdrawFee         string            `json:"withdraw_fee,omitempty"`
	MinWithdrawAmount   string            `json:"min_withdraw_amount,omitempty"`
	DepositEnabled      bool              `json:"deposit_enabled,omitempty"`
	WithdrawEnabled     bool              `json:"withdrawal_enabled,omitempty"`
	Status              string            `json:"status,omitempty"`
	Options             datatypes.JSONMap `json:"options"`
}

type UpdateCurrencyParams

type UpdateCurrencyParams struct {
	ID        string `json:"id"`
	Name      string `json:"name,omitempty"`
	Position  int64  `json:"position,omitempty"`
	Status    string `json:"status,omitempty"`
	Precision int64  `json:"precision,omitempty"`
	IconURL   string `json:"icon_url,omitempty"`
}

type UpdateEngineParams

type UpdateEngineParams struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	Driver string `json:"driver"`
	UID    string `json:"uid"`
	URL    string `json:"url"`
	State  int    `json:"state"`
	Key    string `json:"key"`
	Secret string `json:"secret"`
}

type UpdateMarketParams

type UpdateMarketParams struct {
	ID              string `json:"id"`
	EngineID        string `json:"engine_id,omitempty"`
	MinPrice        string `json:"min_price,omitempty"`
	MaxPrice        string `json:"max_price,omitempty"`
	MinAmount       string `json:"min_amount,omitempty"`
	AmountPrecision int64  `json:"amount_precision,omitempty"`
	PricePrecision  int64  `json:"price_precision,omitempty"`
}

type UpdateWalletParams

type UpdateWalletParams struct {
	ID            string         `json:"id"`
	BlockchainKey string         `json:"blockchain_key,omitempty"`
	Name          string         `json:"name,omitempty"`
	Address       string         `json:"address,omitempty"`
	Gateway       string         `json:"gateway,omitempty"`
	Kind          string         `json:"kind,omitempty"`
	Currencies    pq.StringArray `json:"currencies,omitempty"`
	Settings      Settings       `json:"settings,omitempty" gorm:"embedded;embedded_prefix:set_"`
	MaxBalance    string         `json:"max_balance,omitempty"`
	Status        string         `json:"status,omitempty"`
}

type Wallet

type Wallet struct {
	ID            int                    `json:"id"`
	Name          string                 `json:"name"`
	Kind          string                 `json:"kind"`
	Currencies    []string               `json:"currencies"`
	Address       string                 `json:"address"`
	Gateway       string                 `json:"gateway"`
	MaxBalance    string                 `json:"max_balance"`
	Balance       map[string]interface{} `json:"balance"`
	BlockchainKey string                 `json:"blockchain_key"`
	Status        string                 `json:"status"`
}

type Withdraw

type Withdraw struct {
	TID            string `json:"tid"`
	UID            string `json:"uid"`
	Currency       string `json:"currency"`
	BlockchainKey  string `json:"blockchain_key"`
	Note           string `json:"note"`
	Type           string `json:"type"`
	Amount         string `json:"amount"`
	Fee            string `json:"fee"`
	RID            string `json:"rid"`
	State          string `json:"state"`
	CreatedAt      string `json:"created_at"`
	BlockchainTxID string `json:"blockchain_txid"`
	TransferType   string `json:"transfer_type"`
}

type WithdrawsListParams

type WithdrawsListParams struct {
	UID      string `json:"uid"`
	Currency string `json:"currency"`
	Page     int64  `json:"page,omitempty"`
	Limit    int64  `json:"limit,omitempty"`
	State    string `json:"state,omitempty"`
}

Jump to

Keyboard shortcuts

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