Documentation
¶
Index ¶
- Constants
- Variables
- func AllBrokersWithToken(ctx context.Context, decryptPIN bool) ([]map[string]string, error)
- func Authenticate(ctx context.Context, jwtToken string) (string, error)
- func CancelOrder(ctx context.Context, order *engine.Order) error
- func CancelOrderAction(ctx context.Context, orderId string, createdAt time.Time, userId string) error
- func CountPendingActions(ctx context.Context) (int64, error)
- func CountPendingTransfers(ctx context.Context) (int64, error)
- func CreateOrderAction(ctx context.Context, o *engine.Order, userId, brokerId string, ...) error
- func CreateRefundTransfer(ctx context.Context, brokerId, userId, assetId string, ...) error
- func ExpireTransfers(ctx context.Context, transfers []*Transfer) error
- func ReadProperty(ctx context.Context, key string) (string, error)
- func ReadPropertyAsTime(ctx context.Context, key string) (time.Time, error)
- func SetupSpanner(ctx context.Context, client *spanner.Client) context.Context
- func Spanner(ctx context.Context) *spanner.Client
- func Transact(ctx context.Context, taker, maker *engine.Order, amount number.Integer) (string, error)
- func UpdateUserPublicKey(ctx context.Context, userId, publicKey string) error
- func WriteProperty(ctx context.Context, key, value string) error
- func WriteTimeProperty(ctx context.Context, key string, value time.Time) error
- type Action
- type Broker
- type EdDSASigningMethod
- type Order
- type Property
- type Trade
- type Transfer
- type User
Constants ¶
View Source
const ( OrderStatePending = "PENDING" OrderStateDone = "DONE" )
View Source
const ( MakerFeeRate = "0.000" TakerFeeRate = "0.001" TradeLiquidityTaker = "TAKER" TradeLiquidityMaker = "MAKER" )
View Source
const ( TransferSourceTradeConfirmed = "TRADE_CONFIRMED" TransferSourceOrderCancelled = "ORDER_CANCELLED" TransferSourceOrderFilled = "ORDER_FILLED" TransferSourceOrderInvalid = "ORDER_INVALID" )
Variables ¶
View Source
var (
ErrEdDSAVerification = errors.New("crypto/eddsa: verification error")
)
Functions ¶
func AllBrokersWithToken ¶
func CancelOrderAction ¶
func CreateOrderAction ¶
func CreateRefundTransfer ¶
func ReadPropertyAsTime ¶
func UpdateUserPublicKey ¶
Types ¶
type Action ¶
type Broker ¶
type Broker struct {
BrokerId string `spanner:"broker_id"`
SessionId string `spanner:"session_id"`
SessionKey string `spanner:"session_key"`
PINToken string `spanner:"pin_token"`
EncryptedPIN string `spanner:"encrypted_pin"`
EncryptionHeader []byte `spanner:"encryption_header"`
CreatedAt time.Time `spanner:"created_at"`
DecryptedPIN string `spanner:"-"`
}
type EdDSASigningMethod ¶
type EdDSASigningMethod struct{}
var Ed25519SigningMethod *EdDSASigningMethod
func (*EdDSASigningMethod) Alg ¶
func (sm *EdDSASigningMethod) Alg() string
func (*EdDSASigningMethod) Sign ¶
func (sm *EdDSASigningMethod) Sign(signingString string, key interface{}) (string, error)
func (*EdDSASigningMethod) Verify ¶
func (sm *EdDSASigningMethod) Verify(signingString, signature string, key interface{}) error
type Order ¶
type Order struct {
OrderId string `spanner:"order_id"`
OrderType string `spanner:"order_type"`
QuoteAssetId string `spanner:"quote_asset_id"`
BaseAssetId string `spanner:"base_asset_id"`
Side string `spanner:"side"`
Price string `spanner:"price"`
RemainingAmount string `spanner:"remaining_amount"`
FilledAmount string `spanner:"filled_amount"`
RemainingFunds string `spanner:"remaining_funds"`
FilledFunds string `spanner:"filled_funds"`
CreatedAt time.Time `spanner:"created_at"`
State string `spanner:"state"`
UserId string `spanner:"user_id"`
BrokerId string `spanner:"broker_id"`
}
type Trade ¶
type Trade struct {
TradeId string `spanner:"trade_id"`
Liquidity string `spanner:"liquidity"`
AskOrderId string `spanner:"ask_order_id"`
BidOrderId string `spanner:"bid_order_id"`
QuoteAssetId string `spanner:"quote_asset_id"`
BaseAssetId string `spanner:"base_asset_id"`
Side string `spanner:"side"`
Price string `spanner:"price"`
Amount string `spanner:"amount"`
CreatedAt time.Time `spanner:"created_at"`
UserId string `spanner:"user_id"`
FeeAssetId string `spanner:"fee_asset_id"`
FeeAmount string `spanner:"fee_amount"`
}
func MarketTrades ¶
type Transfer ¶
type Transfer struct {
TransferId string `spanner:"transfer_id"`
Source string `spanner:"source"`
Detail string `spanner:"detail"`
AssetId string `spanner:"asset_id"`
Amount string `spanner:"amount"`
Fee string `spanner:"fee"`
CreatedAt time.Time `spanner:"created_at"`
UserId string `spanner:"user_id"`
BrokerId string `spanner:"broker_id"`
}
Click to show internal directories.
Click to hide internal directories.