coinbase

package module
v0.0.0-...-9558b3a Latest Latest
Warning

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

Go to latest
Published: May 30, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

README

Golang client for Coinbase V2 API

This client implements all Coinbase v2 API endpoints.

It works with API Keys authentication.

Installation

go get github.com/AlessandroSechi/go-coinbase

Initialization

import "github.com/AlessandroSechi/go-coinbase"

// Create a new client
c := NewClient("<API Key>", "<API Secret>")

Get current user’s public information

user, err := c.GetUser(context.TODO())

Lists current user’s accounts to which the authentication method has access to.

// pagination contains data about pagination https://developers.coinbase.com/api/v2#pagination
accounts, pagination, err := c.ListAccounts(context.TODO())

Documentation

Index

Constants

View Source
const (
	APIBase = "https://api.coinbase.com/v2"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID           string    `json:"id,omitempty"`
	Name         string    `json:"name,omitempty"`
	Primary      bool      `json:"primary,omitempty"`
	Type         string    `json:"type,omitempty"`
	Currency     string    `json:"currency,omitempty"`
	Balance      string    `json:"balance,omitempty"`
	CreatedAt    time.Time `json:"created_at,omitempty"`
	UpdatedAt    time.Time `json:"updated_at,omitempty"`
	Resource     string    `json:"resource,omitempty"`
	ResourcePath string    `json:"resource_path,omitempty"`
}

type Address

type Address struct {
	ID           string    `json:"id,omitempty"`
	Address      string    `json:"address,omitempty"`
	Name         string    `json:"name,omitempty"`
	Network      string    `json:"network,omitempty"`
	CreatedAt    time.Time `json:"created_at,omitempty"`
	UpdatedAt    time.Time `json:"updated_at,omitempty"`
	Resource     string    `json:"resource,omitempty"`
	ResourcePath string    `json:"resource_path,omitempty"`
}

type Buy

type Buy struct {
	ID            string `json:"id,omitempty"`
	Status        string `json:"status,omitempty"`
	PaymentMethod struct {
		ID           string `json:"id,omitempty"`
		Resource     string `json:"resource,omitempty"`
		ResourcePath string `json:"resource_path,omitempty"`
	} `json:"payment_method,omitempty"`
	Transaction struct {
		ID           string `json:"id,omitempty"`
		Resource     string `json:"resource,omitempty"`
		ResourcePath string `json:"resource_path,omitempty"`
	} `json:"transaction,omitempty"`
	Amount struct {
		Amount   string `json:"amount,omitempty"`
		Currency string `json:"currency,omitempty"`
	} `json:"amount,omitempty"`
	Total struct {
		Amount   string `json:"amount,omitempty"`
		Currency string `json:"currency,omitempty"`
	} `json:"total,omitempty"`
	SubTotal struct {
		Amount   string `json:"amount,omitempty"`
		Currency string `json:"currency,omitempty"`
	} `json:"subtotal,omitempty"`
	Fee struct {
		Amount   string `json:"amount,omitempty"`
		Currency string `json:"currency,omitempty"`
	} `json:"fee,omitempty"`
	CreatedAt    time.Time `json:"created_at,omitempty"`
	UpdatedAt    time.Time `json:"updated_at,omitempty"`
	PayoutAt     time.Time `json:"payout_at,omitempty"`
	Resource     string    `json:"resource,omitempty"`
	ResourcePath string    `json:"resource_path,omitempty"`
	Committed    bool      `json:"committed,omitempty"`
	Instant      bool      `json:"instant,omitempty"`
}

type Client

type Client struct {
	HTTPClient   *http.Client
	APIKey       string
	APISecret    string
	APIBase      string
	Log          io.Writer // If set, all request will be logged there
	Localization string    // Preferred language for Error Messages
}

Client represents a Coinbase REST API Client

func NewClient

func NewClient(APIKey string, APISecret string) *Client

func (*Client) CancelRequestMoney

func (c *Client) CancelRequestMoney(ctx context.Context, accountID string, transactionID string) (*Transaction, error)

CancelRequestMoney Lets a user cancel a money request. Endpoint: DELETE /accounts/:account_id/transactions/:transaction_id

func (*Client) CommitBuy

func (c *Client) CommitBuy(ctx context.Context, accountID string, buyID string) (*Buy, error)

CommitBuy Completes a buy that is created in commit: false state. Endpoint: POST /accounts/:account_id/buys/:buy_id/commit

func (*Client) CommitDeposit

func (c *Client) CommitDeposit(ctx context.Context, accountID string, depositID string) (*Deposit, error)

CommitDeposit Completes a deposit that is created in commit: false state. Endpoint: POST /accounts/:account_id/deposits/:deposit_id/commit

func (*Client) CommitSell

func (c *Client) CommitSell(ctx context.Context, accountID string, sellID string) (*Sell, error)

CommitSell Completes a sell that is created in commit: false state. Endpoint: POST /accounts/:account_id/sells/:sell_id/commit

func (*Client) CommitWithdrawal

func (c *Client) CommitWithdrawal(ctx context.Context, accountID string, withdrawID string) (*Withdrawal, error)

CommitWithdrawal Completes a withdrawal that is created in commit: false state. Endpoint: POST /accounts/:account_id/withdrawals/:withdrawal_id/commit

func (*Client) CompleteRequestMoney

func (c *Client) CompleteRequestMoney(ctx context.Context, accountID string, transactionID string) (*Transaction, error)

CompleteRequestMoney Lets the recipient of a money request complete the request by sending money to the user who requested the money. Endpoint: POST /accounts/:account_id/transactions/:transaction_id/complete

func (*Client) CreateAddress

func (c *Client) CreateAddress(ctx context.Context, accountID string, addressData CreateAddress) (*Address, error)

CreateAddress Creates a new address for an account. Endpoint: POST /accounts/:account_id/addresses

func (*Client) DeleteAccount

func (c *Client) DeleteAccount(ctx context.Context, accountID string) error

DeleteAccount Removes user’s account. Endpoint: DELETE /accounts/:account_id

func (*Client) DepositFunds

func (c *Client) DepositFunds(ctx context.Context, accountID string, depositData DepositFunds) (*Deposit, error)

DepositFunds Deposits user-defined amount of funds to a fiat account. Endpoint: POST /accounts/:account_id/deposits

func (*Client) GetAccount

func (c *Client) GetAccount(ctx context.Context, accountID string) (*Account, error)

GetAccount Show current user’s account. Endpoint: GET /accounts/:account_id

func (*Client) GetBuy

func (c *Client) GetBuy(ctx context.Context, accountID string, buyID string) (*Buy, error)

GetBuy Show an individual buy. Endpoint: GET /accounts/:account_id/buys/:buy_id

func (*Client) GetBuyPrice

func (c *Client) GetBuyPrice(ctx context.Context, currencyPair string) (*Price, error)

GetBuyPrice Get the total price to buy one bitcoin or ether. Endpoint: GET /prices/:currency_pair/buy

func (*Client) GetDeposit

func (c *Client) GetDeposit(ctx context.Context, accountID string, depositID string) (*Deposit, error)

GetDeposit Show an individual deposit. Endpoint: GET /accounts/:account_id/deposits/:deposit_id

func (*Client) GetSell

func (c *Client) GetSell(ctx context.Context, accountID string, sellID string) (*Sell, error)

GetSell Show an individual sell. Endpoint: GET /accounts/:account_id/sells/:sell_id

func (*Client) GetSellPrice

func (c *Client) GetSellPrice(ctx context.Context, currencyPair string) (*Price, error)

GetSellPrice Get the total price to sell one bitcoin or ether. Endpoint: GET /prices/:currency_pair/sell

func (*Client) GetSpotPrice

func (c *Client) GetSpotPrice(ctx context.Context, currencyPair string) (*Price, error)

GetSpotPrice Get the current market price for bitcoin. Endpoint: GET /prices/:currency_pair/spot

func (*Client) GetTime

func (c *Client) GetTime(ctx context.Context) (*Time, error)

GetTime Get the API server time. Endpoint: GET /time

func (*Client) GetTransaction

func (c *Client) GetTransaction(ctx context.Context, accountID string, transactionID string) (*Transaction, error)

GetTransaction Show an individual transaction for an account. Endpoint: GET /accounts/:account_id/transactions/:transaction_id

func (*Client) GetUser

func (c *Client) GetUser(ctx context.Context) (*User, error)

GetUser Get current user’s public information Endpoint: GET /user

func (*Client) GetUserByID

func (c *Client) GetUserByID(ctx context.Context, userID string) (*User, error)

GetUserByID Get any user’s public information with their ID. Endpoint: GET /users/:user_id

func (*Client) GetWithdrawal

func (c *Client) GetWithdrawal(ctx context.Context, accountID string, withdrawalID string) (*Withdrawal, error)

GetWithdrawal Show an individual withdrawal. Endpoint: GET /accounts/:account_id/withdrawals/:withdrawal_id

func (*Client) ListAccounts

func (c *Client) ListAccounts(ctx context.Context) (*[]Account, *Pagination, error)

ListAccounts Lists current user’s accounts to which the authentication method has access to. Endpoint: GET /accounts

func (*Client) ListAddressTransactions

func (c *Client) ListAddressTransactions(ctx context.Context, accountID string, addressID string) (*[]Transaction, *Pagination, error)

ListAddressTransactions List transactions that have been sent to a specific address. Endpoint: GET /accounts/:account_id/addresses/:address_id/transactions

func (*Client) ListAddresses

func (c *Client) ListAddresses(ctx context.Context, accountID string) (*[]Address, *Pagination, error)

ListAddresses Lists addresses for an account. Endpoint: GET /accounts/:account_id/addresses

func (*Client) ListBuys

func (c *Client) ListBuys(ctx context.Context, accountID string) (*[]Buy, *Pagination, error)

ListBuys Lists buys for an account. Endpoint: GET /accounts/:account_id/buys

func (*Client) ListCurrencies

func (c *Client) ListCurrencies(ctx context.Context) (*[]Currency, error)

ListCurrencies List known currencies. Endpoint: GET /currencies

func (*Client) ListDeposits

func (c *Client) ListDeposits(ctx context.Context, accountID string) (*[]Deposit, *Pagination, error)

ListDeposits Lists deposits for an account. Endpoint: GET /accounts/:account_id/deposits

func (*Client) ListExchangeRates

func (c *Client) ListExchangeRates(ctx context.Context, currency string) (*ExchangeRates, error)

ListExchangeRates Get current exchange rates. Endpoint: GET /exchange-rates

func (*Client) ListPaymentMethods

func (c *Client) ListPaymentMethods(ctx context.Context) (*[]PaymentMethod, *Pagination, error)

ListPaymentMethods Lists current user’s payment methods. Endpoint: GET /payment-methods

func (*Client) ListSells

func (c *Client) ListSells(ctx context.Context, accountID string) (*[]Sell, *Pagination, error)

ListSells Lists sells for an account. Endpoint: GET /accounts/:account_id/sells

func (*Client) ListTransactions

func (c *Client) ListTransactions(ctx context.Context, accountID string) (*[]Transaction, *Pagination, error)

ListTransactions Lists account’s transactions. Endpoint: GET /accounts/:account_id/transactions

func (*Client) ListWithdrawals

func (c *Client) ListWithdrawals(ctx context.Context, accountID string) (*[]Withdrawal, *Pagination, error)

ListWithdrawals Lists withdrawals for an account. Endpoint: GET /accounts/:account_id/withdrawals

func (*Client) NewRequest

func (c *Client) NewRequest(ctx context.Context, method, url string, payload interface{}) (*http.Request, error)

NewRequest constructs a request Convert payload to a JSON

func (*Client) PlaceBuy

func (c *Client) PlaceBuy(ctx context.Context, accountID string, buyData PlaceBuy) (*Buy, error)

PlaceBuy Buys a user-defined amount of bitcoin, bitcoin cash, litecoin or ethereum. Endpoint: POST /accounts/:account_id/buys

func (*Client) PlaceSell

func (c *Client) PlaceSell(ctx context.Context, accountID string, sellData PlaceSell) (*Sell, error)

PlaceSell Sells a user-defined amount of bitcoin, bitcoin cash, litecoin or ethereum. Endpoint: POST /accounts/:account_id/sells

func (*Client) RequestMoney

func (c *Client) RequestMoney(ctx context.Context, accountID string, requestData RequestMoney) (*Transaction, error)

RequestMoney Requests money from an email address. Endpoint: POST /accounts/:account_id/transactions

func (*Client) ResendRequestMoney

func (c *Client) ResendRequestMoney(ctx context.Context, accountID string, transactionID string) (*Transaction, error)

ResendRequestMoney Lets the user resend a money request. Endpoint: POST /accounts/:account_id/transactions/:transaction_id/resend

func (*Client) Send

func (c *Client) Send(req *http.Request, v ...interface{}) error

Send makes a request to the API, the response body will be unmarshaled into v, or if v is an io.Writer, the response will be written to it without decoding

func (*Client) SendMoney

func (c *Client) SendMoney(ctx context.Context, accountID string, sendData SendMoney) (*Transaction, error)

SendMoney Send funds to a bitcoin address, bitcoin cash address, litecoin address, ethereum address, or email address. Endpoint: POST /accounts/:account_id/transactions

func (*Client) SendWithAuth

func (c *Client) SendWithAuth(req *http.Request, v ...interface{}) error

SendWithAuth makes a request to the API and apply Authentication headers automatically.

func (*Client) SetLog

func (c *Client) SetLog(log io.Writer)

SetLog will set/change the output destination.

func (*Client) ShowAddress

func (c *Client) ShowAddress(ctx context.Context, accountID string, addressID string) (*Address, error)

ShowAddress Show an individual address for an account. Endpoint: GET /accounts/:account_id/addresses/:address_id

func (*Client) ShowPaymentMethod

func (c *Client) ShowPaymentMethod(ctx context.Context, paymentMethodID string) (*PaymentMethod, error)

ShowPaymentMethod Show current user’s payment method. Endpoint: GET /payment-methods/:payment_method_id/

func (*Client) TransferMoney

func (c *Client) TransferMoney(ctx context.Context, accountID string, transferData TransferMoney) (*Transaction, error)

TransferMoney Transfer bitcoin, bitcoin cash, litecoin or ethereum between two of a user’s accounts. Endpoint: POST /accounts/:account_id/transactions

func (*Client) UpdateAccount

func (c *Client) UpdateAccount(ctx context.Context, accountID string, accountData UpdateAccount) (*Account, error)

UpdateAccount Modifies user’s account. Endpoint: PUT /accounts/:account_id

func (*Client) UpdateUser

func (c *Client) UpdateUser(ctx context.Context, userData UpdateCurrentUser) (*User, error)

UpdateUser Modify current user and their preferences. Endpoint: PUT /user

func (*Client) Withdraw

func (c *Client) Withdraw(ctx context.Context, accountID string, withdrawData Withdraw) (*Withdrawal, error)

Withdraw Withdraws user-defined amount of funds from a fiat account. Endpoint: POST /accounts/:account_id/withdrawals

type CreateAddress

type CreateAddress struct {
	Name string `json:"name,omitempty"`
}

type Currency

type Currency struct {
	ID      string `json:"id,omitempty"`
	Name    string `json:"name,omitempty"`
	MinSize string `json:"min_size,omitempty"`
}

type Deposit

type Deposit struct {
	ID            string `json:"id,omitempty"`
	Status        string `json:"status,omitempty"`
	PaymentMethod struct {
		ID           string `json:"id,omitempty"`
		Resource     string `json:"resource,omitempty"`
		ResourcePath string `json:"resource_path,omitempty"`
	} `json:"payment_method,omitempty"`
	Transaction struct {
		ID           string `json:"id,omitempty"`
		Resource     string `json:"resource,omitempty"`
		ResourcePath string `json:"resource_path,omitempty"`
	} `json:"transaction,omitempty"`
	Amount struct {
		Amount   string `json:"amount,omitempty"`
		Currency string `json:"currency,omitempty"`
	} `json:"amount,omitempty"`
	SubTotal struct {
		Amount   string `json:"amount,omitempty"`
		Currency string `json:"currency,omitempty"`
	} `json:"subtotal,omitempty"`
	Fee struct {
		Amount   string `json:"amount,omitempty"`
		Currency string `json:"currency,omitempty"`
	} `json:"fee,omitempty"`
	CreatedAt    time.Time `json:"created_at,omitempty"`
	UpdatedAt    time.Time `json:"updated_at,omitempty"`
	PayoutAt     time.Time `json:"payout_at,omitempty"`
	Resource     string    `json:"resource,omitempty"`
	ResourcePath string    `json:"resource_path,omitempty"`
	Committed    bool      `json:"committed,omitempty"`
}

type DepositFunds

type DepositFunds struct {
	Amount        string `json:"amount,omitempty"`
	Currency      string `json:"currency,omitempty"`
	PaymentMethod string `json:"payment_method,omitempty"`
	Commit        bool   `json:"commit,omitempty"`
}

type ErrorResponse

type ErrorResponse struct {
	Response *http.Response `json:"-,omitempty"`
	Errors   []Errors       `json:"errors,omitempty"`
}

ErrorResponse represents a Coinbase REST API Error Response

func (*ErrorResponse) Error

func (r *ErrorResponse) Error() string

Error method implementation for ErrorResponse struct

type Errors

type Errors struct {
	ID      string `json:"id,omitempty"`
	Message string `json:"message,omitempty"`
	Url     string `json:"url,omitempty"`
}

Error represents a Coinbase REST API Error Detail

type ExchangeRates

type ExchangeRates struct {
	Currency string            `json:"currency,omitempty"`
	Rates    map[string]string `json:"rate,omitempty"`
}

type From

type From struct {
	ID       string `json:"id,omitempty"`
	Resource string `json:",omitempty"`
}

type Network

type Network struct {
	Status string `json:"status,omitempty"`
	Name   string `json:"name,omitempty"`
}

type Pagination

type Pagination struct {
	EndingBefore  string `json:"ending_before,omitempty"`
	StartingAfter string `json:"starting_after,omitempty"`
	Limit         uint8  `json:"limit,omitempty"`
	Order         string `json:"order,omitempty"`
	PreviousUri   string `json:"previous_uri,omitempty"`
	NextUri       string `json:"next_uri,omitempty"`
}

type PaymentMethod

type PaymentMethod struct {
	ID           string    `json:"id,omitempty"`
	Type         string    `json:"type,omitempty"`
	Name         string    `json:"name,omitempty"`
	Currency     string    `json:"currency,omitempty"`
	PrimaryBuy   bool      `json:"primary_buy,omitempty"`
	PrimarySell  bool      `json:"primary_sell,omitempty"`
	AllowBuy     bool      `json:"allow_buy,omitempty"`
	AllowSell    bool      `json:"allow_sell,omitempty"`
	InstantBuy   bool      `json:"instant_buy,omitempty"`
	InstantSell  bool      `json:"instant_sell,omitempty"`
	CreatedAt    time.Time `json:"created_at,omitempty"`
	UpdatedAt    time.Time `json:"updated_at,omitempty"`
	Resource     string    `json:"resource,omitempty"`
	ResourcePath string    `json:"resource_path,omitempty"`
}

type PlaceBuy

type PlaceBuy struct {
	Amount               string `json:"amount,omitempty"`
	Total                string `json:"total,omitempty"`
	Currency             string `json:"currency,omitempty"`
	PaymentMethod        string `json:"payment_method,omitempty"`
	AgreeBtcAmountVaries bool   `json:"agree_btc_amount_varies,omitempty"`
	Commit               bool   `json:"commit,omitempty"`
	Quote                bool   `json:"quote,omitempty"`
}

type PlaceSell

type PlaceSell struct {
	Amount               string `json:"amount,omitempty"`
	Total                string `json:"total,omitempty"`
	Currency             string `json:"currency,omitempty"`
	PaymentMethod        string `json:"payment_method,omitempty"`
	AgreeBtcAmountVaries bool   `json:"agree_btc_amount_varies,omitempty"`
	Commit               bool   `json:"commit,omitempty"`
	Quote                bool   `json:"quote,omitempty"`
}

type Price

type Price struct {
	Amount   string `json:"amount,omitempty"`
	Currency string `json:"currency,omitempty"`
}

type RequestMoney

type RequestMoney struct {
	Type        string `json:"type,omitempty"`
	To          string `json:"to,omitempty"`
	Amount      string `json:"amount,omitempty"`
	Currency    string `json:"currency,omitempty"`
	Description string `json:"description,omitempty"`
}

type Response

type Response struct {
	Pagination interface{} `json:"pagination"`
	Data       interface{} `json:"data"`
}

type Sell

type Sell struct {
	ID            string `json:"id,omitempty"`
	Status        string `json:"status,omitempty"`
	PaymentMethod struct {
		ID           string `json:"id,omitempty"`
		Resource     string `json:"resource,omitempty"`
		ResourcePath string `json:"resource_path,omitempty"`
	} `json:"payment_method,omitempty"`
	Transaction struct {
		ID           string `json:"id,omitempty"`
		Resource     string `json:"resource,omitempty"`
		ResourcePath string `json:"resource_path,omitempty"`
	} `json:"transaction,omitempty"`
	Amount struct {
		Amount   string `json:"amount,omitempty"`
		Currency string `json:"currency,omitempty"`
	} `json:"amount,omitempty"`
	Total struct {
		Amount   string `json:"amount,omitempty"`
		Currency string `json:"currency,omitempty"`
	} `json:"total,omitempty"`
	SubTotal struct {
		Amount   string `json:"amount,omitempty"`
		Currency string `json:"currency,omitempty"`
	} `json:"subtotal,omitempty"`
	Fee struct {
		Amount   string `json:"amount,omitempty"`
		Currency string `json:"currency,omitempty"`
	} `json:"fee,omitempty"`
	CreatedAt    time.Time `json:"created_at,omitempty"`
	UpdatedAt    time.Time `json:"updated_at,omitempty"`
	PayoutAt     time.Time `json:"payout_at,omitempty"`
	Resource     string    `json:"resource,omitempty"`
	ResourcePath string    `json:"resource_path,omitempty"`
	Committed    bool      `json:"committed,omitempty"`
	Instant      bool      `json:"instant,omitempty"`
}

type SendMoney

type SendMoney struct {
	Type                        string `json:"type,omitempty"`
	To                          string `json:"to,omitempty"`
	Amount                      string `json:"amount,omitempty"`
	Currency                    string `json:"currency,omitempty"`
	Description                 string `json:"description,omitempty"`
	SkipNotifications           bool   `json:"skip_notifications,omitempty"`
	Fee                         string `json:"fee,omitempty"`
	Idem                        string `json:"idem,omitempty"`
	ToFinancialInstitution      bool   `json:"to_financial_institution,omitempty"`
	FinancialInstitutionWebsite string `json:"financial_institution_website,omitempty"`
}

type Time

type Time struct {
	Iso   string `json:"iso,omitempty"`
	Epoch int64  `json:"epoch,omitempty"`
}

type Transaction

type Transaction struct {
	ID     string `json:"id,omitempty"`
	Type   string `json:"type,omitempty"`
	Status string `json:"status,omitempty"`
	Amount struct {
		Amount   string `json:"amount,omitempty"`
		Currency string `json:"currency,omitempty"`
	} `json:"amount,omitempty"`
	NativeAmount struct {
		Amount   string `json:"amount,omitempty"`
		Currency string `json:"currency,omitempty"`
	} `json:"native_amount,omitempty"`
	Description  string    `json:"description,omitempty"`
	CreatedAt    time.Time `json:"created_at,omitempty"`
	UpdatedAt    time.Time `json:"updated_at,omitempty"`
	Resource     string    `json:"resource,omitempty"`
	ResourcePath string    `json:"resource_path,omitempty"`
	Network      Network   `json:"network,omitempty"`
	From         From      `json:"from,omitempty"`
}

type TransferMoney

type TransferMoney struct {
	Type        string `json:"type,omitempty"`
	To          string `json:"to,omitempty"`
	Amount      string `json:"amount,omitempty"`
	Currency    string `json:"currency,omitempty"`
	Description string `json:"description,omitempty"`
}

type UpdateAccount

type UpdateAccount struct {
	Name string `json:"name,omitempty"`
}

type UpdateCurrentUser

type UpdateCurrentUser struct {
	Name           string `json:"name,omitempty"`
	TimeZone       string `json:"time_zone,omitempty"`
	NativeCurrency string `json:"native_currency,omitempty"`
}

type User

type User struct {
	ID              string `json:"id,omitempty"`
	Name            string `json:"name,omitempty"`
	Username        string `json:"username,omitempty"`
	ProfileLocation string `json:"profile_location,omitempty"`
	ProfileBio      string `json:"profile_bio,omitempty"`
	ProfileUrl      string `json:"profile_url,omitempty"`
	AvatarUrl       string `json:"avatar_url,omitempty"`
	Resource        string `json:"resource,omitempty"`
	ResourcePath    string `json:"resource_path,omitempty"`
	SendsDisabled   bool   `json:"sends_disabled,omitempty"`
}

type Withdraw

type Withdraw struct {
	Amount        string `json:"amount,omitempty"`
	Currency      string `json:"currency,omitempty"`
	PaymentMethod string `json:"payment_method,omitempty"`
}

type Withdrawal

type Withdrawal struct {
	ID     string `json:"id,omitempty"`
	Type   string `json:"type,omitempty"`
	Status string `json:"status,omitempty"`
	Amount struct {
		Amount   string `json:"amount,omitempty"`
		Currency string `json:"currency,omitempty"`
	} `json:"amount,omitempty"`
	PaymentMethod struct {
		ID           string `json:"id,omitempty"`
		Resource     string `json:"resource,omitempty"`
		ResourcePath string `json:"resource_path,omitempty"`
	} `json:"payment_method,omitempty"`
	Transaction struct {
		ID           string `json:"id,omitempty"`
		Resource     string `json:"resource,omitempty"`
		ResourcePath string `json:"resource_path,omitempty"`
	} `json:"transaction,omitempty"`
	SubTotal struct {
		Amount   string `json:"amount,omitempty"`
		Currency string `json:"currency,omitempty"`
	} `json:"subtotal,omitempty"`
	Fee struct {
		Amount   string `json:"amount,omitempty"`
		Currency string `json:"currency,omitempty"`
	} `json:"fee,omitempty"`
	CreatedAt    time.Time `json:"created_at,omitempty"`
	UpdatedAt    time.Time `json:"updated_at,omitempty"`
	PayoutAt     time.Time `json:"payout_at,omitempty"`
	Resource     string    `json:"resource,omitempty"`
	ResourcePath string    `json:"resource_path,omitempty"`
	Committed    bool      `json:"committed,omitempty"`
}

Jump to

Keyboard shortcuts

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