coincheck

package
v0.0.0-...-afd3e11 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WalletCode = "COINCHECK"
	FiatCode   = "JPY"
)
View Source
const (
	OperationReceived                  = "Received"
	OperationLimitOrder                = "Limit Order"
	OperationCompletedTradingContracts = "Completed trading contracts"
	OperationSent                      = "Sent"
	OperationBankWithdrawal            = "Bank Withdrawal"
	OperationCancelLimitOrder          = "Cancel Limit Order"
)
View Source
const (
	IDColumn               = "id"
	TimeColumn             = "time"
	OperationColumn        = "operation"
	AmountColumn           = "amount"
	TradingCurrencyColumn  = "trading_currency"
	PriceColumn            = "price"
	OriginalCurrencyColumn = "original_currency"
	FeeColumn              = "fee"
	CommentColumn          = "comment"
)

Variables

This section is empty.

Functions

func ValidateColumnNames

func ValidateColumnNames(names []string) error

ValidateColumnNames checks columns

Types

type ColumnID

type ColumnID int
const (
	ID ColumnID = iota
	Time
	Operation
	Amount
	TradingCurrency
	Price
	OriginalCurrency
	Fee
	Comment
)

Column Index

type Extractor

type Extractor struct {
}

Extractor for BitFlyer

func NewExecutor

func NewExecutor() *Extractor

NewExecutor create an executor for BitFlyer

func (*Extractor) Execute

func (e *Extractor) Execute(ctx context.Context, db boil.ContextExecutor, reader io.Reader, options ...eupholio.Option) error

Execute performs ETL

type History

type History struct {
	Entries models.CoincheckHistorySlice
}

func Extract

func Extract(reader io.Reader) (*History, error)

Extract extracts transactions from a reader

func ExtractFromFile

func ExtractFromFile(path string) (*History, error)

type Record

type Record []string

func MakeRecords

func MakeRecords(head []string, rows [][]string) ([]Record, error)

func (Record) Amount

func (r Record) Amount() *decimal.Big

func (Record) Comment

func (r Record) Comment() string

func (Record) Fee

func (r Record) Fee() *decimal.Big

func (Record) Get

func (r Record) Get(id ColumnID) string

func (Record) ID

func (r Record) ID() string

func (Record) Operation

func (r Record) Operation() string

func (Record) OriginalCurrency

func (r Record) OriginalCurrency() string

func (Record) Price

func (r Record) Price() *decimal.Big

func (Record) Time

func (r Record) Time() (time.Time, error)

func (Record) TradingCurrency

func (r Record) TradingCurrency() string

type Repository

type Repository interface {
	FindHistories(ctx context.Context, start, end time.Time) (models.CoincheckHistorySlice, error)
	FindHistoriesByYear(ctx context.Context, year int, location *time.Location) (models.CoincheckHistorySlice, error)
	CreateHistories(ctx context.Context, hs models.CoincheckHistorySlice) error
}

func NewRepository

func NewRepository(db boil.ContextExecutor) Repository

type Translator

type Translator struct {
}

func NewTranslator

func NewTranslator() *Translator

func (*Translator) Translate

func (t *Translator) Translate(ctx context.Context, repo eupholio.Repository, start, end time.Time) error

Translate stores extracted transaction data to transaction table

Jump to

Keyboard shortcuts

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