localbitcoins

package
v0.0.0-...-cf2d4bb Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountInfo

type AccountInfo struct {
	Username              string `json:"username"`
	FeedbackScore         int    `json:"feedback_score"`
	FeedbackCount         int    `json:"feedback_count"`
	RealNameVeriTrusted   int    `json:"real_name_verifications_trusted"`
	TradingPartners       int    `json:"trading_partners_count"`
	URL                   string `json:"url"`
	RealNameVeriUntrusted int    `json:"real_name_verifications_untrusted"`
	HasFeedback           bool   `json:"has_feedback"`
	IdentityVerifiedAt    string `json:"identify_verified_at"`
	TrustedCount          int    `json:"trusted_count"`
	FeedbacksUnconfirmed  int    `json:"feedbacks_unconfirmed_count"`
	BlockedCount          int    `json:"blocked_count"`
	TradeVolumeText       string `json:"trade_volume_text"`
	HasCommonTrades       bool   `json:"has_common_trades"`
	RealNameVeriRejected  int    `json:"real_name_verifications_rejected"`
	AgeText               string `json:"age_text"`
	ConfirmedTradesText   string `json:"confirmed_trade_count_text"`
	CreatedAt             string `json:"created_at"`
}

AccountInfo holds public user information

type AdCreate

type AdCreate struct {
	// Required Arguments
	PriceEquation              string `json:"price_equation"`
	Latitude                   int    `json:"lat"`
	Longitude                  int    `json:"lon"`
	City                       string `json:"city"`
	Location                   string `json:"location_string"`
	CountryCode                string `json:"countrycode"`
	Currency                   string `json:"currency"`
	AccountInfo                string `json:"account_info"`
	BankName                   string `json:"bank_name"`
	MSG                        string `json:"msg"`
	SMSVerficationRequired     bool   `json:"sms_verification_required"`
	TrackMaxAmount             bool   `json:"track_max_amount"`
	RequireTrustedByAdvertiser bool   `json:"require_trusted_by_advertiser"`
	RequireIdentification      bool   `json:"require_identification"`
	OnlineProvider             string `json:"online_provider"`
	TradeType                  string `json:"trade_type"`

	// Optional Arguments
	MinAmount          int      `json:"min_amount"`
	MaxAmount          int      `json:"max_amount"`
	OpeningHours       []string `json:"opening_hours"`
	LimitToFiatAmounts string   `json:"limit_to_fiat_amounts"`
	Visible            bool     `json:"visible,int"`

	// Optional Arguments ONLINE_SELL ads
	RequireTradeVolume   int    `json:"require_trade_volume"`
	RequireFeedBackScore int    `json:"require_feedback_score"`
	FirstTimeLimitBTC    int    `json:"first_time_limit_btc"`
	VolumeCoefficientBTC int    `json:"volume_coefficient_btc"`
	ReferenceType        string `json:"reference_type"`
	DisplayReference     bool   `json:"display_reference,int"`

	// Optional Arguments ONLINE_BUY
	PaymentWindowMinutes int `json:"payment_window_minutes"`

	// Optional Arguments LOCAL_SELL
	Floating bool `json:"floating,int"`
}

AdCreate references an outgoing paramater type for CreateAd() method

type AdData

type AdData struct {
	AdList []struct {
		Data struct {
			Visible                    bool        `json:"visible"`
			HiddenByOpeningHours       bool        `json:"hidden_by_opening_hours"`
			Location                   string      `json:"location_string"`
			CountryCode                string      `json:"countrycode"`
			City                       string      `json:"city"`
			TradeType                  string      `json:"trade_type"`
			OnlineProvider             string      `json:"online_provider"`
			FirstTimeLimitBTC          string      `json:"first_time_limit_btc"`
			VolumeCoefficientBTC       string      `json:"volume_coefficient_btc"`
			SMSVerficationRequired     bool        `json:"sms_verification_required"`
			ReferenceType              string      `json:"reference_type"`
			DisplayReference           bool        `json:"display_reference"`
			Currency                   string      `json:"currency"`
			Lat                        float64     `json:"lat"`
			Lon                        float64     `json:"lon"`
			MinAmount                  string      `json:"min_amount"`
			MaxAmount                  string      `json:"max_amount"`
			MaXAmountAvailable         string      `json:"max_amount_available"`
			LimitToFiatAmounts         string      `json:"limit_to_fiat_amounts"`
			AdID                       int64       `json:"ad_id"`
			TempPriceUSD               string      `json:"temp_price_usd"`
			Floating                   bool        `json:"floating"`
			Profile                    interface{} `json:"profile"`
			RequireFeedBackScore       int         `json:"require_feedback_score"`
			RequireTradeVolume         float64     `json:"require_trade_volume"`
			RequireTrustedByAdvertiser bool        `json:"require_trusted_by_advertiser"`
			PaymentWindowMinutes       int         `json:"payment_window_minutes"`
			BankName                   string      `json:"bank_name"`
			TrackMaxAmount             bool        `json:"track_max_amount"`
			ATMModel                   string      `json:"atm_model"`
			PriceEquation              string      `json:"price_equation"`
			OpeningHours               interface{} `json:"opening_hours"`
			AccountInfo                string      `json:"account_info"`
			AccountDetails             interface{} `json:"account_details"`
		} `json:"data"`
		Actions struct {
			PublicView  string `json:"public_view"`
			HTMLEdit    string `json:"html_edit"`
			ChangeForm  string `json:"change_form"`
			ContactForm string `json:"contact_form"`
		} `json:"actions"`
	} `json:"ad_list"`
	AdCount int `json:"ad_count"`
}

AdData references the full possible return of ad data

type AdEdit

type AdEdit struct {
	// Required Arguments
	PriceEquation              string `json:"price_equation"`
	Latitude                   int    `json:"lat"`
	Longitude                  int    `json:"lon"`
	City                       string `json:"city"`
	Location                   string `json:"location_string"`
	CountryCode                string `json:"countrycode"`
	Currency                   string `json:"currency"`
	AccountInfo                string `json:"account_info"`
	BankName                   string `json:"bank_name"`
	MSG                        string `json:"msg"`
	SMSVerficationRequired     bool   `json:"sms_verification_required"`
	TrackMaxAmount             bool   `json:"track_max_amount"`
	RequireTrustedByAdvertiser bool   `json:"require_trusted_by_advertiser"`
	RequireIdentification      bool   `json:"require_identification"`

	// Optional Arguments
	MinAmount          int      `json:"min_amount"`
	MaxAmount          int      `json:"max_amount"`
	OpeningHours       []string `json:"opening_hours"`
	LimitToFiatAmounts string   `json:"limit_to_fiat_amounts"`
	Visible            bool     `json:"visible,int"`

	// Optional Arguments ONLINE_SELL ads
	RequireTradeVolume   int    `json:"require_trade_volume"`
	RequireFeedBackScore int    `json:"require_feedback_score"`
	FirstTimeLimitBTC    int    `json:"first_time_limit_btc"`
	VolumeCoefficientBTC int    `json:"volume_coefficient_btc"`
	ReferenceType        string `json:"reference_type"`
	DisplayReference     bool   `json:"display_reference,int"`

	// Optional Arguments ONLINE_BUY
	PaymentWindowMinutes int `json:"payment_window_minutes"`

	// Optional Arguments LOCAL_SELL
	Floating bool `json:"floating,int"`
}

AdEdit references an outgoing paramater type for EditAd() method

type Balance

type Balance struct {
	Balance  float64 `json:"balance,string"`
	Sendable float64 `json:"Sendable,string"`
}

Balance is a sub-type for WalletInfo & WalletBalanceInfo

type DashBoardInfo

type DashBoardInfo struct {
	Data struct {
		CreatedAt string `json:"created_at"`
		Buyer     struct {
			Username                 string `json:"username"`
			TradeCount               string `json:"trade_count"`
			FeedbackScore            string `json:"feedback_score"`
			Name                     string `json:"name"`
			LastOnline               string `json:"last_online"`
			RealName                 string `json:"real_name"`
			CompanyName              string `json:"company_name"`
			CountryCodeByIP          string `json:"countrycode_by_ip"`
			CountryCodeByPhoneNUmber string `json:"countrycode_by_phone_number"`
		} `json:"buyer"`
		Seller struct {
			Username      string `json:"username"`
			TradeCount    string `json:"trade_count"`
			FeedbackScore string `json:"feedback_score"`
			Name          string `json:"name"`
			LastOnline    string `json:"last_online"`
		} `json:"seller"`
		ReferenceCode         string  `json:"reference_code"`
		Currency              string  `json:"currency"`
		Amount                float64 `json:"amount,string"`
		AmountBTC             float64 `json:"amount_btc,string"`
		FeeBTC                float64 `json:"fee_btc,string"`
		ExchangeRateUpdatedAt string  `json:"exchange_rate_updated_at"`
		Advertisement         struct {
			ID         int    `json:"id"`
			TradeType  string `json:"trade_type"`
			Advertiser struct {
				Username      string `json:"username"`
				TradeCount    string `json:"trade_count"`
				FeedbackScore string `json:"feedback_score"`
				Name          string `json:"name"`
				LastOnline    string `json:"last_online"`
			} `json:"advertiser"`
		} `json:"advertisement"`
		ContactID          int    `json:"contact_id"`
		CanceledAt         string `json:"canceled_at"`
		EscrowedAt         string `json:"escrowed_at"`
		FundedAt           string `json:"funded_at"`
		PaymentCompletedAt string `json:"payment_completed_at"`
		DisputedAt         string `json:"disputed_at"`
		ClosedAt           string `json:"closed_at"`
		ReleasedAt         string `json:"released_at"`
		IsBuying           bool   `json:"is_buying"`
		IsSelling          bool   `json:"is_selling"`
		AccountDetails     struct {
			ReceiverName string `json:"receiver_name"`
			IBAN         string `json:"iban"`
			SwiftBIC     string `json:"swift_bic"`
			Reference    string `json:"reference"`
		} `json:"account_details"`
		AccountInfo string `json:"account_info"`
		Floating    bool   `json:"floating"`
	} `json:"data"`
	Actions struct {
		MarkAsPaidURL           string `json:"mark_as_paid_url"`
		AdvertisementPublicView string `json:"advertisement_public_view"`
		MessageURL              string `json:"message_url"`
		MessagePostURL          string `json:"message_post_url"`
	} `json:"actions"`
}

DashBoardInfo holds the full range of metadata for a dashboard image

type GeneralError

type GeneralError struct {
	Error struct {
		Message   string `json:"message"`
		ErrorCode int    `json:"error_code"`
	} `json:"error"`
}

GeneralError is an error capture type

type Invoice

type Invoice struct {
	Invoice struct {
		Description     string  `json:"description"`
		Created         string  `json:"created"`
		URL             string  `json:"url"`
		Amount          float64 `json:"amount,string"`
		Internal        bool    `json:"internal"`
		Currency        string  `json:"currency"`
		State           string  `json:"state"`
		ID              string  `json:"id"`
		BTCAmount       string  `json:"btc_amount"`
		BTCAddress      string  `json:"btc_address"`
		DeletingAllowed bool    `json:"deleting_allowed"`
	} `json:"invoice"`
}

Invoice contains invoice data

type LocalBitcoins

type LocalBitcoins struct {
	exchange.Base
}

LocalBitcoins is the overarching type across the localbitcoins package

func (*LocalBitcoins) CancelTrade

func (l *LocalBitcoins) CancelTrade(contactID string) error

CancelTrade cancels the trade if the token owner is the Bitcoin buyer. Bitcoin sellers cannot cancel trades.

func (*LocalBitcoins) CheckPincode

func (l *LocalBitcoins) CheckPincode(pin int) (bool, error)

CheckPincode checks the given PIN code against the token owners currently active PIN code. You can use this method to ensure the person using the session is the legitimate user. Due to only requiring the read scope, the user is not guaranteed to have set a PIN code. If you protect your application using this request, please make the user has set a PIN code for his account.

func (*LocalBitcoins) ConfirmRealName

func (l *LocalBitcoins) ConfirmRealName(contactID string) error

ConfirmRealName creates or updates real name confirmation.

func (*LocalBitcoins) CreateAd

func (l *LocalBitcoins) CreateAd(params AdCreate) error

CreateAd creates a new advertisement

params - see localbitcoins_types.go AdCreate for reference

func (*LocalBitcoins) CreateNewInvoice

func (l *LocalBitcoins) CreateNewInvoice(currency, description, returnURL string, amount float64, internal bool) error

CreateNewInvoice creates a new invoice.

func (*LocalBitcoins) DeleteAd

func (l *LocalBitcoins) DeleteAd(adID string) error

DeleteAd deletes the advertisement by adID.

adID - string of specific ad identification

func (*LocalBitcoins) DeleteInvoice

func (l *LocalBitcoins) DeleteInvoice(invoiceID string) (Invoice, error)

DeleteInvoice deletes a specific invoice. Deleting invoices is possible when it is sure that receiver cannot accidentally pay the invoice at the same time as the merchant is deleting it. You can use the API request /api/merchant/invoice/{invoice_id}/ to check if deleting is possible.

func (*LocalBitcoins) Dispute

func (l *LocalBitcoins) Dispute(topic, contactID string) error

Dispute starts a dispute on the specified trade ID if the requirements for starting the dispute has been fulfilled.

topic - [optional] String Short description of issue to LocalBitcoins customer support.

func (*LocalBitcoins) EditAd

func (l *LocalBitcoins) EditAd(params AdEdit, adID string) error

EditAd updates set advertisements

params - see localbitcoins_types.go AdEdit for reference adID - string for the ad you already created

func (*LocalBitcoins) FundTrade

func (l *LocalBitcoins) FundTrade(contactID string) error

FundTrade attempts to fund an unfunded local trade from the token owners wallet. Works only if the token owner is the Bitcoin seller in the trade.

func (*LocalBitcoins) GetAccountInfo

func (l *LocalBitcoins) GetAccountInfo(username string, self bool) (AccountInfo, error)

GetAccountInfo lets you retrieve the public user information on a LocalBitcoins user. The response contains the same information that is found on an account's public profile page.

func (*LocalBitcoins) GetBitcoinsOnlineAd

func (l *LocalBitcoins) GetBitcoinsOnlineAd(countryCode, countryName, paymentMethod string, BuySide bool) error

GetBitcoinsOnlineAd this API returns buy or sell Bitcoin online ads.

func (*LocalBitcoins) GetBitcoinsWithCashAd

func (l *LocalBitcoins) GetBitcoinsWithCashAd(locationID, locationSlug string, BuySide bool) error

GetBitcoinsWithCashAd returns buy or sell as cash local advertisements.

func (*LocalBitcoins) GetCountryCodes

func (l *LocalBitcoins) GetCountryCodes() error

GetCountryCodes returns a list of valid and recognized countrycodes

func (*LocalBitcoins) GetCurrencies

func (l *LocalBitcoins) GetCurrencies() error

GetCurrencies returns a list of valid and recognized fiat currencies. Also contains human readable name for every currency and boolean that tells if currency is an altcoin.

func (*LocalBitcoins) GetDashboardCancelledTrades

func (l *LocalBitcoins) GetDashboardCancelledTrades() (DashBoardInfo, error)

GetDashboardCancelledTrades returns a list of all canceled trades where the token owner is either a buyer or seller.

func (*LocalBitcoins) GetDashboardClosedTrades

func (l *LocalBitcoins) GetDashboardClosedTrades() (DashBoardInfo, error)

GetDashboardClosedTrades returns a list of all closed trades where the token owner is either a buyer or seller.

func (*LocalBitcoins) GetDashboardInfo

func (l *LocalBitcoins) GetDashboardInfo() (DashBoardInfo, error)

GetDashboardInfo returns a list of trades on the data key contact_list. This API end point mirrors the website's dashboard, allowing access to contacts in different states. In addition all of these listings have buyer/ and seller/ sub-listings to view contacts where the token owner is either buying or selling, respectively. E.g. /api/dashboard/buyer/. All contacts where the token owner is participating are returned.

func (*LocalBitcoins) GetDashboardReleasedTrades

func (l *LocalBitcoins) GetDashboardReleasedTrades() (DashBoardInfo, error)

GetDashboardReleasedTrades returns a list of all released trades where the token owner is either a buyer or seller.

func (*LocalBitcoins) GetExchangeAccountInfo

func (l *LocalBitcoins) GetExchangeAccountInfo() (exchange.AccountInfo, error)

GetExchangeAccountInfo retrieves balances for all enabled currencies for the LocalBitcoins exchange

func (*LocalBitcoins) GetFee

func (l *LocalBitcoins) GetFee(maker bool) float64

GetFee returns the fee for maker or taker

func (*LocalBitcoins) GetInvoice

func (l *LocalBitcoins) GetInvoice(invoiceID string) (Invoice, error)

GetInvoice returns information about a specific invoice created by the token owner.

func (*LocalBitcoins) GetMessages

func (l *LocalBitcoins) GetMessages(contactID string) (Message, error)

GetMessages returns all chat messages from the trade. Messages are on the message_list key.

func (*LocalBitcoins) GetNotifications

func (l *LocalBitcoins) GetNotifications() ([]NotificationInfo, error)

GetNotifications returns recent notifications.

func (*LocalBitcoins) GetOrderbook

func (l *LocalBitcoins) GetOrderbook(currency string) (Orderbook, error)

GetOrderbook returns buy and sell bitcoin online advertisements. Amount is the maximum amount available for the trade request. Price is the hourly updated price. The price is based on the price equation and commission % entered by the ad author.

func (*LocalBitcoins) GetOrderbookEx

func (l *LocalBitcoins) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error)

GetOrderbookEx returns orderbook base on the currency pair

func (*LocalBitcoins) GetPaymentMethods

func (l *LocalBitcoins) GetPaymentMethods() error

GetPaymentMethods returns a list of valid payment methods. Also contains name and code for payment methods, and possible limitations in currencies and bank name choices.

func (*LocalBitcoins) GetPaymentMethodsByCountry

func (l *LocalBitcoins) GetPaymentMethodsByCountry(countryCode string) error

GetPaymentMethodsByCountry returns a list of valid payment methods filtered by countrycodes.

func (*LocalBitcoins) GetPlaces

func (l *LocalBitcoins) GetPlaces(lat, lon int, location, countryCode string) error

GetPlaces Looks up places near lat, lon and provides full URLs to buy and sell listings for each.

func (*LocalBitcoins) GetRecentMessages

func (l *LocalBitcoins) GetRecentMessages(after string) error

GetRecentMessages returns maximum of 25 newest trade messages. Does not return messages older than one month. Messages are ordered by sending time, and the newest one is first.

func (*LocalBitcoins) GetTicker

func (l *LocalBitcoins) GetTicker() (map[string]Ticker, error)

GetTicker returns list of all completed trades.

func (*LocalBitcoins) GetTickerPrice

func (l *LocalBitcoins) GetTickerPrice(p pair.CurrencyPair, assetType string) (ticker.Price, error)

GetTickerPrice returns the ticker for a currency pair

func (*LocalBitcoins) GetTradeInfo

func (l *LocalBitcoins) GetTradeInfo(contactID string) error

GetTradeInfo returns information about a single trade that the token owner is part in.

func (*LocalBitcoins) GetTrades

func (l *LocalBitcoins) GetTrades(currency string, values url.Values) ([]Trade, error)

GetTrades returns all closed trades in online buy and online sell categories, updated every 15 minutes.

func (*LocalBitcoins) GetWalletAddress

func (l *LocalBitcoins) GetWalletAddress() (string, error)

GetWalletAddress returns an unused receiving address from the token owner's wallet. The address is returned in the address key of the response. Note that this API may keep returning the same (unused) address if requested repeatedly.

func (*LocalBitcoins) GetWalletBalance

func (l *LocalBitcoins) GetWalletBalance() (WalletBalanceInfo, error)

GetWalletBalance Same as GetWalletInfo(), but only returns the message, receiving_address and total fields. Use this instead if you don't care about transactions at the moment.

func (*LocalBitcoins) GetWalletInfo

func (l *LocalBitcoins) GetWalletInfo() (WalletInfo, error)

GetWalletInfo gets information about the token owner's wallet balance.

func (*LocalBitcoins) Getads

func (l *LocalBitcoins) Getads(adID string) (AdData, error)

Getads returns information of single advertisement based on the ad ID, if adID ommited.

adID - [optional] string if ommited returns all ads

func (*LocalBitcoins) InitiateTrade

func (l *LocalBitcoins) InitiateTrade(amount int, message, adID string) error

InitiateTrade sttempts to start a Bitcoin trade from the specified advertisement ID.

func (*LocalBitcoins) Logout

func (l *LocalBitcoins) Logout() error

Logout expires the current access token immediately. To get a new token afterwards, public apps will need to re-authenticate, confidential apps can turn in a refresh token.

func (*LocalBitcoins) MarkAsPaid

func (l *LocalBitcoins) MarkAsPaid(contactID string) error

MarkAsPaid marks a trade as paid.

func (*LocalBitcoins) MarkNotifications

func (l *LocalBitcoins) MarkNotifications(notificationID string) error

MarkNotifications marks a specific notification as read.

func (*LocalBitcoins) ReleaseFunds

func (l *LocalBitcoins) ReleaseFunds(contactID string) error

ReleaseFunds releases Bitcoin trades specified by ID {contact_id}. If the release was successful a message is returned on the data key.

func (*LocalBitcoins) ReleaseFundsByPin

func (l *LocalBitcoins) ReleaseFundsByPin(pin int, contactID string) error

ReleaseFundsByPin releases Bitcoin trades specified by ID {contact_id}. if the current pincode is provided. If the release was successful a message is returned on the data key.

func (*LocalBitcoins) Run

func (l *LocalBitcoins) Run()

Run implements the LocalBitcoins wrapper

func (*LocalBitcoins) SendAuthenticatedHTTPRequest

func (l *LocalBitcoins) SendAuthenticatedHTTPRequest(method, path string, values url.Values, result interface{}) (err error)

SendAuthenticatedHTTPRequest sends an authenticated HTTP request to localbitcoins

func (*LocalBitcoins) SendMessage

func (l *LocalBitcoins) SendMessage(msg, contactID string) error

SendMessage posts a message and/or uploads an image to the trade. Encode images with multipart/form-data encoding.

func (*LocalBitcoins) SetDefaults

func (l *LocalBitcoins) SetDefaults()

SetDefaults sets the package defaults for localbitcoins

func (*LocalBitcoins) SetFeedback

func (l *LocalBitcoins) SetFeedback(msg, feedback, username string) error

SetFeedback gives feedback to user. Possible feedback values are: trust, positive, neutral, block, block_without_feedback, (check const values) This is only possible to set if there is a trade between the token owner and the user specified in {username} that is canceled or released. You may also set feedback message using msg field with few exceptions. Feedback block_without_feedback clears the message and with block the message is mandatory.

feedback - string (use const valuesfor feedback) msg - [optional] Feedback message displayed alongside feedback on receivers profile page. username - username of trade contact

func (*LocalBitcoins) Setup

func (l *LocalBitcoins) Setup(exch config.ExchangeConfig)

Setup sets exchange configuration parameters

func (*LocalBitcoins) Start

func (l *LocalBitcoins) Start()

Start starts the LocalBitcoins go routine

func (*LocalBitcoins) UpdateOrderbook

func (l *LocalBitcoins) UpdateOrderbook(p pair.CurrencyPair, assetType string) (orderbook.Base, error)

UpdateOrderbook updates and returns the orderbook for a currency pair

func (*LocalBitcoins) UpdatePriceEquation

func (l *LocalBitcoins) UpdatePriceEquation(equation, adID string) error

UpdatePriceEquation updates price equation of an advertisement. If there are problems with new equation, the price and equation are not updated and advertisement remains visible.

equation - string of equation adID - string of specific ad identification

func (*LocalBitcoins) UpdateTicker

func (l *LocalBitcoins) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Price, error)

UpdateTicker updates and returns the ticker for a currency pair

func (*LocalBitcoins) VerifyIdentity

func (l *LocalBitcoins) VerifyIdentity(contactID string) error

VerifyIdentity marks the identity of trade partner as verified. You must be the advertiser in this trade.

func (*LocalBitcoins) VerifyUsername

func (l *LocalBitcoins) VerifyUsername() error

VerifyUsername returns list of real name verifiers for the user. Returns a list only when you have a trade with the user where you are the seller.

func (*LocalBitcoins) WalletSend

func (l *LocalBitcoins) WalletSend(address string, amount float64, pin int) (bool, error)

WalletSend sends amount of bitcoins from the token owner's wallet to address. On success, the response returns a message indicating success. It is highly recommended to minimize the lifetime of access tokens with the money permission. Use Logout() to make the current token expire instantly.

type Message

type Message struct {
	MSG    string `json:"msg"`
	Sender struct {
		ID         int64  `json:"id"`
		Name       string `json:"name"`
		Username   string `json:"username"`
		TradeCount int64  `json:"trafe_count"`
		LastOnline string `json:"last_online"`
	} `json:"sender"`
	CreatedAt      string `json:"created_at"`
	IsAdmin        bool   `json:"is_admin"`
	AttachmentName string `json:"attachment_name"`
	AttachmentType string `json:"attachment_type"`
	AttachmentURL  string `json:"attachment_url"`
}

Message holds the returned message data from a contact

type NotificationInfo

type NotificationInfo struct {
	URL       string `json:"url"`
	CreatedAt string `json:"created_at"`
	ContactID int64  `json:"contact_id"`
	Read      bool   `json:"read"`
	MSG       string `json:"msg"`
	ID        string `json:"id"`
}

NotificationInfo holds Notification data

type Orderbook

type Orderbook struct {
	Bids []Price `json:"bids"`
	Asks []Price `json:"asks"`
}

Orderbook is a full range of bid and asks for localbitcoins

type Price

type Price struct {
	Price  float64
	Amount float64
}

Price is a sub-type for orderbook

type Ticker

type Ticker struct {
	Avg12h float64 `json:"avg_12h,string"`
	Avg1h  float64 `json:"avg_1h,string"`
	Avg24h float64 `json:"avg_24h,string"`
	Rates  struct {
		Last float64 `json:"last,string"`
	} `json:"rates"`
	VolumeBTC float64 `json:"volume_btc,string"`
}

Ticker contains ticker information

type Trade

type Trade struct {
	TID    int64   `json:"tid"`
	Date   int64   `json:"date"`
	Amount float64 `json:"amount,string"`
	Price  float64 `json:"price,string"`
}

Trade holds closed trade information

type WalletAddressList

type WalletAddressList struct {
	Address  string  `json:"address"`
	Received float64 `json:"received,string"`
}

WalletAddressList is a sub-type for WalletInfo & WalletBalanceInfo

type WalletBalanceInfo

type WalletBalanceInfo struct {
	Message               string              `json:"message"`
	Total                 Balance             `json:"total"`
	ReceivingAddressCount int                 `json:"receiving_address_count"` // always 1
	ReceivingAddressList  []WalletAddressList `json:"receiving_address_list"`
}

WalletBalanceInfo standard wallet balance information

type WalletInfo

type WalletInfo struct {
	Message                 string              `json:"message"`
	Total                   Balance             `json:"total"`
	SentTransactions30d     []WalletTransaction `json:"sent_transactions_30d"`
	ReceivedTransactions30d []WalletTransaction `json:"received_transactions_30d"`
	ReceivingAddressCount   int                 `json:"receiving_address_count"`
	ReceivingAddressList    []WalletAddressList `json:"receiving_address_list"`
}

WalletInfo holds full wallet information data

type WalletTransaction

type WalletTransaction struct {
	TXID        string    `json:"txid"`
	Amount      float64   `json:"amount,string"`
	Description string    `json:"description"`
	TXType      int       `json:"tx_type"`
	CreatedAt   time.Time `json:"created_at"`
}

WalletTransaction is a sub-type for WalletInfo

Jump to

Keyboard shortcuts

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