hestia

package
v1.1.13 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: MIT Imports: 7 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BalancerOrderStatusStr = map[BalancerOrderStatus]string{
		0: "CREATED",
		1: "EXCHANGE_DEPOSIT_SENT",
		2: "FIRST_TRADE",
		3: "SECOND_TRADE",
		4: "WITHDRAWAL",
		5: "PLUTUS_DEPOSIT",
		6: "COMPLETED",
	}
)
View Source
var (
	BalancerStatusStr = map[BalancerStatus]string{
		0: "CREATED",
		1: "WITHDRAWAL",
		2: "TRADE_ORDERS",
		3: "COMPLETED",
	}
)
View Source
var (
	ExchangeOrderStatusStr = map[ExchangeOrderStatus]string{
		0: "OPEN",
		1: "COMPLETED",
		2: "ERROR",
	}
)
View Source
var HttpClient = http.Client{
	Timeout: time.Second * 5,
}

HttpClient a usable client with hardcoded timeout

View Source
var ProductionURL = "https://hestia.polispay.com"

ProductionURL is the current hestia production url

View Source
var (
	ServiceAccountStr = map[ServiceAccount]string{
		0: "VOUCHERS",
		1: "SHIFT",
	}
)
View Source
var (
	ShiftStatusStr = map[ShiftStatus]string{
		0: "PENDING",
		1: "CONFIRMING",
		2: "CONFIRMED",
		3: "ERROR",
		4: "REFUND",
		5: "REFUNDED",
		6: "COMPLETE",
	}
)
View Source
var (
	ShiftStatusV2Str = map[ShiftStatusV2]string{
		0: "CREATED",
		1: "CONFIRMED",
		2: "PROCESSING_ORDERS",
		3: "PARTIALLY_COMPLETED",
		4: "COMPLETE",
		5: "SENT_TO_USER",
		6: "ERROR",
		7: "REFUNDED",
	}
)
View Source
var (
	ShiftV2TradeStatusStr = map[ShiftV2TradeStatus]string{
		0: "INITIALIZED",
		1: "CREATED",
		2: "PERFORMING",
		3: "COMPLETED",
		4: "WITHDRAWN",
		5: "USER_DEPOSIT",
		6: "WITHDRAW_COMPLETED",
	}
)
View Source
var (
	SimpleTxStatusStr = map[SimpleTxStatus]string{
		0: "CREATED",
		1: "PERFORMED",
		2: "COMPLETED",
		3: "PLUTUS_DEPOSIT",
	}
)
View Source
var (
	VoucherShippingMethodStr = map[VoucherShippingMethod]string{
		0: "EMAIL",
		1: "ACCOUNT",
		2: "API",
	}
)
View Source
var (
	VoucherStatusStr = map[VoucherStatus]string{
		0:  "PENDING",
		1:  "CONFIRMED",
		2:  "CONFIRMING",
		3:  "AWAITING_PROVIDER",
		4:  "ERROR",
		5:  "COMPLETE",
		6:  "REFUND_TOTAL",
		7:  "REFUND_FEE",
		8:  "REFUNDED",
		9:  "REFUNDED_PARTIALLY",
		10: "BITCOU_REFUNDED",
	}
)
View Source
var (
	VoucherStatusV2Str = map[VoucherStatusV2]string{
		0: "PAYMENT_PROCESSING",
		1: "REDEEMED",
		2: "PERFORMING_TRADE",
		3: "COMPLETE",
		4: "REFUNDED",
		5: "ERROR",
		6: "NEEDS_REFUND",
		7: "WAITING_REFUND_TXID",
		8: "BITCOU_PAYED",
	}
)

Functions

func GetBalancerOrderStatusString

func GetBalancerOrderStatusString(status BalancerOrderStatus) string

func GetBalancerStatusString

func GetBalancerStatusString(status BalancerStatus) string

func GetCoinsAvailability

func GetCoinsAvailability(productionURL string, adminFbToken string) (string, error)

GetCoinsAvailability is a function to return hestia properties for multiple crypto used on the environment

func GetServiceAccountString

func GetServiceAccountString(service ServiceAccount) string

func GetServiceProperties

func GetServiceProperties(productionURL string, adminFbToken string) (string, error)

GetServiceProperties is a function to return hestia properties for multiple services

func GetShiftStatusString

func GetShiftStatusString(status ShiftStatus) string

func GetShiftStatusv2String

func GetShiftStatusv2String(status ShiftStatusV2) string

func GetShiftV2TradeStatusString

func GetShiftV2TradeStatusString(status ShiftV2TradeStatus) string

func GetSimpleTxStatusString

func GetSimpleTxStatusString(status SimpleTxStatus) string

func GetVoucherShippingMethodString

func GetVoucherShippingMethodString(method VoucherShippingMethod) string

func GetVoucherStatusString

func GetVoucherStatusString(status VoucherStatus) string

func GetVoucherStatusV2String

func GetVoucherStatusV2String(status VoucherStatusV2) string

func VerifyToken

func VerifyToken(productionURL string, service string, masterPassword string, fbToken string, hestiaAuthUser string, hestiaAuthPass string, servicePrivKey string, hestiaPubKey string) (valid bool, uid string, err error)

VerifyToken ask Hestia if a firebase token is valid

Types

type AddressInformation

type AddressInformation struct {
	City       string `firestore:"city" json:"city"`
	Country    string `firestore:"country" json:"country"`
	PostalCode string `firestore:"postal_code" json:"postal_code"`
	Email      string `firestore:"email" json:"email"`
	Street     string `firestore:"street" json:"street"`
}

type AdrestiaInfo

type AdrestiaInfo struct {
	Available bool    `firestore:"available" json:"available"`
	CoinUsage float64 `firestore:"coin_usage" json:"coin_usage"`
}

type ApiKeys

type ApiKeys struct {
	PublicKey  string `firestore:"public_key" json:"public_key"`
	PrivateKey string `firestore:"private_key" json:"private_key"`
}

type Available

type Available struct {
	Service   bool `firestore:"service" json:"service"`
	Processor bool `firestore:"processor" json:"processor"`
}

type BalanceLimits

type BalanceLimits struct {
	HotWallet float64 `firestore:"hot_wallet" json:"hot_wallet"`
	Exchanges float64 `firestore:"exchanges" json:"exchanges"`
}

type Balancer

type Balancer struct {
	Id            string         `firestore:"id" json:"id"`
	Status        BalancerStatus `firestore:"status" json:"status"`
	CreatedTime   int64          `firestore:"created_time" json:"created_time"`
	FulfilledTime int64          `firestore:"fulfilled_time" json:"fulfilled_time"`
}

type BalancerOrder

type BalancerOrder struct {
	Id              string              `firestore:"id" json:"id"`
	BalancerId      string              `firestore:"balancer_id" json:"balancer_id"`
	FromCoin        string              `firestore:"from_coin" json:"from_coin"`
	ToCoin          string              `firestore:"to_coin" json:"to_coin"`
	DualConversion  bool                `firestore:"dual_conversion" json:"dual_conversion"`
	OriginalAmount  float64             `firestore:"original_amount" json:"original_amount"`
	FirstTrade      Trade               `firestore:"first_trade" json:"first_trade"`
	SecondTrade     Trade               `firestore:"second_trade" json:"second_trade"`
	Status          BalancerOrderStatus `firestore:"status" json:"status"`
	ReceivedAmount  float64             `firestore:"received_amount" json:"received_amount"`
	DepositTxId     string              `firestore:"deposit_txid" json:"deposit_txid"`
	WithdrawTxId    string              `firestore:"withdraw_txid" json:"withdraw_txid"`
	DepositAddress  string              `firestore:"deposit_address" json:"deposit_address"`
	WithdrawAddress string              `firestore:"withdraw_address" json:"withdraw_address"`
	CreatedTime     int64               `firestore:"created_time" json:"created_time"`
	FulfilledTime   int64               `firestore:"fulfilled_time" json:"fulfilled_time"`
	Exchange        string              `firestore:"exchange" json:"exchange"`
}

type BalancerOrderStatus

type BalancerOrderStatus int
const (
	BalancerOrderStatusCreated BalancerOrderStatus = iota
	BalancerOrderStatusExchangeDepositSent
	BalancerOrderStatusFirstTrade
	BalancerOrderStatusSecondTrade
	BalancerOrderStatusWithdrawal
	BalancerOrderStatusPlutusDeposit
	BalancerOrderStatusCompleted
)

type BalancerStatus

type BalancerStatus int
const (
	BalancerStatusCreated BalancerStatus = iota
	BalancerStatusWithdrawal
	BalancerStatusTradeOrders
	BalancerStatusCompleted
)

type BitcoinTxInfo

type BitcoinTxInfo struct {
	Blockhash     string `json:"blockhash"`
	Blocktime     int    `json:"blocktime"`
	Confirmations int    `json:"confirmations"`
	Hash          string `json:"hash"`
	Hex           string `json:"hex"`
	Locktime      int    `json:"locktime"`
	Size          int    `json:"size"`
	Time          int    `json:"time"`
	Txid          string `json:"txid"`
	Version       int    `json:"version"`
	Vin           []struct {
		ScriptSig struct {
			Asm string `json:"asm"`
			Hex string `json:"hex"`
		} `json:"scriptSig"`
		Sequence    int      `json:"sequence"`
		Txid        string   `json:"txid"`
		Txinwitness []string `json:"txinwitness"`
		Vout        int      `json:"vout"`
	} `json:"vin"`
	Vout []struct {
		N            int `json:"n"`
		ScriptPubKey struct {
			Addresses []string `json:"addresses"`
			Asm       string   `json:"asm"`
			Hex       string   `json:"hex"`
			ReqSigs   int      `json:"reqSigs"`
			Type      string   `json:"type"`
		} `json:"scriptPubKey"`
		Value float64 `json:"value"`
	} `json:"vout"`
	Vsize  int `json:"vsize"`
	Weight int `json:"weight"`
}

type BodyReq

type BodyReq struct {
	Payload string `json:"payload"`
}

type Card

type Card struct {
	Address    string `firestore:"address" json:"address"`
	CardCode   string `firestore:"card_code" json:"card_code"`
	CardNumber string `firestore:"card_number" json:"card_number"`
	City       string `firestore:"city" json:"city"`
	Email      string `firestore:"email" json:"email"`
	FirstName  string `firestore:"firstname" json:"firstname"`
	LastName   string `firestore:"lastname" json:"lastname"`
	UID        string `firestore:"uid" json:"uid"`
}

type Coin

type Coin struct {
	Ticker   string        `firestore:"ticker" json:"ticker"`
	Shift    Properties    `firestore:"shift" json:"shift"`
	Deposits Properties    `firestore:"deposits" json:"deposits"`
	Vouchers Properties    `firestore:"vouchers" json:"vouchers"`
	Orders   Properties    `firestore:"orders" json:"orders"`
	Balances BalanceLimits `firestore:"balances" json:"balances"`
	Adrestia AdrestiaInfo  `firestore:"adrestia" json:"adrestia"`
}

type CoinBalances

type CoinBalances struct {
	Ticker  string  `firestore:"ticker" json:"ticker"`
	Balance float64 `firestore:"balance" json:"balance"`
	Status  string  `firestore:"status" json:"status"`
}

type Config

type Config struct {
	Shift    Available    `firestore:"shift" json:"shift"`
	Deposits Available    `firestore:"deposits" json:"deposits"`
	Vouchers Available    `firestore:"vouchers" json:"vouchers"`
	Orders   Available    `firestore:"orders" json:"orders"`
	Adrestia Available    `firestore:"adrestia" json:"adrestia"`
	Params   CustomParams `firestore:"params" json:"params"`
}

type CustomParams

type CustomParams struct {
	EthGasPrice    int32   `firestore:"ethGasPrice" json:"ethGasPrice"`
	PolisRelayFee  int32   `firestore:"polisFee" json:"polisFee"`
	MaxAmountNoKYC float64 `firestore:"shiftMaxNoKYC" json:"shiftMaxNoKYC"`
}

type DashTxInfo

type DashTxInfo struct {
	Blockhash           string `json:"blockhash"`
	Blocktime           int    `json:"blocktime"`
	Chainlock           bool   `json:"chainlock"`
	Confirmations       int    `json:"confirmations"`
	Height              int    `json:"height"`
	Hex                 string `json:"hex"`
	Instantlock         bool   `json:"instantlock"`
	InstantlockInternal bool   `json:"instantlock_internal"`
	Locktime            int    `json:"locktime"`
	Size                int    `json:"size"`
	Time                int    `json:"time"`
	Txid                string `json:"txid"`
	Type                int    `json:"type"`
	Version             int    `json:"version"`
	Vin                 []struct {
		ScriptSig struct {
			Asm string `json:"asm"`
			Hex string `json:"hex"`
		} `json:"scriptSig"`
		Sequence int    `json:"sequence"`
		Txid     string `json:"txid"`
		Vout     int    `json:"vout"`
	} `json:"vin"`
	Vout []struct {
		N            int `json:"n"`
		ScriptPubKey struct {
			Addresses []string `json:"addresses"`
			Asm       string   `json:"asm"`
			Hex       string   `json:"hex"`
			ReqSigs   int      `json:"reqSigs"`
			Type      string   `json:"type"`
		} `json:"scriptPubKey"`
		Value    float64 `json:"value"`
		ValueSat int     `json:"valueSat"`
	} `json:"vout"`
}

type DeliveryOption

type DeliveryOption struct {
	Type            string             `firestore:"type" json:"type"`
	Service         string             `firestore:"service" json:"service"`
	DeliveryAddress AddressInformation `firestore:"delivery_address" json:"delivery_address"`
}

type Deposit

type Deposit struct {
	ID           string  `firestore:"id" json:"id"`
	UID          string  `firestore:"uid" json:"uid"`
	Payment      Payment `firestore:"payment" json:"payment"`
	FeePayment   Payment `firestore:"fee_payment" json:"fee_payment"`
	AmountInPeso string  `firestore:"amount_in_peso" json:"amount_in_peso"`
	CardCode     string  `firestore:"card_code" json:"card_code"`
	Status       string  `firestore:"status" json:"status"`
	Timestamp    string  `firestore:"timestamp" json:"timestamp"`
}

type DirectionalTrade

type DirectionalTrade struct {
	Conversions    []Trade            `firestore:"conversions" json:"conversions"`
	Status         ShiftV2TradeStatus `firestore:"status" json:"status"`
	TargetCoin     string             `firestore:"target_coin" json:"target_coin"`
	Exchange       string             `firestore:"exchange" json:"exchange"`
	WithdrawAmount float64            `firestore:"withdraw" json:"withdraw"`
}

type ExchangeInfo

type ExchangeInfo struct {
	Id                  string    `firestore:"id" json:"id"`
	Name                string    `firestore:"name" json:"name"`
	StockCurrency       string    `firestore:"stock_currency" json:"stock_currency"`
	StockExpectedAmount float64   `firestore:"stock_expected_amount" json:"stock_expected_amount"`
	StockMinimumAmount  float64   `firestore:"stock_minimum_amount" json:"stock_minimum_amount"`
	StockMaximumAmount  float64   `firestore:"stock_maximum_amount" json:"stock_maximum_amount"`
	Accounts            []ApiKeys `firestore:"accounts" json:"accounts"`
}

type ExchangeOrderInfo

type ExchangeOrderInfo struct {
	Status         ExchangeOrderStatus `json:"status"`
	ReceivedAmount float64             `json:"received_amount"`
}

type ExchangeOrderStatus

type ExchangeOrderStatus int
const (
	ExchangeOrderStatusOpen ExchangeOrderStatus = iota
	ExchangeOrderStatusCompleted
	ExchangeOrderStatusError
)

type HestiaDB

type HestiaDB struct {
	Balances            []CoinBalances  `json:"balances"`
	Cards               []Card          `json:"cards"`
	Coins               []Coin          `json:"coins"`
	Config              Config          `json:"config"`
	Deposits            []Deposit       `json:"deposits"`
	Exchanges           []ExchangeInfo  `json:"exchanges"`
	Orders              []Order         `json:"orders"`
	Shifts              []Shift         `json:"shifts"`
	Users               []User          `json:"users"`
	Vouchers            []Voucher       `json:"vouchers"`
	AdrestiaBalancer    []Balancer      `json:"adrestia_balancer"`
	AdrestiaDeposits    []SimpleTx      `json:"adrestia_deposits"`
	AdrestiaOrders      []BalancerOrder `json:"adrestia_orders"`
	AdrestiaWithdrawals []SimpleTx      `json:"adrestia_withdrawals"`
}

type KYCInformation

type KYCInformation struct{}

type LightPayment

type LightPayment struct {
	Address string `firestore:"address" json:"address"`
	Coin    string `firestore:"coin" json:"coin"`
	Txid    string `firestore:"txid" json:"txid"`
	Amount  int64  `firestore:"amount" json:"amount"`
}

type LightShift

type LightShift struct {
	ID                 string       `firestore:"id" json:"id"`
	UID                string       `firestore:"uid" json:"uid"`
	Status             string       `firestore:"status" json:"status"`
	Timestamp          int64        `firestore:"timestamp" json:"timestamp"`
	Payment            LightPayment `firestore:"payment" json:"payment"`
	RefundAddr         string       `firestore:"refund_addr" json:"refund_addr"`
	ToCoin             string       `firestore:"to_coin" json:"to_coin"`
	ToAmount           int64        `firestore:"to_amount" json:"to_amount"`
	UserReceivedAmount float64      `firestore:"user_received_amount" json:"user_received_amount"`
	ToAddress          string       `firestore:"to_address" json:"to_address"`
	PaymentProof       string       `firestore:"payment_proof" json:"payment_proof"`
	ProofTimestamp     int64        `firestore:"proof_timestamp" json:"proof_timestamp"`
}

type LightVoucher

type LightVoucher struct {
	Id             string                `firestore:"id" json:"id"`
	VoucherId      int                   `firestore:"voucher_id" json:"voucher_id"`
	VariantId      int                   `firestore:"variant_id" json:"variant_id"`
	Name           string                `firestore:"name" json:"name"`
	Timestamp      int64                 `firestore:"timestamp" json:"timestamp"`
	Amount         float64               `firestore:"amount" json:"amount"`
	PaymentTxId    string                `firestore:"payment_txid" json:"payment_txid"`
	PaymentCoin    string                `firestore:"payment_coin" json:"payment_coin"`
	RefundTxId     string                `firestore:"refund_txid" json:"refund_txid"`
	Status         string                `firestore:"status" json:"status"`
	ProviderId     string                `firestore:"provider_id" json:"provider_id"`
	RedeemCode     string                `firestore:"redeem_code" json:"redeem_code"`
	ShippingMethod VoucherShippingMethod `firestore:"shipping_method" json:"shipping_method"`
}

type Order

type Order struct {
	ID                  string                     `firestore:"id" json:"id"`
	UID                 string                     `firestore:"uid" json:"uid"`
	Status              string                     `firestore:"status" json:"status"`
	PaymentInfo         Payment                    `firestore:"payment_info" json:"payment_info"`
	FeePayment          Payment                    `firestore:"fee_payment" json:"fee_payment"`
	AddressInfo         AddressInformation         `firestore:"address_info" json:"address_info"`
	Delivery            DeliveryOption             `firestore:"delivery" json:"delivery"`
	PersonalizationData PersonalizationInformation `firestore:"personalization_data" json:"personalization_data"`
}

type Outputs

type Outputs struct {
	Address string
	Amount  decimal.Decimal
}

type Payment

type Payment struct {
	Address       string `firestore:"address" json:"address"`
	Amount        int64  `firestore:"amount" json:"amount"`
	Coin          string `firestore:"coin" json:"coin"`
	Txid          string `firestore:"txid" json:"txid"`
	Confirmations int32  `firestore:"confirmations" json:"confirmations"`
}

type PaymentWithFee

type PaymentWithFee struct {
	Address       string `firestore:"address" json:"address"`
	Amount        int64  `firestore:"amount" json:"amount"`
	Fee           int64  `firestore:"amount" json:"fee"`
	Usable        int64  `firestore:"amount" json:"usable"`
	Coin          string `firestore:"coin" json:"coin"`
	Txid          string `firestore:"txid" json:"txid"`
	Confirmations int32  `firestore:"confirmations" json:"confirmations"`
}

type PersonalInformation

type PersonalInformation struct {
	BirthDate   string `firestore:"birth_date" json:"birth_date"`
	CivilState  string `firestore:"civil_state" json:"civil_state"`
	FirstName   string `firestore:"first_name" json:"first_name"`
	LastName    string `firestore:"last_name" json:"last_name"`
	Sex         string `firestore:"sex" json:"sex"`
	HomeNumber  string `firestore:"home_number" json:"home_number"`
	Nationality string `firestore:"nationality" json:"nationality"`
	PassportID  string `firestore:"passport_id" json:"passport_id"`
}

type PersonalizationInformation

type PersonalizationInformation struct {
	PersonalData PersonalInformation `firestore:"personal_data" json:"personal_data"`
	AddressData  AddressInformation  `firestore:"address_data" json:"address_data"`
}

type Pin

type Pin struct {
	CardCode string `firestore:"card_code" json:"card_code"`
	PinCode  string `firestore:"pin_code" json:"pin_code"`
}

type PolisTxInfo

type PolisTxInfo struct {
	Blockhash     string `json:"blockhash"`
	Blocktime     int    `json:"blocktime"`
	Confirmations int    `json:"confirmations"`
	Height        int    `json:"height"`
	Hex           string `json:"hex"`
	Instantlock   bool   `json:"instantlock"`
	Locktime      int    `json:"locktime"`
	Size          int    `json:"size"`
	Time          int    `json:"time"`
	Txid          string `json:"txid"`
	Type          int    `json:"type"`
	Version       int    `json:"version"`
	Vin           []struct {
		ScriptSig struct {
			Asm string `json:"asm"`
			Hex string `json:"hex"`
		} `json:"scriptSig"`
		Sequence int    `json:"sequence"`
		Txid     string `json:"txid"`
		Vout     int    `json:"vout"`
	} `json:"vin"`
	Vout []struct {
		N            int `json:"n"`
		ScriptPubKey struct {
			Addresses []string `json:"addresses"`
			Asm       string   `json:"asm"`
			Hex       string   `json:"hex"`
			ReqSigs   int      `json:"reqSigs"`
			Type      string   `json:"type"`
		} `json:"scriptPubKey"`
		Value    float64 `json:"value"`
		ValueSat int     `json:"valueSat"`
	} `json:"vout"`
}

type Properties

type Properties struct {
	FeePercentage float64 `firestore:"fee_percentage" json:"fee_percentage"`
	Available     bool    `firestore:"available" json:"available"`
}

type Response

type Response struct {
	Data   interface{} `json:"data"`
	Status int         `json:"status"`
}

type ServiceAccount

type ServiceAccount int

Exchange Factory

const (
	VouchersAccount ServiceAccount = iota
	ShiftAccount
)

func GetServiceAccountByString

func GetServiceAccountByString(service string) ServiceAccount

type Shift

type Shift struct {
	ID             string  `firestore:"id" json:"id"`
	UID            string  `firestore:"uid" json:"uid"`
	Status         string  `firestore:"status" json:"status"`
	Timestamp      int64   `firestore:"timestamp" json:"timestamp"`
	Payment        Payment `firestore:"payment" json:"payment"`
	FeePayment     Payment `firestore:"fee_payment" json:"fee_payment"`
	RefundAddr     string  `firestore:"refund_addr" json:"refund_addr"`
	ToCoin         string  `firestore:"to_coin" json:"to_coin"`
	ToAmount       int64   `firestore:"to_amount" json:"to_amount"`
	ToAddress      string  `firestore:"to_address" json:"to_address"`
	PaymentProof   string  `firestore:"payment_proof" json:"payment_proof"`
	ProofTimestamp int64   `firestore:"proof_timestamp" json:"proof_timestamp"`
	Message        string  `firestore:"message" json:"message"`
}

type ShiftHistoryResponse

type ShiftHistoryResponse struct {
	Shifts    []LightShift `firestore:"shifts" json:"shifts"`
	Timestamp int64        `firestore:"timestamp" json:"timestamp"`
}

type ShiftStatus

type ShiftStatus int
const (
	ShiftStatusPending ShiftStatus = iota
	ShiftStatusConfirming
	ShiftStatusConfirmed
	ShiftStatusError
	ShiftStatusRefund
	ShiftStatusRefunded
	ShiftStatusComplete
)

type ShiftStatusV2

type ShiftStatusV2 int
const (
	ShiftStatusV2Created ShiftStatusV2 = iota
	ShiftStatusV2Confirmed
	ShiftStatusV2ProcessingOrders
	ShiftStatusV2PartiallyCompleted
	ShiftStatusV2Complete
	ShiftStatusV2SentToUser
	ShiftStatusV2Error
	ShiftStatusV2Refund
	ShiftStatusV2Refunded
)

type ShiftV2

type ShiftV2 struct {
	ID                 string           `firestore:"id" json:"id"`
	UID                string           `firestore:"uid" json:"uid"`
	Status             ShiftStatusV2    `firestore:"status" json:"status"`
	InboundTrade       DirectionalTrade `firestore:"inbound_trade" json:"inbound_trade"`
	OutboundTrade      DirectionalTrade `firestore:"outbound_trade" json:"outbound_trade"`
	Timestamp          int64            `firestore:"timestamp" json:"timestamp"`
	Payment            PaymentWithFee   `firestore:"payment" json:"payment"`
	RefundAddr         string           `firestore:"refund_addr" json:"refund_addr"`
	ToCoin             string           `firestore:"to_coin" json:"to_coin"`
	ToAmount           int64            `firestore:"to_amount" json:"to_amount"`
	UserReceivedAmount float64          `firestore:"user_received_amount" json:"user_received_amount"`
	ToAddress          string           `firestore:"to_address" json:"to_address"`
	PaymentProof       string           `firestore:"payment_proof" json:"payment_proof"`
	ProofTimestamp     int64            `firestore:"proof_timestamp" json:"proof_timestamp"`
	Message            string           `firestore:"message" json:"message"`
	OriginalUsdRate    float64          `firestore:"original_rate" json:"original_rate"`
	LastUpdated        int64            `firestore:"last_updated" json:"last_updated"`
}

type ShiftV2TradeStatus

type ShiftV2TradeStatus int
const (
	ShiftV2TradeStatusInitialized ShiftV2TradeStatus = iota
	ShiftV2TradeStatusCreated
	ShiftV2TradeStatusPerforming
	ShiftV2TradeStatusCompleted
	ShiftV2TradeStatusWithdrawn         // just for outbound trade
	ShiftV2TradeStatusUserDeposit       // just for outbound trade
	ShiftV2TradeStatusWithdrawCompleted // just for outbound trade
)

type SimpleTx

type SimpleTx struct {
	Id             string         `firestore:"id" json:"id"`
	TxId           string         `firestore:"txid" json:"txid"`
	BalancerId     string         `firestore:"balancer_id" json:"balancer_id"`
	Exchange       string         `firestore:"exchange" json:"exchange"`
	Address        string         `firestore:"address" json:"address"`
	Currency       string         `firestore:"currency" json:"currency"`
	Amount         float64        `firestore:"amount" json:"amount"`
	ReceivedAmount float64        `firestore:"received_amount" json:"received_amount"`
	Status         SimpleTxStatus `firestore:"status" json:"status"`
	CreatedTime    int64          `firestore:"created_time" json:"created_time"`
	FulfilledTime  int64          `firestore:"fulfilled_time" json:"fulfilled_time"`
}

Represents either a withdrawal from a exchange to our hot wallet or a deposit from our hot wallet to a exchange

type SimpleTxStatus

type SimpleTxStatus int // For deposits or withdrawals to exchanges
const (
	SimpleTxStatusCreated SimpleTxStatus = iota
	SimpleTxStatusPerformed
	SimpleTxStatusCompleted
	SimpleTxStatusPlutusDeposit
)

type TokenVerification

type TokenVerification struct {
	Valid bool   `json:"valid"`
	UID   string `json:"uid"`
}

type Trade

type Trade struct {
	OrderId        string              `firestore:"order_id" json:"order_id"`
	Amount         float64             `firestore:"amount" json:"amount"`
	ReceivedAmount float64             `firestore:"received_amount" json:"received_amount"`
	FromCoin       string              `firestore:"from_coin" json:"from_coin"`
	ToCoin         string              `firestore:"to_coin" json:"to_coin"`
	Symbol         string              `firestore:"symbol" json:"symbol"`
	Side           string              `firestore:"side" json:"side"`
	Status         ExchangeOrderStatus `firestore:"status" json:"status"`
	Exchange       string              `firestore:"exchange" json:"exchange"`
	CreatedTime    int64               `firestore:"created_time" json:"created_time"`
	FulfilledTime  int64               `firestore:"fulfilled_time" json:"fulfilled_time"`
}

func (*Trade) GetTradingPair

func (t *Trade) GetTradingPair() (string, string)

type User

type User struct {
	ID         string         `firestore:"id" json:"id"`
	Email      string         `firestore:"email" json:"email"`
	KYCData    KYCInformation `firestore:"kyc_data" json:"kyc_data"`
	Role       string         `firestore:"role" json:"role"`
	Shifts     []string       `firestore:"shifts" json:"shifts"`
	Vouchers   []string       `firestore:"vouchers" json:"vouchers"`
	Deposits   []string       `firestore:"deposits" json:"deposits"`
	Cards      []string       `firestore:"cards" json:"cards"`
	Orders     []string       `firestore:"orders" json:"orders"`
	ShiftV2    []string       `firestore:"shift2" json:"shift2"`
	VouchersV2 []string       `firestore:"vouchers2" json:"vouchers2"`
}

type Voucher

type Voucher struct {
	ID                   string  `firestore:"id" json:"id"`
	UID                  string  `firestore:"uid" json:"uid"`
	VoucherID            int     `firestore:"voucher_id" json:"voucher_id"`
	VariantID            string  `firestore:"variant_id" json:"variant_id"`
	Name                 string  `firestore:"name" json:"name"`
	PaymentData          Payment `firestore:"payment_data" json:"payment_data"`
	FeePayment           Payment `firestore:"fee_payment" json:"fee_payment"`
	BitcouPaymentData    Payment `firestore:"bitcou_payment_data" json:"bitcou_payment_data"`
	BitcouFeePaymentData Payment `firestore:"bitcou_fee_payment_data" json:"bitcou_fee_payment_data"`
	RefundFeeAddr        string  `firestore:"refund_fee_addr" json:"refund_fee_addr"`
	RefundAddr           string  `firestore:"refund_addr" json:"refund_addr"`
	BitcouID             string  `firestore:"bitcou_id" json:"bitcou_id"`
	RedeemCode           string  `firestore:"redeem_code" json:"redeem_code"`
	Status               string  `firestore:"status" json:"status"`
	Timestamp            int64   `firestore:"timestamp" json:"timestamp"`
	RedeemTimestamp      int64   `firestore:"redeem_timestamp" json:"redeem_timestamp"`
	AmountEuro           string  `firestore:"amount_euro" json:"amount_euro"`
	AmountFeeEuro        string  `firestore:"amount_fee_euro" json:"amount_fee_euro"`
	Image                string  `firestore:"image" json:"image"`
	PhoneNumber          int64   `firestore:"phone_nb" json:"phone_nb"`
	ProviderId           int32   `firestore:"provider_id" json:"provider_id"`
	Valid                int32   `firestore:"valid" json:"valid"`
	Message              string  `firestore:"message" json:"message"`
	BitcouRefundData     Payment `firestore:"bitcou_refund_data" json:"bitcou_refund_data"`
	NewType              bool    `firestore:"new_type" json:"new_type"`
}

type VoucherShippingMethod

type VoucherShippingMethod int
const (
	VoucherShippingMethodEmail VoucherShippingMethod = iota
	VoucherShippingMethodAccount
	VoucherShippingMethodApi
)

type VoucherStatus

type VoucherStatus int
const (
	VoucherStatusPending VoucherStatus = iota
	VoucherStatusConfirmed
	VoucherStatusConfirming
	VoucherStatusAwaitingProvider
	VoucherStatusError
	VoucherStatusComplete
	VoucherStatusRefundTotal
	VoucherStatusRefundFee
	VoucherStatusRefunded
	VoucherStatusRefundedPartially
	VoucherStatusBitcouRefunded
)

type VoucherStatusV2

type VoucherStatusV2 int
const (
	VoucherStatusV2PaymentProcessing VoucherStatusV2 = iota
	VoucherStatusV2Redeemed
	VoucherStatusV2PerformingTrade
	VoucherStatusV2Complete
	VoucherStatusV2Refunded
	VoucherStatusV2Error
	VoucherStatusV2NeedsRefund
	VoucherStatusV2WaitingRefundTxId
	VoucherStatusV2BitcouPayed
)

type VoucherV2

type VoucherV2 struct {
	Id             string                `firestore:"id" json:"id"`
	CreatedTime    int64                 `firestore:"created_time" json:"created_time"`
	AmountEuro     float64               `firestore:"amount_euro" json:"amount_euro"`
	UserPayment    Payment               `firestore:"user_payment" json:"user_payment"`
	Status         VoucherStatusV2       `firestore:"status" json:"status"`
	RefundAddress  string                `firestore:"refund_address" json:"refund_address"`
	VoucherId      int                   `firestore:"voucher_id" json:"voucher_id"`
	VariantId      int                   `firestore:"variant_id" json:"variant_id"`
	BitcouTxId     string                `firestore:"bitcou_txid" json:"bitcou_txid"`
	UserId         string                `firestore:"user_id" json:"user_id"`
	RefundTxId     string                `firestore:"refund_txid" json:"refund_txid"`
	FulfilledTime  int64                 `firestore:"fulfilled_time" json:"fulfilled_time"`
	VoucherName    string                `firestore:"voucher_name" json:"voucher_name"`
	PhoneNumber    int64                 `firestore:"phone_number" json:"phone_number"`
	ProviderId     string                `firestore:"provider_id" json:"provider_id"`
	RedeemCode     string                `firestore:"redeem_code" json:"redeem_code"`
	Conversion     DirectionalTrade      `firestore:"conversion" json:"conversion"`
	ReceivedAmount float64               `firestore:"received_amount" json:"received_amount"`
	Email          string                `firestore:"email" json:"email"`
	ShippingMethod VoucherShippingMethod `firestore:"shipping_method" json:"shipping_method"`
	Message        string                `firestore:"message" json:"message"`
	Valid          int32                 `firestore:"valid" json:"valid"`
	Country        string                `firestore:"country" json:"country"`
	LastUpdated    int64                 `firestore:"last_updated" json:"last_updated"`
}

Jump to

Keyboard shortcuts

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