aptos

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPackageAddress = "0x50ead22afd6ffd9769e3b3d6e0e64a2a350d68e8b102c4e72e33d0b8cfdfdb06"

Variables

This section is empty.

Functions

This section is empty.

Types

type CancelOrderRequest

type CancelOrderRequest struct {
	SubaccountAddr string
	OrderID        string
	MarketAddr     string
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(privateKey string, opts ...ClientOption) (*Client, error)

func (*Client) AccountAddress

func (c *Client) AccountAddress() string

func (*Client) CancelOrder

func (*Client) PlaceOrder

type ClientOption

type ClientOption func(*clientConfig) error

func WithPackageAddress

func WithPackageAddress(address string) ClientOption

func WithSubmitter

func WithSubmitter(s submitter) ClientOption

type OrderEncoder

type OrderEncoder interface {
	EncodePrice(price decimal.Decimal) (uint64, error)
	EncodeSize(size decimal.Decimal) (uint64, error)
}

type PlaceOrderRequest

type PlaceOrderRequest struct {
	SubaccountAddr         string
	MarketAddr             string
	Price                  decimal.Decimal
	Size                   decimal.Decimal
	Encoder                OrderEncoder
	IsBuy                  bool
	TimeInForce            TimeInForce
	ReduceOnly             bool
	ClientOrderID          *string
	StopPrice              *uint64
	TakeProfitTriggerPrice *uint64
	TakeProfitLimitPrice   *uint64
	StopLossTriggerPrice   *uint64
	StopLossLimitPrice     *uint64
	BuilderAddress         *string
	BuilderFees            *uint64
}

type TimeInForce

type TimeInForce uint8
const (
	TimeInForceGoodTillCancelled TimeInForce = iota
	TimeInForcePostOnly
	TimeInForceImmediateOrCancel
)

Jump to

Keyboard shortcuts

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