Documentation
¶
Index ¶
- Variables
- func CacheExpires(r *http.Response) time.Time
- type APIClient
- type APIError
- type APIKey
- type APIResponse
- type APIResult
- type AddressApiService
- type BalanceResp
- type BalanceRespCoins
- type BuyTokenLimitBody
- type BuyTokenMarketBody
- type BuyTokenMarketResult
- type Configuration
- type DepositAddressesResp
- type DepositAddressesRespAddresses
- type GeneralErrorResponse
- type GeneralErrorResponseError
- type GeneralErrorResponseResult
- type GenericSwaggerError
- type LoanHistoryResp
- type LoanHistoryRespEvents
- type OrderBookResp
- type OrderBookRespSell
- type OrderIdResp
- type OtherApiGetBalanceOpts
- type OtherApiGetLoanHistoryOpts
- type OtherApiGetSwapHistoryOpts
- type OtherApiGetTmLimitHistoryOpts
- type OtherApiGetTmMarketHistoryOpts
- type OtherApiGetWalletHistoryOpts
- type OtherApiService
- func (a *OtherApiService) BuyTokenMarket(ctx context.Context, body BuyTokenMarketBody) (BuyTokenMarketResult, *http.Response, error)
- func (a *OtherApiService) GetBalance(ctx context.Context, localVarOptionals *OtherApiGetBalanceOpts) (BalanceResp, *http.Response, error)
- func (a *OtherApiService) GetLoanHistory(ctx context.Context, localVarOptionals *OtherApiGetLoanHistoryOpts) (LoanHistoryResp, *http.Response, error)
- func (a *OtherApiService) GetSwapHistory(ctx context.Context, localVarOptionals *OtherApiGetSwapHistoryOpts) (SwapHistoryResp, *http.Response, error)
- func (a *OtherApiService) GetTmLimitHistory(ctx context.Context, localVarOptionals *OtherApiGetTmLimitHistoryOpts) (TmHistoryResp, *http.Response, error)
- func (a *OtherApiService) GetTmMarketHistory(ctx context.Context, localVarOptionals *OtherApiGetTmMarketHistoryOpts) (TmHistoryResp, *http.Response, error)
- func (a *OtherApiService) GetWalletHistory(ctx context.Context, localVarOptionals *OtherApiGetWalletHistoryOpts) (WalletHistoryResp, *http.Response, error)
- func (a *OtherApiService) SellTokenMarket(ctx context.Context, body SellTokenMarketBody) (SellTokenMarketResult, *http.Response, error)
- type SellTokenLimitBody
- type SellTokenMarketBody
- type SellTokenMarketResult
- type StartWithdrawBody
- type StartWithdrawResp
- type SwapHistoryResp
- type SwapHistoryRespEvents
- type TmHistoryResp
- type TmHistoryRespEvents
- type TokenmarketApiService
- func (a *TokenmarketApiService) BuyTokenLimit(ctx context.Context, body BuyTokenLimitBody) (OrderIdResp, *http.Response, error)
- func (a *TokenmarketApiService) GetTokenMarket(ctx context.Context, pair string) (OrderBookResp, *http.Response, error)
- func (a *TokenmarketApiService) SellTokenLimit(ctx context.Context, body SellTokenLimitBody) (OrderIdResp, *http.Response, error)
- type WalletHistoryResp
- type WalletHistoryRespEvents
- type WithdrawApiService
- type WithdrawDetailsResp
- type WithdrawDetailsRespAddresses
- type WithdrawDetailsRespChains
- type WithdrawDetailsRespFeeInfo
Constants ¶
This section is empty.
Variables ¶
var (
// ContextAPIKey takes an APIKey as authentication for the request
ContextAPIKey = contextKey("apikey")
)
Functions ¶
Types ¶
type APIClient ¶
type APIClient struct {
AddressApi *AddressApiService
OtherApi *OtherApiService
TokenmarketApi *TokenmarketApiService
WithdrawApi *WithdrawApiService
// contains filtered or unexported fields
}
APIClient manages communication with the INLOCK API API v1.4.5 In most cases there should be only one, shared, APIClient.
func NewAPIClient ¶
func NewAPIClient(cfg *Configuration) *APIClient
NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.
func (*APIClient) ChangeBasePath ¶
Change base path to allow switching to mocks
type APIKey ¶
APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIResponse ¶
type APIResult ¶
type APIResult struct {
Status string `json:"status"`
ResponseData map[string]json.RawMessage
}
func (*APIResult) UnmarshalJSON ¶
type AddressApiService ¶
type AddressApiService service
func (*AddressApiService) GetWithdrawDetails ¶
func (a *AddressApiService) GetWithdrawDetails(ctx context.Context, ticker string) (WithdrawDetailsResp, *http.Response, error)
AddressApiService Returns the data necessary for managing user wallet withdrawals.:tag address
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param ticker Ticker of the coin.
@return WithdrawDetailsResp
func (*AddressApiService) ListDepositAddresses ¶
func (a *AddressApiService) ListDepositAddresses(ctx context.Context, ticker string) (DepositAddressesResp, *http.Response, error)
AddressApiService Returns the deposit addresses of the user for the given coin ID.:tag address
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param ticker Tickoer of the coin.
@return DepositAddressesResp
type BalanceResp ¶
type BalanceResp struct {
// fiat values calculated in this currency (default: usd)
Fiat string `json:"fiat,omitempty"`
// total available balance in fiat.
Total string `json:"total,omitempty"`
// sum pending interest in fiat.
AccruingInterestFiat string `json:"accruing_interest_fiat,omitempty"`
// sum of total interest earned in fiat.
TotalInterestEarnedFiat string `json:"total_interest_earned_fiat,omitempty"`
// List of detailed balance entries per coins
Coins []BalanceRespCoins `json:"coins,omitempty"`
}
type BalanceRespCoins ¶
type BalanceRespCoins struct {
// ticker of coin of the balance
Ticker string `json:"ticker,omitempty"`
// amount of available balance in normal format
Balance string `json:"balance,omitempty"`
// amount of pending balance (deposit under confirming or pending withdrawal)
Pending string `json:"pending,omitempty"`
// locked amount (defined for further functions, but not used in INLOCK WL)
Locked string `json:"locked,omitempty"`
// pending interest. (in kind)
AccruingInterest string `json:"accruing_interest,omitempty"`
// amount of interest credited since onboarding. (in kind)
TotalInterestEarned string `json:"total_interest_earned,omitempty"`
// amount of available in fiat
BalanceFiat string `json:"balance_fiat,omitempty"`
// amount of pending balance in fiat
PendingFiat string `json:"pending_fiat,omitempty"`
// locked amount in fiat
LockedFiat string `json:"locked_fiat,omitempty"`
// pending interest in fiat
AccruingInterestFiat string `json:"accruing_interest_fiat,omitempty"`
// amount of interest credited since onboarding in fiat
TotalInterestEarnedFiat string `json:"total_interest_earned_fiat,omitempty"`
}
type BuyTokenLimitBody ¶
type BuyTokenMarketBody ¶
type BuyTokenMarketBody struct {
// Amount to buy.
Amount string `json:"amount"`
// Trading pair of the market e.g.: XBTILK.
Pair string `json:"pair"`
// Limit of cost. Spend at most limit amount.
Limit string `json:"limit,omitempty"`
// Limit of price. The average price of the buy order is capped at this value. limit and limit_price can not be specified at the same time.
LimitPrice string `json:"limit_price,omitempty"`
}
type BuyTokenMarketResult ¶
type Configuration ¶
type Configuration struct {
BasePath string `json:"basePath,omitempty"`
Host string `json:"host,omitempty"`
Scheme string `json:"scheme,omitempty"`
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
UserAgent string `json:"userAgent,omitempty"`
HTTPClient *http.Client
}
func NewConfiguration ¶
func NewConfiguration() *Configuration
func (*Configuration) AddDefaultHeader ¶
func (c *Configuration) AddDefaultHeader(key string, value string)
type DepositAddressesResp ¶
type DepositAddressesResp struct {
// addresses of the user
Addresses []DepositAddressesRespAddresses `json:"addresses,omitempty"`
}
type DepositAddressesRespAddresses ¶
type DepositAddressesRespAddresses struct {
// ticker of coin
Ticker string `json:"ticker,omitempty"`
// chain identifier. Possible results: native, bep2, bep20, erc20, trc20, omni, sol, cardano
Network string `json:"network,omitempty"`
// is this address is primary for coin? Only native chain's address can be primary
Primary bool `json:"primary,omitempty"`
// address for coin deposits on chain
Address string `json:"address,omitempty"`
// additional memo for deposits (only valid on bep2 network)
Memo string `json:"memo,omitempty"`
}
type GeneralErrorResponse ¶
type GeneralErrorResponse struct {
Result *GeneralErrorResponseResult `json:"result,omitempty"`
Error_ *GeneralErrorResponseError `json:"error,omitempty"`
}
type GeneralErrorResponseResult ¶
type GeneralErrorResponseResult struct {
Status string `json:"status,omitempty"`
ENDPOINT *interface{} `json:"ENDPOINT,omitempty"`
}
type GenericSwaggerError ¶
type GenericSwaggerError struct {
// contains filtered or unexported fields
}
GenericSwaggerError Provides access to the body, error and model on returned errors.
func (GenericSwaggerError) Body ¶
func (e GenericSwaggerError) Body() []byte
Body returns the raw bytes of the response
func (GenericSwaggerError) Error ¶
func (e GenericSwaggerError) Error() string
Error returns non-empty string if there was an error.
func (GenericSwaggerError) Model ¶
func (e GenericSwaggerError) Model() interface{}
Model returns the unpacked model of the error
type LoanHistoryResp ¶
type LoanHistoryResp struct {
// List of event records.
Events []LoanHistoryRespEvents `json:"events,omitempty"`
}
type LoanHistoryRespEvents ¶
type LoanHistoryRespEvents struct {
// Unique ID of the event.
EvId int64 `json:"ev_id,omitempty"`
// Time of creation. Unix timestamp in UTC.
Created int64 `json:"created,omitempty"`
// Type of event.
Type_ string `json:"type,omitempty"`
// Amount related to the event. Optional, can be null.
Amt string `json:"amt,omitempty"`
// Ticker related to the event. Optional, can be null.
Ticker string `json:"ticker,omitempty"`
}
type OrderBookResp ¶
type OrderBookResp struct {
// Market e.g.: 'XBTILK'
Market string `json:"market,omitempty"`
// Sell items
Sell []OrderBookRespSell `json:"sell,omitempty"`
// Buy items
Buy []OrderBookRespSell `json:"buy,omitempty"`
}
type OrderBookRespSell ¶
type OrderIdResp ¶
type OrderIdResp struct {
// ID of the order
Orderid int64 `json:"orderid,omitempty"`
}
type OtherApiGetBalanceOpts ¶
type OtherApiService ¶
type OtherApiService service
func (*OtherApiService) BuyTokenMarket ¶
func (a *OtherApiService) BuyTokenMarket(ctx context.Context, body BuyTokenMarketBody) (BuyTokenMarketResult, *http.Response, error)
OtherApiService Buy token on INLOCK Tokenmarket (market order, instant fulfilled or revert).
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param body
@return BuyTokenMarketResult
func (*OtherApiService) GetBalance ¶
func (a *OtherApiService) GetBalance(ctx context.Context, localVarOptionals *OtherApiGetBalanceOpts) (BalanceResp, *http.Response, error)
func (*OtherApiService) GetLoanHistory ¶
func (a *OtherApiService) GetLoanHistory(ctx context.Context, localVarOptionals *OtherApiGetLoanHistoryOpts) (LoanHistoryResp, *http.Response, error)
func (*OtherApiService) GetSwapHistory ¶
func (a *OtherApiService) GetSwapHistory(ctx context.Context, localVarOptionals *OtherApiGetSwapHistoryOpts) (SwapHistoryResp, *http.Response, error)
func (*OtherApiService) GetTmLimitHistory ¶
func (a *OtherApiService) GetTmLimitHistory(ctx context.Context, localVarOptionals *OtherApiGetTmLimitHistoryOpts) (TmHistoryResp, *http.Response, error)
func (*OtherApiService) GetTmMarketHistory ¶
func (a *OtherApiService) GetTmMarketHistory(ctx context.Context, localVarOptionals *OtherApiGetTmMarketHistoryOpts) (TmHistoryResp, *http.Response, error)
func (*OtherApiService) GetWalletHistory ¶
func (a *OtherApiService) GetWalletHistory(ctx context.Context, localVarOptionals *OtherApiGetWalletHistoryOpts) (WalletHistoryResp, *http.Response, error)
func (*OtherApiService) SellTokenMarket ¶
func (a *OtherApiService) SellTokenMarket(ctx context.Context, body SellTokenMarketBody) (SellTokenMarketResult, *http.Response, error)
OtherApiService Sell token on INLOCK Tokenmarket (market order, instantly fulfilled or reverted).
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param body
@return SellTokenMarketResult
type SellTokenLimitBody ¶
type SellTokenMarketBody ¶
type SellTokenMarketResult ¶
type StartWithdrawBody ¶
type StartWithdrawResp ¶
type StartWithdrawResp struct {
// Request ID.
ReqId int64 `json:"req_id,omitempty"`
}
type SwapHistoryResp ¶
type SwapHistoryResp struct {
// List of event records.
Events []SwapHistoryRespEvents `json:"events,omitempty"`
}
type SwapHistoryRespEvents ¶
type SwapHistoryRespEvents struct {
// Unique ID of event.
EvId int64 `json:"ev_id,omitempty"`
// Time of creation. Unix timestamp in UTC.
Created int64 `json:"created,omitempty"`
// Type of event.
Type_ string `json:"type,omitempty"`
// From amount.
FromAmt string `json:"from_amt,omitempty"`
// From ticker.
FromTicker string `json:"from_ticker,omitempty"`
// To ticker.
ToTicker string `json:"to_ticker,omitempty"`
// Price.
Price string `json:"price,omitempty"`
// To amount.
ToAmt string `json:"to_amt,omitempty"`
// From coin is the primary (e.g. for price display) or the to coin.
FromPrimary bool `json:"from_primary,omitempty"`
}
type TmHistoryResp ¶
type TmHistoryResp struct {
// List of event records.
Events []TmHistoryRespEvents `json:"events,omitempty"`
}
type TmHistoryRespEvents ¶
type TmHistoryRespEvents struct {
// Unique ID of the event.
EvId int64 `json:"ev_id,omitempty"`
// Time of creation. Unix timestamp in UTC.
Created int64 `json:"created,omitempty"`
// Type of event.
Type_ string `json:"type,omitempty"`
// Amount of ILK bought/sold.
Amt string `json:"amt,omitempty"`
// Cost of buy/sell.
Cost string `json:"cost,omitempty"`
// Ticker of cost.
Ticker string `json:"ticker,omitempty"`
}
type TokenmarketApiService ¶
type TokenmarketApiService service
func (*TokenmarketApiService) BuyTokenLimit ¶
func (a *TokenmarketApiService) BuyTokenLimit(ctx context.Context, body BuyTokenLimitBody) (OrderIdResp, *http.Response, error)
TokenmarketApiService Buy token:tag _tokenmarket
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param body
@return OrderIdResp
func (*TokenmarketApiService) GetTokenMarket ¶
func (a *TokenmarketApiService) GetTokenMarket(ctx context.Context, pair string) (OrderBookResp, *http.Response, error)
TokenmarketApiService Returns all of the orderbook for the given trading pair:tag _tokenmarket
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param pair
@return OrderBookResp
func (*TokenmarketApiService) SellTokenLimit ¶
func (a *TokenmarketApiService) SellTokenLimit(ctx context.Context, body SellTokenLimitBody) (OrderIdResp, *http.Response, error)
TokenmarketApiService Sell token:tag _tokenmarket
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param body
@return OrderIdResp
type WalletHistoryResp ¶
type WalletHistoryResp struct {
// List of event records.
Events []WalletHistoryRespEvents `json:"events,omitempty"`
}
type WalletHistoryRespEvents ¶
type WalletHistoryRespEvents struct {
// Unique ID of the event.
EvId int64 `json:"ev_id,omitempty"`
// Time of creation. Unix timestamp in UTC.
Created int64 `json:"created,omitempty"`
// Type of event.
Type_ string `json:"type,omitempty"`
// Status of withdraw events.
Status string `json:"status,omitempty"`
// Amount related to the event. Optional, can be null.
Amt string `json:"amt,omitempty"`
// Ticker related to the event. Optional, can be null.
Ticker string `json:"ticker,omitempty"`
// Shows the sender of the transfer. Optional, only used in internal/badge transfers
FromUser string `json:"from_user,omitempty"`
// Shows the receiver of the transfer. Optional, only used in internal/badge transfers
ToUser string `json:"to_user,omitempty"`
// Second amount related to the event. Optional, can be null.
Amt2 string `json:"amt2,omitempty"`
// Second ticker related to the event. Optional, can be null.
Ticker2 string `json:"ticker2,omitempty"`
// Third amount related to the event. Optional, can be null.
Amt3 string `json:"amt3,omitempty"`
// Description related to the event. Can be null.
Desc string `json:"desc,omitempty"`
}
type WithdrawApiService ¶
type WithdrawApiService service
func (*WithdrawApiService) StartWithdraw ¶
func (a *WithdrawApiService) StartWithdraw(ctx context.Context, body StartWithdrawBody) (StartWithdrawResp, *http.Response, error)
WithdrawApiService Requests a new withdrawal from user balance.:tag withdraw
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param body
@return StartWithdrawResp
type WithdrawDetailsResp ¶
type WithdrawDetailsResp struct {
// List of withdraw details for each supported chain.
Chains []WithdrawDetailsRespChains `json:"chains,omitempty"`
}
type WithdrawDetailsRespAddresses ¶
type WithdrawDetailsRespAddresses struct {
// Address
Address string `json:"address,omitempty"`
// User defined description.
Description string `json:"description,omitempty"`
// Memo
Memo string `json:"memo,omitempty"`
// timestamp if the withdraw address is locked
LockedUntil int64 `json:"locked_until,omitempty"`
}
type WithdrawDetailsRespChains ¶
type WithdrawDetailsRespChains struct {
// Ticker of the coin
Ticker string `json:"ticker,omitempty"`
// Chain identifier
Network string `json:"network,omitempty"`
// Short name of chain
ChainShortName string `json:"chain_short_name,omitempty"`
// Long name of chain
ChainLongName string `json:"chain_long_name,omitempty"`
// True if this is the recommended, primary (native) chain for withdraw, false otherwise.
IsPrimary bool `json:"is_primary,omitempty"`
// Withdraw addresses of the user.
Addresses []WithdrawDetailsRespAddresses `json:"addresses,omitempty"`
// Minimal withdraw amount.
MinAmt string `json:"min_amt,omitempty"`
// Fix withdraw fee in the same coin.
FeeBase string `json:"fee_base,omitempty"`
// Fee multiplier in the same coin (fee = fee_base + amount * fee_mult).
FeeMult string `json:"fee_mult,omitempty"`
FeeInfo *WithdrawDetailsRespFeeInfo `json:"fee_info,omitempty"`
// Congestion status of the network: \"no\", \"slight\", \"significant\", \"heavy\", \"disabled\".
Congestion string `json:"congestion,omitempty"`
}
type WithdrawDetailsRespFeeInfo ¶
type WithdrawDetailsRespFeeInfo struct {
// True if this withdraw will be free by zero withdraw fee, otherwise false
FreeWithdraw bool `json:"free_withdraw,omitempty"`
// True if this withdraws fee will be waived, otherwise false
WaivedWithdraw bool `json:"waived_withdraw,omitempty"`
// monthly total waived withdrawal fees
TotalWaives int64 `json:"total_waives,omitempty"`
// already used monthly waived fees on withdrawals
UsedWaives int64 `json:"used_waives,omitempty"`
// source of waived fees (should be: \"ilkbalance\",\"badge\",\"gift\",\"other\" or None.)
Reason string `json:"reason,omitempty"`
}
Info about free withdrawals.
Source Files
¶
- api_address.go
- api_other.go
- api_tokenmarket.go
- api_withdraw.go
- client.go
- configuration.go
- model_balance_resp.go
- model_balance_resp_coins.go
- model_buy_token_market_result.go
- model_deposit_addresses_resp.go
- model_deposit_addresses_resp_addresses.go
- model_general_error_response.go
- model_general_error_response_error.go
- model_general_error_response_result.go
- model_loan_history_resp.go
- model_loan_history_resp_events.go
- model_order_book_retail_resp.go
- model_order_book_retail_resp_sell.go
- model_order_id_resp.go
- model_retail_buy_token_limit_body.go
- model_retail_buy_token_market_body.go
- model_retail_sell_token_limit_body.go
- model_retail_sell_token_market_body.go
- model_retail_start_withdraw_body.go
- model_sell_token_market_result.go
- model_start_withdraw_resp.go
- model_swap_history_resp.go
- model_swap_history_resp_events.go
- model_tm_history_resp.go
- model_tm_history_resp_events.go
- model_wallet_history_resp.go
- model_wallet_history_resp_events.go
- model_withdraw_details_retail_resp.go
- model_withdraw_details_retail_resp_addresses.go
- model_withdraw_details_retail_resp_chains.go
- model_withdraw_details_retail_resp_fee_info.go
- response.go