provider

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MainnetNYHTTP = httpEndpoint(mainnetNY, true)
	MainnetUKHTTP = httpEndpoint(mainnetUK, true)
	MainnetNYWS   = wsEndpoint(mainnetNY, true)
	MainnetUKWS   = wsEndpoint(mainnetUK, true)
	MainnetNYGRPC = grpcEndpoint(mainnetNY, true)
	MainnetUKGRPC = grpcEndpoint(mainnetUK, true)

	TestnetHTTP = httpEndpoint(testnet, false)
	TestnetWS   = wsEndpoint(testnet, false)
	TestnetGRPC = grpcEndpoint(testnet, false)

	DevnetHTTP = httpEndpoint(devnet, false)
	DevnetWS   = wsEndpoint(devnet, false)
	DevnetGRPC = grpcEndpoint(devnet, false)

	LocalHTTP = "http://localhost:9000"
	LocalWS   = "ws://localhost:9000/ws"
	LocalGRPC = "localhost:9000"
)
View Source
var ErrPrivateKeyNotFound = errors.New("private key not provided for signing transaction")

Functions

func ProjectFromString

func ProjectFromString(project string) (pb.Project, error)

Types

type GRPCClient

type GRPCClient struct {
	pb.UnimplementedApiServer
	// contains filtered or unexported fields
}

func NewGRPCClient

func NewGRPCClient() (*GRPCClient, error)

NewGRPCClient connects to Mainnet Trader API

func NewGRPCClientWithOpts

func NewGRPCClientWithOpts(opts RPCOpts, dialOpts ...grpc.DialOption) (*GRPCClient, error)

NewGRPCClientWithOpts connects to custom Trader API

func NewGRPCDevnet

func NewGRPCDevnet() (*GRPCClient, error)

NewGRPCDevnet connects to Devnet Trader API

func NewGRPCLocal

func NewGRPCLocal() (*GRPCClient, error)

NewGRPCLocal connects to local Trader API

func NewGRPCTestnet

func NewGRPCTestnet() (*GRPCClient, error)

NewGRPCTestnet connects to Testnet Trader API

func (*GRPCClient) GetAccountBalance

func (g *GRPCClient) GetAccountBalance(ctx context.Context, owner string) (*pb.GetAccountBalanceResponse, error)

GetAccountBalance returns all tokens associated with the owner address including Serum unsettled amounts

func (*GRPCClient) GetBlockStream added in v1.4.0

GetBlockStream subscribes to a stream for getting recent blocks.

func (*GRPCClient) GetJupiterPrices added in v1.8.0

func (g *GRPCClient) GetJupiterPrices(ctx context.Context, request *pb.GetJupiterPricesRequest) (*pb.GetJupiterPricesResponse, error)

GetJupiterPrices returns the USDC price of requested tokens on Jupiter

func (*GRPCClient) GetJupiterQuotes added in v1.8.0

func (g *GRPCClient) GetJupiterQuotes(ctx context.Context, request *pb.GetJupiterQuotesRequest) (*pb.GetJupiterQuotesResponse, error)

GetJupiterQuotes returns the possible amount(s) of outToken for an inToken and the route to achieve it on Jupiter

func (*GRPCClient) GetMarketDepth added in v1.4.0

func (g *GRPCClient) GetMarketDepth(ctx context.Context, market string, limit uint32, project pb.Project) (*pb.GetMarketDepthResponse, error)

GetMarketDepth returns the requested market's coalesced price data (e.g. asks and bids). Set limit to 0 for all bids / asks.

func (*GRPCClient) GetMarketDepthV2 added in v1.8.0

func (g *GRPCClient) GetMarketDepthV2(ctx context.Context, market string, limit uint32) (*pb.GetMarketDepthResponseV2, error)

GetMarketDepthV2 returns the requested market's coalesced price data (e.g. asks and bids). Set limit to 0 for all bids / asks.

func (*GRPCClient) GetMarketDepthsStream added in v1.4.0

func (g *GRPCClient) GetMarketDepthsStream(ctx context.Context, markets []string, limit uint32, project pb.Project) (connections.Streamer[*pb.GetMarketDepthsStreamResponse], error)

GetMarketDepthsStream subscribes to a stream for changes to the requested market data updates (e.g. asks and bids. Set limit to 0 for all bids/ asks).

func (*GRPCClient) GetMarkets

func (g *GRPCClient) GetMarkets(ctx context.Context) (*pb.GetMarketsResponse, error)

GetMarkets returns the list of all available named markets

func (*GRPCClient) GetMarketsV2 added in v1.8.0

func (g *GRPCClient) GetMarketsV2(ctx context.Context) (*pb.GetMarketsResponseV2, error)

GetMarketsV2 returns the list of all available named markets

func (*GRPCClient) GetNewRaydiumPoolsStream added in v1.9.0

func (g *GRPCClient) GetNewRaydiumPoolsStream(
	ctx context.Context,
) (connections.Streamer[*pb.GetNewRaydiumPoolsResponse], error)

GetNewRaydiumPoolsStream subscribes to a stream for getting recent swaps on projects & markets of interest.

func (*GRPCClient) GetOpenOrders

func (g *GRPCClient) GetOpenOrders(ctx context.Context, market string, owner string, openOrdersAddress string, project pb.Project) (*pb.GetOpenOrdersResponse, error)

GetOpenOrders returns all open orders by owner address and market

func (*GRPCClient) GetOpenOrdersV2 added in v1.8.0

func (g *GRPCClient) GetOpenOrdersV2(ctx context.Context, market string, owner string, openOrdersAddress string, orderID string, clientOrderID uint64) (*pb.GetOpenOrdersResponseV2, error)

GetOpenOrdersV2 returns all open orders by owner address and market

func (*GRPCClient) GetOrderByID added in v1.6.0

GetOrderByID returns an order by id

func (*GRPCClient) GetOrderStatusStream

func (g *GRPCClient) GetOrderStatusStream(ctx context.Context, market, ownerAddress string, project pb.Project) (connections.Streamer[*pb.GetOrderStatusStreamResponse], error)

GetOrderStatusStream subscribes to a stream that shows updates to the owner's orders

func (*GRPCClient) GetOrderbook

func (g *GRPCClient) GetOrderbook(ctx context.Context, market string, limit uint32, project pb.Project) (*pb.GetOrderbookResponse, error)

GetOrderbook returns the requested market's orderbook (e.g. asks and bids). Set limit to 0 for all bids / asks.

func (*GRPCClient) GetOrderbookStream

func (g *GRPCClient) GetOrderbookStream(ctx context.Context, markets []string, limit uint32, project pb.Project) (connections.Streamer[*pb.GetOrderbooksStreamResponse], error)

GetOrderbookStream subscribes to a stream for changes to the requested market updates (e.g. asks and bids. Set limit to 0 for all bids/ asks).

func (*GRPCClient) GetOrderbookV2 added in v1.8.0

func (g *GRPCClient) GetOrderbookV2(ctx context.Context, market string, limit uint32) (*pb.GetOrderbookResponseV2, error)

GetOrderbookV2 returns the requested market's orderbook (e.g. asks and bids). Set limit to 0 for all bids / asks.

func (*GRPCClient) GetPoolReservesStream added in v1.2.0

func (g *GRPCClient) GetPoolReservesStream(ctx context.Context, projects []pb.Project) (connections.Streamer[*pb.GetPoolReservesStreamResponse], error)

GetPoolReservesStream subscribes to a stream for getting recent quotes of tokens of interest.

func (*GRPCClient) GetPools

func (g *GRPCClient) GetPools(ctx context.Context, projects []pb.Project) (*pb.GetPoolsResponse, error)

GetPools returns pools for given projects.

func (*GRPCClient) GetPrice

func (g *GRPCClient) GetPrice(ctx context.Context, tokens []string) (*pb.GetPriceResponse, error)

GetPrice returns the USDC price of requested tokens

func (*GRPCClient) GetPricesStream added in v1.2.0

func (g *GRPCClient) GetPricesStream(ctx context.Context, projects []pb.Project, tokens []string) (connections.Streamer[*pb.GetPricesStreamResponse], error)

GetPricesStream subscribes to a stream for getting recent prices of tokens of interest.

func (*GRPCClient) GetPriorityFee added in v1.9.3

func (g *GRPCClient) GetPriorityFee(ctx context.Context, request *pb.GetPriorityFeeRequest) (*pb.GetPriorityFeeResponse, error)

GetPriorityFee returns a priority fee estimate for a given percentile

func (*GRPCClient) GetPriorityFeeStream added in v1.9.3

func (g *GRPCClient) GetPriorityFeeStream(ctx context.Context, percentile *float64) (connections.Streamer[*pb.GetPriorityFeeResponse], error)

GetPriorityFeeStream subscribes to a stream of priority fees for a given percentile

func (*GRPCClient) GetQuotes

func (g *GRPCClient) GetQuotes(ctx context.Context, inToken, outToken string, inAmount, slippage float64, limit int32, projects []pb.Project) (*pb.GetQuotesResponse, error)

GetQuotes returns the possible amount(s) of outToken for an inToken and the route to achieve it

func (*GRPCClient) GetQuotesStream added in v1.2.0

func (g *GRPCClient) GetQuotesStream(ctx context.Context, projects []pb.Project, tokenPairs []*pb.TokenPair) (connections.Streamer[*pb.GetQuotesStreamResponse], error)

GetQuotesStream subscribes to a stream for getting recent quotes of tokens of interest.

func (*GRPCClient) GetRateLimit added in v1.9.3

func (g *GRPCClient) GetRateLimit(ctx context.Context, request *pb.GetRateLimitRequest) (*pb.GetRateLimitResponse, error)

GetRateLimit returns details of an account rate-limits

func (*GRPCClient) GetRaydiumPools added in v1.8.0

func (g *GRPCClient) GetRaydiumPools(ctx context.Context, request *pb.GetRaydiumPoolsRequest) (*pb.GetRaydiumPoolsResponse, error)

GetRaydiumPools returns pools on Raydium

func (*GRPCClient) GetRaydiumPrices added in v1.8.0

func (g *GRPCClient) GetRaydiumPrices(ctx context.Context, request *pb.GetRaydiumPricesRequest) (*pb.GetRaydiumPricesResponse, error)

GetRaydiumPrices returns the USDC price of requested tokens on Raydium

func (*GRPCClient) GetRaydiumQuotes added in v1.8.0

func (g *GRPCClient) GetRaydiumQuotes(ctx context.Context, request *pb.GetRaydiumQuotesRequest) (*pb.GetRaydiumQuotesResponse, error)

GetRaydiumQuotes returns the possible amount(s) of outToken for an inToken and the route to achieve it on Raydium

func (*GRPCClient) GetRecentBlockHash

func (g *GRPCClient) GetRecentBlockHash(ctx context.Context) (*pb.GetRecentBlockHashResponse, error)

func (*GRPCClient) GetRecentBlockHashStream

func (g *GRPCClient) GetRecentBlockHashStream(ctx context.Context) (connections.Streamer[*pb.GetRecentBlockHashResponse], error)

GetRecentBlockHashStream subscribes to a stream for getting recent block hash.

func (*GRPCClient) GetSwapsStream added in v1.2.0

func (g *GRPCClient) GetSwapsStream(
	ctx context.Context,
	projects []pb.Project,
	markets []string,
	includeFailed bool,
) (connections.Streamer[*pb.GetSwapsStreamResponse], error)

GetSwapsStream subscribes to a stream for getting recent swaps on projects & markets of interest.

func (*GRPCClient) GetTickers

func (g *GRPCClient) GetTickers(ctx context.Context, market string, project pb.Project) (*pb.GetTickersResponse, error)

GetTickers returns the requested market tickets. Set market to "" for all markets.

func (*GRPCClient) GetTickersV2 added in v1.8.0

func (g *GRPCClient) GetTickersV2(ctx context.Context, market string) (*pb.GetTickersResponseV2, error)

GetTickersV2 returns the requested market tickets. Set market to "" for all markets.

func (*GRPCClient) GetTrades

func (g *GRPCClient) GetTrades(ctx context.Context, market string, limit uint32, project pb.Project) (*pb.GetTradesResponse, error)

GetTrades returns the requested market's currently executing trades. Set limit to 0 for all trades.

func (*GRPCClient) GetTradesStream

func (g *GRPCClient) GetTradesStream(ctx context.Context, market string, limit uint32, project pb.Project) (connections.Streamer[*pb.GetTradesStreamResponse], error)

GetTradesStream subscribes to a stream for trades as they execute. Set limit to 0 for all trades.

func (*GRPCClient) GetTransaction added in v1.9.2

func (g *GRPCClient) GetTransaction(ctx context.Context, request *pb.GetTransactionRequest) (*pb.GetTransactionResponse, error)

GetTransaction returns details of a recent transaction

func (*GRPCClient) GetUnsettled

func (g *GRPCClient) GetUnsettled(ctx context.Context, market string, ownerAddress string, project pb.Project) (*pb.GetUnsettledResponse, error)

GetUnsettled returns all OpenOrders accounts for a given market with the amounts of unsettled funds

func (*GRPCClient) GetUnsettledV2 added in v1.8.0

func (g *GRPCClient) GetUnsettledV2(ctx context.Context, market string, ownerAddress string) (*pb.GetUnsettledResponse, error)

GetUnsettledV2 returns all OpenOrders accounts for a given market with the amounts of unsettled funds

func (*GRPCClient) PostCancelAll

func (g *GRPCClient) PostCancelAll(ctx context.Context, market, owner string, openOrders []string, project pb.Project) (*pb.PostCancelAllResponse, error)

func (*GRPCClient) PostCancelByClientOrderID

func (g *GRPCClient) PostCancelByClientOrderID(
	ctx context.Context,
	clientOrderID uint64,
	owner,
	market,
	openOrders string,
	project pb.Project,

) (*pb.PostCancelOrderResponse, error)

PostCancelByClientOrderID builds a Serum cancel order by client ID.

func (*GRPCClient) PostCancelOrder

func (g *GRPCClient) PostCancelOrder(
	ctx context.Context,
	orderID string,
	side pb.Side,
	owner,
	market,
	openOrders string,
	project pb.Project,
) (*pb.PostCancelOrderResponse, error)

PostCancelOrder builds a Serum cancel order.

func (*GRPCClient) PostCancelOrderV2 added in v1.8.0

func (g *GRPCClient) PostCancelOrderV2(
	ctx context.Context,
	orderID string,
	clientOrderID uint64,
	side string,
	owner,
	market,
	openOrders string,
) (*pb.PostCancelOrderResponseV2, error)

PostCancelOrderV2 builds a Serum cancel order.

func (*GRPCClient) PostJupiterRouteSwap added in v1.8.0

func (g *GRPCClient) PostJupiterRouteSwap(ctx context.Context, request *pb.PostJupiterRouteSwapRequest) (*pb.PostJupiterRouteSwapResponse, error)

PostJupiterRouteSwap returns a partially signed transaction(s) for submitting a swap request on Jupiter

func (*GRPCClient) PostJupiterSwap added in v1.8.0

func (g *GRPCClient) PostJupiterSwap(ctx context.Context, request *pb.PostJupiterSwapRequest) (*pb.PostJupiterSwapResponse, error)

PostJupiterSwap returns a partially signed transaction(s) for submitting a swap request on Jupiter

func (*GRPCClient) PostOrder

func (g *GRPCClient) PostOrder(ctx context.Context, owner, payer, market string, side pb.Side, types []common.OrderType, amount, price float64, project pb.Project, opts PostOrderOpts) (*pb.PostOrderResponse, error)

PostOrder returns a partially signed transaction for placing a Serum market order. Typically, you want to use SubmitOrder instead of this.

func (*GRPCClient) PostOrderV2 added in v1.8.0

func (g *GRPCClient) PostOrderV2(ctx context.Context, owner, payer, market string, side string, orderType string, amount, price float64, bundleTip *uint64, opts PostOrderOpts) (*pb.PostOrderResponse, error)

PostOrderV2 returns a partially signed transaction for placing a Serum market order. Typically, you want to use SubmitOrder instead of this.

func (*GRPCClient) PostOrderV2WithPriorityFee added in v1.9.0

func (g *GRPCClient) PostOrderV2WithPriorityFee(ctx context.Context, owner, payer, market string, side string,
	orderType string, amount, price float64, computeLimit uint32, computePrice uint64, bundleTip *uint64, opts PostOrderOpts) (*pb.PostOrderResponse, error)

PostOrderV2WithPriorityFee returns a partially signed transaction for placing a Serum market order. Typically, you want to use SubmitOrder instead of this.

func (*GRPCClient) PostRaydiumRouteSwap added in v1.8.0

func (g *GRPCClient) PostRaydiumRouteSwap(ctx context.Context, request *pb.PostRaydiumRouteSwapRequest) (*pb.PostRaydiumRouteSwapResponse, error)

PostRaydiumRouteSwap returns a partially signed transaction(s) for submitting a swap request on Raydium

func (*GRPCClient) PostRaydiumSwap added in v1.8.0

func (g *GRPCClient) PostRaydiumSwap(ctx context.Context, request *pb.PostRaydiumSwapRequest) (*pb.PostRaydiumSwapResponse, error)

PostRaydiumSwap returns a partially signed transaction(s) for submitting a swap request on Raydium

func (*GRPCClient) PostReplaceByClientOrderID

func (g *GRPCClient) PostReplaceByClientOrderID(ctx context.Context, owner, payer, market string, side pb.Side, types []common.OrderType, amount, price float64, project pb.Project, opts PostOrderOpts) (*pb.PostOrderResponse, error)

func (*GRPCClient) PostReplaceOrder

func (g *GRPCClient) PostReplaceOrder(ctx context.Context, orderID, owner, payer, market string, side pb.Side, types []common.OrderType, amount, price float64, project pb.Project, opts PostOrderOpts) (*pb.PostOrderResponse, error)

func (*GRPCClient) PostReplaceOrderV2 added in v1.8.0

func (g *GRPCClient) PostReplaceOrderV2(ctx context.Context, orderID, owner, payer, market string, side string, orderType string, amount, price float64, opts PostOrderOpts) (*pb.PostOrderResponse, error)

func (*GRPCClient) PostRouteTradeSwap added in v1.1.1

func (g *GRPCClient) PostRouteTradeSwap(ctx context.Context, request *pb.RouteTradeSwapRequest) (*pb.TradeSwapResponse, error)

PostRouteTradeSwap returns a partially signed transaction(s) for submitting a swap request

func (*GRPCClient) PostSettle

func (g *GRPCClient) PostSettle(ctx context.Context, owner, market, baseTokenWallet, quoteTokenWallet, openOrdersAccount string, project pb.Project) (*pb.PostSettleResponse, error)

PostSettle returns a partially signed transaction for settling market funds. Typically, you want to use SubmitSettle instead of this.

func (*GRPCClient) PostSettleV2 added in v1.8.0

func (g *GRPCClient) PostSettleV2(ctx context.Context, owner, market, baseTokenWallet, quoteTokenWallet, openOrdersAccount string) (*pb.PostSettleResponse, error)

PostSettleV2 returns a partially signed transaction for settling market funds. Typically, you want to use SubmitSettle instead of this.

func (*GRPCClient) PostSubmit

func (g *GRPCClient) PostSubmit(ctx context.Context, tx *pb.TransactionMessage, skipPreFlight bool, frontRunningProtection bool) (*pb.PostSubmitResponse, error)

PostSubmit posts the transaction string to the Solana network.

func (*GRPCClient) PostSubmitBatch added in v1.2.0

func (g *GRPCClient) PostSubmitBatch(ctx context.Context, request *pb.PostSubmitBatchRequest) (*pb.PostSubmitBatchResponse, error)

PostSubmitBatch posts a bundle of transactions string based on a specific SubmitStrategy to the Solana network.

func (*GRPCClient) PostSubmitBatchV2 added in v1.9.0

func (g *GRPCClient) PostSubmitBatchV2(ctx context.Context, request *pb.PostSubmitBatchRequest) (*pb.PostSubmitBatchResponse, error)

PostSubmitBatchV2 posts a bundle of transactions string based on a specific SubmitStrategy to the Solana network.

func (*GRPCClient) PostSubmitV2 added in v1.9.0

func (g *GRPCClient) PostSubmitV2(ctx context.Context, tx *pb.TransactionMessage, skipPreFlight bool, frontRunningProtection bool) (*pb.PostSubmitResponse, error)

PostSubmitV2 posts the transaction string to the Solana network.

func (*GRPCClient) PostTradeSwap

func (g *GRPCClient) PostTradeSwap(ctx context.Context, ownerAddress, inToken, outToken string, inAmount, slippage float64, project pb.Project) (*pb.TradeSwapResponse, error)

PostTradeSwap returns a partially signed transaction for submitting a swap request

func (*GRPCClient) RecentBlockHash

func (g *GRPCClient) RecentBlockHash(ctx context.Context) (*pb.GetRecentBlockHashResponse, error)

func (*GRPCClient) SignAndSubmit added in v1.9.3

func (g *GRPCClient) SignAndSubmit(ctx context.Context, tx *pb.TransactionMessage, skipPreFlight bool, frontRunningProtection bool) (string, error)

SignAndSubmit signs the given transaction and submits it.

func (*GRPCClient) SubmitCancelAll

func (g *GRPCClient) SubmitCancelAll(ctx context.Context, market, owner string, openOrdersAddresses []string, project pb.Project, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

func (*GRPCClient) SubmitCancelByClientOrderID

func (g *GRPCClient) SubmitCancelByClientOrderID(
	ctx context.Context,
	clientOrderID uint64,
	owner,
	market,
	openOrders string,
	project pb.Project,
	skipPreFlight bool,
) (string, error)

SubmitCancelByClientOrderID builds a Serum cancel order by client ID, signs and submits it to the network.

func (*GRPCClient) SubmitCancelOrder

func (g *GRPCClient) SubmitCancelOrder(
	ctx context.Context,
	orderID string,
	side pb.Side,
	owner,
	market,
	openOrders string,
	project pb.Project,
	skipPreFlight bool,
) (string, error)

SubmitCancelOrder builds a Serum cancel order, signs and submits it to the network.

func (*GRPCClient) SubmitCancelOrderV2 added in v1.8.0

func (g *GRPCClient) SubmitCancelOrderV2(
	ctx context.Context,
	orderID string,
	clientOrderID uint64,
	side string,
	owner,
	market,
	openOrders string,
	opts SubmitOpts,
) (*pb.PostSubmitBatchResponse, error)

SubmitCancelOrderV2 builds a Serum cancel order, signs and submits it to the network.

func (*GRPCClient) SubmitJupiterRouteSwap added in v1.8.0

func (g *GRPCClient) SubmitJupiterRouteSwap(ctx context.Context, request *pb.PostJupiterRouteSwapRequest, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

SubmitJupiterRouteSwap builds a Jupiter RouteSwap transaction then signs it, and submits to the network.

func (*GRPCClient) SubmitJupiterSwap added in v1.8.0

func (g *GRPCClient) SubmitJupiterSwap(ctx context.Context, request *pb.PostJupiterSwapRequest, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

SubmitJupiterSwap builds a Jupiter Swap transaction then signs it, and submits to the network.

func (*GRPCClient) SubmitOrder

func (g *GRPCClient) SubmitOrder(ctx context.Context, owner, payer, market string, side pb.Side, types []common.OrderType, amount, price float64, project pb.Project, opts PostOrderOpts) (string, error)

SubmitOrder builds a Serum market order, signs it, and submits to the network.

func (*GRPCClient) SubmitOrderV2 added in v1.8.0

func (g *GRPCClient) SubmitOrderV2(ctx context.Context, owner, payer, market string, side string, orderType string, amount, price float64, bundleTip *uint64, opts PostOrderOpts) (string, error)

SubmitOrderV2 builds a Serum market order, signs it, and submits to the network.

func (*GRPCClient) SubmitOrderV2WithPriorityFee added in v1.9.0

func (g *GRPCClient) SubmitOrderV2WithPriorityFee(ctx context.Context, owner, payer, market string, side string,
	orderType string, amount, price float64, computeLimit uint32, computePrice uint64, bundleTip *uint64, opts PostOrderOpts) (string, error)

SubmitOrderV2WithPriorityFee builds a Serum market order, signs it, and submits to the network with specified computeLimit and computePrice

func (*GRPCClient) SubmitRaydiumRouteSwap added in v1.8.0

func (g *GRPCClient) SubmitRaydiumRouteSwap(ctx context.Context, request *pb.PostRaydiumRouteSwapRequest, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

SubmitRaydiumRouteSwap builds a Raydium RouteSwap transaction then signs it, and submits to the network.

func (*GRPCClient) SubmitRaydiumSwap added in v1.8.0

func (g *GRPCClient) SubmitRaydiumSwap(ctx context.Context, request *pb.PostRaydiumSwapRequest, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

SubmitRaydiumSwap builds a Raydium Swap transaction then signs it, and submits to the network.

func (*GRPCClient) SubmitReplaceByClientOrderID

func (g *GRPCClient) SubmitReplaceByClientOrderID(ctx context.Context, owner, payer, market string, side pb.Side, types []common.OrderType, amount, price float64, project pb.Project, opts PostOrderOpts) (string, error)

func (*GRPCClient) SubmitReplaceOrder

func (g *GRPCClient) SubmitReplaceOrder(ctx context.Context, orderID, owner, payer, market string, side pb.Side, types []common.OrderType, amount, price float64, project pb.Project, opts PostOrderOpts) (string, error)

func (*GRPCClient) SubmitReplaceOrderV2 added in v1.8.0

func (g *GRPCClient) SubmitReplaceOrderV2(ctx context.Context, orderID, owner, payer, market string, side string, orderType string, amount, price float64, opts PostOrderOpts) (string, error)

func (*GRPCClient) SubmitRouteTradeSwap added in v1.1.1

func (g *GRPCClient) SubmitRouteTradeSwap(ctx context.Context, request *pb.RouteTradeSwapRequest, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

SubmitRouteTradeSwap builds a RouteTradeSwap transaction then signs it, and submits to the network.

func (*GRPCClient) SubmitSettle

func (g *GRPCClient) SubmitSettle(ctx context.Context, owner, market, baseTokenWallet, quoteTokenWallet, openOrdersAccount string, project pb.Project, skipPreflight bool) (string, error)

SubmitSettle builds a market SubmitSettle transaction, signs it, and submits to the network.

func (*GRPCClient) SubmitSettleV2 added in v1.8.0

func (g *GRPCClient) SubmitSettleV2(ctx context.Context, owner, market, baseTokenWallet, quoteTokenWallet, openOrdersAccount string, skipPreflight bool) (string, error)

SubmitSettleV2 builds a market SubmitSettle transaction, signs it, and submits to the network.

func (*GRPCClient) SubmitTradeSwap

func (g *GRPCClient) SubmitTradeSwap(ctx context.Context, ownerAddress, inToken, outToken string, inAmount, slippage float64, project pb.Project, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

SubmitTradeSwap builds a TradeSwap transaction then signs it, and submits to the network.

type HTTPClient

type HTTPClient struct {
	pb.UnimplementedApiServer
	// contains filtered or unexported fields
}

func NewHTTPClient

func NewHTTPClient() *HTTPClient

NewHTTPClient connects to Mainnet Trader API

func NewHTTPClientWithOpts

func NewHTTPClientWithOpts(client *http.Client, opts RPCOpts) *HTTPClient

NewHTTPClientWithOpts connects to custom Trader API (set client to nil to use default client)

func NewHTTPDevnet

func NewHTTPDevnet() *HTTPClient

NewHTTPDevnet connects to Devnet Trader API

func NewHTTPLocal

func NewHTTPLocal() *HTTPClient

NewHTTPLocal connects to local Trader API

func NewHTTPTestnet

func NewHTTPTestnet() *HTTPClient

NewHTTPTestnet connects to Testnet Trader API

func (*HTTPClient) GetAccountBalance

func (h *HTTPClient) GetAccountBalance(ctx context.Context, owner string) (*pb.GetAccountBalanceResponse, error)

GetAccountBalance returns all OpenOrders accounts for a given market with the amountsctx context.Context, of unsettled funds

func (*HTTPClient) GetJupiterPrices added in v1.8.0

func (h *HTTPClient) GetJupiterPrices(ctx context.Context, request *pb.GetJupiterPricesRequest) (*pb.GetJupiterPricesResponse, error)

GetJupiterPrices returns the USDC price of requested tokens on Jupiter

func (*HTTPClient) GetJupiterQuotes added in v1.8.0

func (h *HTTPClient) GetJupiterQuotes(ctx context.Context, request *pb.GetJupiterQuotesRequest) (*pb.GetJupiterQuotesResponse, error)

GetJupiterQuotes returns the possible amount(s) of outToken for an inToken and the route to achieve it on Jupiter

func (*HTTPClient) GetMarketDepth added in v1.4.0

func (h *HTTPClient) GetMarketDepth(ctx context.Context, market string, limit uint32, project pb.Project) (*pb.GetMarketDepthResponse, error)

GetMarketDepth returns the requested market's coalesced price data (e.h. asks and bids). Set limit to 0 for all bids / asks.

func (*HTTPClient) GetMarketDepthV2 added in v1.8.0

func (h *HTTPClient) GetMarketDepthV2(ctx context.Context, market string, limit uint32) (*pb.GetMarketDepthResponseV2, error)

GetMarketDepthV2 returns the requested market's coalesced price data (e.h. asks and bids). Set limit to 0 for all bids / asks.

func (*HTTPClient) GetMarkets

func (h *HTTPClient) GetMarkets(ctx context.Context) (*pb.GetMarketsResponse, error)

GetMarkets returns the list of all available named markets

func (*HTTPClient) GetMarketsV2 added in v1.8.0

func (h *HTTPClient) GetMarketsV2(ctx context.Context) (*pb.GetMarketsResponseV2, error)

GetMarketsV2 returns the list of all available named markets

func (*HTTPClient) GetOpenOrders

func (h *HTTPClient) GetOpenOrders(ctx context.Context, market string, owner string, openOrdersAddress string, project pb.Project) (*pb.GetOpenOrdersResponse, error)

GetOpenOrders returns all open orders by owner address and market

func (*HTTPClient) GetOpenOrdersV2 added in v1.8.0

func (h *HTTPClient) GetOpenOrdersV2(ctx context.Context, market string, owner string, openOrdersAddress string, orderID string, clientOrderID uint64) (*pb.GetOpenOrdersResponse, error)

GetOpenOrdersV2 returns all open orders by owner address and market

func (*HTTPClient) GetOrderByID added in v1.6.0

GetOrderByID returns an order by id

func (*HTTPClient) GetOrderbook

func (h *HTTPClient) GetOrderbook(ctx context.Context, market string, limit uint32, project pb.Project) (*pb.GetOrderbookResponse, error)

GetOrderbook returns the requested market's orderbook (e.h. asks and bids). Set limit to 0 for all bids / asks.

func (*HTTPClient) GetOrderbookV2 added in v1.8.0

func (h *HTTPClient) GetOrderbookV2(ctx context.Context, market string, limit uint32) (*pb.GetOrderbookResponseV2, error)

GetOrderbookV2 returns the requested market's orderbook (e.h. asks and bids). Set limit to 0 for all bids / asks.

func (*HTTPClient) GetPools

func (h *HTTPClient) GetPools(ctx context.Context, projects []pb.Project) (*pb.GetPoolsResponse, error)

GetPools returns pools for given projects.

func (*HTTPClient) GetPrice

func (h *HTTPClient) GetPrice(ctx context.Context, tokens []string) (*pb.GetPriceResponse, error)

GetPrice returns the USDC price of requested tokens

func (*HTTPClient) GetPriorityFee added in v1.9.3

func (h *HTTPClient) GetPriorityFee(ctx context.Context, percentile *float64) (*pb.GetPriorityFeeResponse, error)

func (*HTTPClient) GetQuotes

func (h *HTTPClient) GetQuotes(ctx context.Context, inToken, outToken string, inAmount, slippage float64, limit int32, projects []pb.Project) (*pb.GetQuotesResponse, error)

GetQuotes returns the possible amount(s) of outToken for an inToken and the route to achieve it

func (*HTTPClient) GetRateLimit added in v1.9.3

func (h *HTTPClient) GetRateLimit(ctx context.Context, request *pb.GetRateLimitRequest) (*pb.GetRateLimitResponse, error)

GetRateLimit returns details of an account rate-limits

func (*HTTPClient) GetRaydiumPools added in v1.8.0

func (h *HTTPClient) GetRaydiumPools(ctx context.Context, request *pb.GetRaydiumPoolsRequest) (*pb.GetRaydiumPoolsResponse, error)

GetRaydiumPools returns pools on Raydium

func (*HTTPClient) GetRaydiumPrices added in v1.8.0

func (h *HTTPClient) GetRaydiumPrices(ctx context.Context, request *pb.GetRaydiumPricesRequest) (*pb.GetRaydiumPricesResponse, error)

GetRaydiumPrices returns the USDC price of requested tokens on Raydium

func (*HTTPClient) GetRaydiumQuotes added in v1.8.0

func (h *HTTPClient) GetRaydiumQuotes(ctx context.Context, request *pb.GetRaydiumQuotesRequest) (*pb.GetRaydiumQuotesResponse, error)

GetRaydiumQuotes returns the possible amount(s) of outToken for an inToken and the route to achieve it on Raydium

func (*HTTPClient) GetRecentBlockHash

func (h *HTTPClient) GetRecentBlockHash(ctx context.Context) (*pb.GetRecentBlockHashResponse, error)

GetRecentBlockHash subscribes to a stream for getting recent block hash.

func (*HTTPClient) GetTickers

func (h *HTTPClient) GetTickers(ctx context.Context, market string, project pb.Project) (*pb.GetTickersResponse, error)

GetTickers returns the requested market tickets. Set market to "" for all markets.

func (*HTTPClient) GetTickersV2 added in v1.8.0

func (h *HTTPClient) GetTickersV2(ctx context.Context, market string) (*pb.GetTickersResponseV2, error)

GetTickersV2 returns the requested market tickets. Set market to "" for all markets.

func (*HTTPClient) GetTrades

func (h *HTTPClient) GetTrades(ctx context.Context, market string, limit uint32, project pb.Project) (*pb.GetTradesResponse, error)

GetTrades returns the requested market's currently executing trades. Set limit to 0 for all trades.

func (*HTTPClient) GetTransaction added in v1.9.2

func (h *HTTPClient) GetTransaction(ctx context.Context, request *pb.GetTransactionRequest) (*pb.GetTransactionResponse, error)

GetTransaction returns details of a recent transaction

func (*HTTPClient) GetUnsettled

func (h *HTTPClient) GetUnsettled(ctx context.Context, market string, owner string, project pb.Project) (*pb.GetUnsettledResponse, error)

GetUnsettled returns all OpenOrders accounts for a given market with the amounts of unsettled funds

func (*HTTPClient) GetUnsettledV2 added in v1.8.0

func (h *HTTPClient) GetUnsettledV2(ctx context.Context, market string, owner string) (*pb.GetUnsettledResponse, error)

GetUnsettledV2 returns all OpenOrders accounts for a given market with the amounts of unsettled funds

func (*HTTPClient) PostCancelAll

func (h *HTTPClient) PostCancelAll(ctx context.Context, market, owner string, openOrdersAddresses []string, project pb.Project) (*pb.PostCancelAllResponse, error)

func (*HTTPClient) PostCancelByClientOrderID

func (h *HTTPClient) PostCancelByClientOrderID(
	ctx context.Context,
	clientOrderID uint64,
	owner,
	market,
	openOrders string,
	project pb.Project,
) (*pb.PostCancelOrderResponse, error)

PostCancelByClientOrderID builds a Serum cancel order by client ID.

func (*HTTPClient) PostCancelOrder

func (h *HTTPClient) PostCancelOrder(
	ctx context.Context,
	orderID string,
	side pb.Side,
	owner,
	market,
	openOrders string,
	project pb.Project,
) (*pb.PostCancelOrderResponse, error)

PostCancelOrder builds a Serum cancel order.

func (*HTTPClient) PostCancelOrderV2 added in v1.8.0

func (h *HTTPClient) PostCancelOrderV2(
	ctx context.Context,
	orderID string,
	clientOrderID uint64,
	side string,
	owner,
	market,
	openOrders string,
) (*pb.PostCancelOrderResponseV2, error)

PostCancelOrderV2 builds a Serum cancel order.

func (*HTTPClient) PostJupiterRouteSwap added in v1.8.0

func (h *HTTPClient) PostJupiterRouteSwap(ctx context.Context, request *pb.PostJupiterRouteSwapRequest) (*pb.PostJupiterRouteSwapResponse, error)

PostJupiterRouteSwap returns a partially signed transaction(s) for submitting a swap request on Jupiter

func (*HTTPClient) PostJupiterSwap added in v1.8.0

func (h *HTTPClient) PostJupiterSwap(ctx context.Context, request *pb.PostJupiterSwapRequest) (*pb.PostJupiterSwapResponse, error)

PostJupiterSwap returns a partially signed transaction(s) for submitting a swap request on Jupiter

func (*HTTPClient) PostOrder

func (h *HTTPClient) PostOrder(ctx context.Context, owner, payer, market string, side pb.Side, types []common.OrderType, amount, price float64, project pb.Project, opts PostOrderOpts) (*pb.PostOrderResponse, error)

PostOrder returns a partially signed transaction for placing a Serum market order. Typically, you want to use SubmitOrder instead of this.

func (*HTTPClient) PostOrderV2 added in v1.8.0

func (h *HTTPClient) PostOrderV2(ctx context.Context, owner, payer, market string, side string, orderType string, amount,
	price float64, opts PostOrderOpts) (*pb.PostOrderResponse, error)

PostOrderV2 returns a partially signed transaction for placing a Serum market order. Typically, you want to use SubmitOrder instead of this.

func (*HTTPClient) PostOrderV2WithPriorityFee added in v1.9.0

func (h *HTTPClient) PostOrderV2WithPriorityFee(ctx context.Context, owner, payer, market string, side string,
	orderType string, amount, price float64, computeLimit uint32, computePrice uint64, opts PostOrderOpts) (*pb.PostOrderResponse, error)

PostOrderV2WithPriorityFee returns a partially signed transaction for placing a Serum market order. Typically, you want to use SubmitOrder instead of this.

func (*HTTPClient) PostRaydiumRouteSwap added in v1.8.0

func (h *HTTPClient) PostRaydiumRouteSwap(ctx context.Context, request *pb.PostRaydiumRouteSwapRequest) (*pb.PostRaydiumRouteSwapResponse, error)

PostRaydiumRouteSwap returns a partially signed transaction(s) for submitting a swap request on Raydium

func (*HTTPClient) PostRaydiumSwap added in v1.8.0

func (h *HTTPClient) PostRaydiumSwap(ctx context.Context, request *pb.PostRaydiumSwapRequest) (*pb.PostRaydiumSwapResponse, error)

PostRaydiumSwap returns a partially signed transaction(s) for submitting a swap request on Raydium

func (*HTTPClient) PostReplaceByClientOrderID

func (h *HTTPClient) PostReplaceByClientOrderID(ctx context.Context, owner, payer, market string, side pb.Side, types []common.OrderType, amount, price float64, project pb.Project, opts PostOrderOpts) (*pb.PostOrderResponse, error)

func (*HTTPClient) PostReplaceOrder

func (h *HTTPClient) PostReplaceOrder(ctx context.Context, orderID, owner, payer, market string, side pb.Side, types []common.OrderType, amount, price float64, project pb.Project, opts PostOrderOpts) (*pb.PostOrderResponse, error)

func (*HTTPClient) PostReplaceOrderV2 added in v1.8.0

func (h *HTTPClient) PostReplaceOrderV2(ctx context.Context, orderID, owner, payer, market string, side string, orderType string, amount, price float64, opts PostOrderOpts) (*pb.PostOrderResponse, error)

func (*HTTPClient) PostRouteTradeSwap added in v1.2.0

func (h *HTTPClient) PostRouteTradeSwap(ctx context.Context, request *pb.RouteTradeSwapRequest) (*pb.TradeSwapResponse, error)

PostRouteTradeSwap returns a partially signed transaction(s) for submitting a route swap request

func (*HTTPClient) PostSettle

func (h *HTTPClient) PostSettle(ctx context.Context, owner, market, baseTokenWallet, quoteTokenWallet, openOrdersAccount string, project pb.Project) (*pb.PostSettleResponse, error)

PostSettle returns a partially signed transaction for settling market funds. Typically, you want to use SubmitSettle instead of this.

func (*HTTPClient) PostSettleV2 added in v1.8.0

func (h *HTTPClient) PostSettleV2(ctx context.Context, owner, market, baseTokenWallet, quoteTokenWallet, openOrdersAccount string) (*pb.PostSettleResponse, error)

PostSettleV2 returns a partially signed transaction for settling market funds. Typically, you want to use SubmitSettle instead of this.

func (*HTTPClient) PostSubmit

func (h *HTTPClient) PostSubmit(ctx context.Context, txBase64 string, skipPreFlight bool, frontRunningProtection bool) (*pb.PostSubmitResponse, error)

PostSubmit posts the transaction string to the Solana network.

func (*HTTPClient) PostSubmitBatch added in v1.2.0

func (h *HTTPClient) PostSubmitBatch(ctx context.Context, request *pb.PostSubmitBatchRequest) (*pb.PostSubmitBatchResponse, error)

PostSubmitBatch posts a bundle of transactions string based on a specific SubmitStrategy to the Solana network.

func (*HTTPClient) PostSubmitBatchV2 added in v1.9.0

func (h *HTTPClient) PostSubmitBatchV2(ctx context.Context, request *pb.PostSubmitBatchRequest) (*pb.PostSubmitBatchResponse, error)

PostSubmitBatchV2 posts a bundle of transactions string based on a specific SubmitStrategy to the Solana network.

func (*HTTPClient) PostSubmitV2 added in v1.9.0

func (h *HTTPClient) PostSubmitV2(ctx context.Context, txBase64 string, skipPreFlight bool, frontRunningProtection bool) (*pb.PostSubmitResponse, error)

PostSubmitV2 posts the transaction string to the Solana network.

func (*HTTPClient) PostTradeSwap

func (h *HTTPClient) PostTradeSwap(ctx context.Context, ownerAddress, inToken, outToken string, inAmount, slippage float64, project pb.Project) (*pb.TradeSwapResponse, error)

PostTradeSwap returns a partially signed transaction for submitting a swap request

func (*HTTPClient) SignAndSubmit added in v1.8.0

func (h *HTTPClient) SignAndSubmit(ctx context.Context, tx *pb.TransactionMessage, skipPreFlight bool, frontRunningProtection bool) (string, error)

SignAndSubmit signs the given transaction and submits it.

func (*HTTPClient) SignAndSubmitBatch added in v1.8.0

func (h *HTTPClient) SignAndSubmitBatch(ctx context.Context, transactions []*pb.TransactionMessage, useBundle bool, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

SignAndSubmitBatch signs the given transactions and submits them.

func (*HTTPClient) SubmitCancelAll

func (h *HTTPClient) SubmitCancelAll(ctx context.Context, market, owner string, openOrders []string, project pb.Project, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

func (*HTTPClient) SubmitCancelByClientOrderID

func (h *HTTPClient) SubmitCancelByClientOrderID(
	ctx context.Context,
	clientOrderID uint64,
	owner,
	market,
	openOrders string,
	project pb.Project,
	skipPreFlight bool,
) (string, error)

SubmitCancelByClientOrderID builds a Serum cancel order by client ID, signs and submits it to the network.

func (*HTTPClient) SubmitCancelOrder

func (h *HTTPClient) SubmitCancelOrder(
	ctx context.Context,
	orderID string,
	side pb.Side,
	owner,
	market,
	openOrders string,
	project pb.Project,
	skipPreFlight bool,
) (string, error)

SubmitCancelOrder builds a Serum cancel order, signs and submits it to the network.

func (*HTTPClient) SubmitCancelOrderV2 added in v1.8.0

func (h *HTTPClient) SubmitCancelOrderV2(
	ctx context.Context,
	orderID string,
	clientOrderID uint64,
	side string,
	owner,
	market,
	openOrders string,
	opts SubmitOpts,
) (*pb.PostSubmitBatchResponse, error)

SubmitCancelOrderV2 builds a Serum cancel order, signs and submits it to the network.

func (*HTTPClient) SubmitJupiterRouteSwap added in v1.8.0

func (h *HTTPClient) SubmitJupiterRouteSwap(ctx context.Context, request *pb.PostJupiterRouteSwapRequest, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

SubmitJupiterRouteSwap builds a Jupiter RouteSwap transaction then signs it, and submits to the network.

func (*HTTPClient) SubmitJupiterSwap added in v1.8.0

func (h *HTTPClient) SubmitJupiterSwap(ctx context.Context, request *pb.PostJupiterSwapRequest, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

SubmitJupiterSwap builds a Jupiter Swap transaction then signs it, and submits to the network.

func (*HTTPClient) SubmitOrder

func (h *HTTPClient) SubmitOrder(ctx context.Context, owner, payer, market string, side pb.Side, types []common.OrderType, amount, price float64, project pb.Project, opts PostOrderOpts) (string, error)

SubmitOrder builds a Serum market order, signs it, and submits to the network.

func (*HTTPClient) SubmitOrderV2 added in v1.8.0

func (h *HTTPClient) SubmitOrderV2(ctx context.Context, owner, payer, market string, side string, orderType string,
	amount, price float64, opts PostOrderOpts) (string, error)

SubmitOrderV2 builds a Serum market order, signs it, and submits to the network.

func (*HTTPClient) SubmitOrderV2WithPriorityFee added in v1.9.0

func (h *HTTPClient) SubmitOrderV2WithPriorityFee(ctx context.Context, owner, payer, market string, side string,
	orderType string, amount, price float64, computeLimit uint32, computePrice uint64, opts PostOrderOpts) (string, error)

SubmitOrderV2WithPriorityFee builds a Serum market order, signs it, and submits to the network.

func (*HTTPClient) SubmitRaydiumRouteSwap added in v1.8.0

func (h *HTTPClient) SubmitRaydiumRouteSwap(ctx context.Context, request *pb.PostRaydiumRouteSwapRequest, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

SubmitRaydiumRouteSwap builds a Raydium RouteSwap transaction then signs it, and submits to the network.

func (*HTTPClient) SubmitRaydiumSwap added in v1.8.0

func (h *HTTPClient) SubmitRaydiumSwap(ctx context.Context, request *pb.PostRaydiumSwapRequest, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

SubmitRaydiumSwap builds a Raydium Swap transaction then signs it, and submits to the network.

func (*HTTPClient) SubmitReplaceByClientOrderID

func (h *HTTPClient) SubmitReplaceByClientOrderID(ctx context.Context, owner, payer, market string, side pb.Side, types []common.OrderType, amount, price float64, project pb.Project, opts PostOrderOpts) (string, error)

func (*HTTPClient) SubmitReplaceOrder

func (h *HTTPClient) SubmitReplaceOrder(ctx context.Context, orderID, owner, payer, market string, side pb.Side, types []common.OrderType, amount, price float64, project pb.Project, opts PostOrderOpts) (string, error)

func (*HTTPClient) SubmitReplaceOrderV2 added in v1.8.0

func (h *HTTPClient) SubmitReplaceOrderV2(ctx context.Context, orderID, owner, payer, market string, side string, orderType string, amount, price float64, opts PostOrderOpts) (string, error)

func (*HTTPClient) SubmitRouteTradeSwap added in v1.2.0

func (h *HTTPClient) SubmitRouteTradeSwap(ctx context.Context, request *pb.RouteTradeSwapRequest, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

SubmitRouteTradeSwap builds a RouteTradeSwap transaction then signs it, and submits to the network.

func (*HTTPClient) SubmitSettle

func (h *HTTPClient) SubmitSettle(ctx context.Context, owner, market, baseTokenWallet, quoteTokenWallet, openOrdersAccount string, project pb.Project, skipPreflight bool) (string, error)

SubmitSettle builds a market SubmitSettle transaction, signs it, and submits to the network.

func (*HTTPClient) SubmitSettleV2 added in v1.8.0

func (h *HTTPClient) SubmitSettleV2(ctx context.Context, owner, market, baseTokenWallet, quoteTokenWallet, openOrdersAccount string, skipPreflight bool) (string, error)

SubmitSettleV2 builds a market SubmitSettle transaction, signs it, and submits to the network.

func (*HTTPClient) SubmitTradeSwap

func (h *HTTPClient) SubmitTradeSwap(ctx context.Context, owner, inToken, outToken string, inAmount, slippage float64, project pb.Project, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

SubmitTradeSwap builds a TradeSwap transaction then signs it, and submits to the network.

type PostOrderOpts

type PostOrderOpts struct {
	OpenOrdersAddress string
	ClientOrderID     uint64
	SkipPreFlight     *bool
}

type RPCOpts

type RPCOpts struct {
	Endpoint       string
	DisableAuth    bool
	UseTLS         bool
	PrivateKey     *solana.PrivateKey
	AuthHeader     string
	CacheBlockHash bool
	BlockHashTtl   time.Duration
}

func DefaultRPCOpts

func DefaultRPCOpts(endpoint string) RPCOpts

type SubmitOpts added in v1.2.0

type SubmitOpts struct {
	SubmitStrategy pb.SubmitStrategy
	SkipPreFlight  *bool
}

type WSClient

type WSClient struct {
	pb.UnimplementedApiServer
	// contains filtered or unexported fields
}

func NewWSClient

func NewWSClient() (*WSClient, error)

NewWSClient connects to Mainnet Trader API

func NewWSClientDevnet

func NewWSClientDevnet() (*WSClient, error)

NewWSClientDevnet connects to Devnet Trader API

func NewWSClientLocal

func NewWSClientLocal() (*WSClient, error)

NewWSClientLocal connects to local Trader API

func NewWSClientTestnet

func NewWSClientTestnet() (*WSClient, error)

NewWSClientTestnet connects to Testnet Trader API

func NewWSClientWithOpts

func NewWSClientWithOpts(opts RPCOpts) (*WSClient, error)

NewWSClientWithOpts connects to custom Trader API

func (*WSClient) Close

func (w *WSClient) Close() error

func (*WSClient) GetAccountBalance

func (w *WSClient) GetAccountBalance(ctx context.Context, owner string) (*pb.GetAccountBalanceResponse, error)

GetAccountBalance returns all OpenOrders accounts for a given market with the amounts of unsettled funds

func (*WSClient) GetBlockStream added in v1.4.0

GetBlockStream subscribes to a stream for getting recent blocks.

func (*WSClient) GetJupiterPrices added in v1.8.0

func (w *WSClient) GetJupiterPrices(ctx context.Context, request *pb.GetJupiterPricesRequest) (*pb.GetJupiterPricesResponse, error)

GetJupiterPrices returns the USDC price of requested tokens on Jupiter

func (*WSClient) GetJupiterQuotes added in v1.8.0

func (w *WSClient) GetJupiterQuotes(ctx context.Context, request *pb.GetJupiterQuotesRequest) (*pb.GetJupiterQuotesResponse, error)

GetJupiterQuotes returns the possible amount(s) of outToken for an inToken and the route to achieve it on Jupiter

func (*WSClient) GetMarketDepth added in v1.4.0

func (w *WSClient) GetMarketDepth(ctx context.Context, market string, limit uint32, project pb.Project) (*pb.GetMarketDepthResponse, error)

GetMarketDepth returns the requested market's coalesced price data (e.g. asks and bids). Set limit to 0 for all bids / asks.

func (*WSClient) GetMarketDepthV2 added in v1.8.0

func (w *WSClient) GetMarketDepthV2(ctx context.Context, market string, limit uint32) (*pb.GetMarketDepthResponseV2, error)

GetMarketDepthV2 returns the requested market's coalesced price data (e.g. asks and bids). Set limit to 0 for all bids / asks.

func (*WSClient) GetMarketDepthsStream added in v1.4.0

func (w *WSClient) GetMarketDepthsStream(ctx context.Context, markets []string, limit uint32, project pb.Project) (connections.Streamer[*pb.GetMarketDepthsStreamResponse], error)

GetMarketDepthsStream subscribes to a stream for changes to the requested market data updates (e.g. asks and bids. Set limit to 0 for all bids/ asks).

func (*WSClient) GetMarkets

func (w *WSClient) GetMarkets(ctx context.Context) (*pb.GetMarketsResponse, error)

GetMarkets returns the list of all available named markets

func (*WSClient) GetMarketsV2 added in v1.8.0

func (w *WSClient) GetMarketsV2(ctx context.Context) (*pb.GetMarketsResponse, error)

GetMarketsV2 returns the list of all available named markets

func (*WSClient) GetNewRaydiumPoolsStream added in v1.9.0

func (w *WSClient) GetNewRaydiumPoolsStream(ctx context.Context) (connections.Streamer[*pb.GetNewRaydiumPoolsResponse], error)

GetNewRaydiumPoolsStream subscribes to a stream for new Raydium Pools when they are created.

func (*WSClient) GetOpenOrders

func (w *WSClient) GetOpenOrders(ctx context.Context, market string, owner string, openOrdersAddress string, project pb.Project) (*pb.GetOpenOrdersResponse, error)

GetOpenOrders returns all open orders by owner address and market

func (*WSClient) GetOpenOrdersV2 added in v1.8.0

func (w *WSClient) GetOpenOrdersV2(ctx context.Context, market string, owner string, openOrdersAddress string, orderID string, clientOrderID uint64) (*pb.GetOpenOrdersResponse, error)

GetOpenOrdersV2 returns all open orders by owner address and market

func (*WSClient) GetOrderByID added in v1.6.0

GetOrderByID returns an order by id

func (*WSClient) GetOrderStatusStream

func (w *WSClient) GetOrderStatusStream(ctx context.Context, market, ownerAddress string, project pb.Project) (connections.Streamer[*pb.GetOrderStatusStreamResponse], error)

GetOrderStatusStream subscribes to a stream that shows updates to the owner's orders

func (*WSClient) GetOrderbook

func (w *WSClient) GetOrderbook(ctx context.Context, market string, limit uint32, project pb.Project) (*pb.GetOrderbookResponse, error)

GetOrderbook returns the requested market's orderbook (e.g. asks and bids). Set limit to 0 for all bids / asks.

func (*WSClient) GetOrderbookV2 added in v1.8.0

func (w *WSClient) GetOrderbookV2(ctx context.Context, market string, limit uint32) (*pb.GetOrderbookResponseV2, error)

GetOrderbookV2 returns the requested market's orderbook (e.g. asks and bids). Set limit to 0 for all bids / asks.

func (*WSClient) GetOrderbooksStream

func (w *WSClient) GetOrderbooksStream(ctx context.Context, markets []string, limit uint32, project pb.Project) (connections.Streamer[*pb.GetOrderbooksStreamResponse], error)

GetOrderbooksStream subscribes to a stream for changes to the requested market updates (e.g. asks and bids. Set limit to 0 for all bids/ asks).

func (*WSClient) GetPoolReservesStream added in v1.2.0

func (w *WSClient) GetPoolReservesStream(ctx context.Context, projects []pb.Project) (connections.Streamer[*pb.GetPoolReservesStreamResponse], error)

GetPoolReservesStream subscribes to a stream for getting recent quotes of tokens of interest.

func (*WSClient) GetPools

func (w *WSClient) GetPools(ctx context.Context, projects []pb.Project) (*pb.GetPoolsResponse, error)

GetPools returns pools for given projects.

func (*WSClient) GetPrice

func (w *WSClient) GetPrice(ctx context.Context, tokens []string) (*pb.GetPriceResponse, error)

GetPrice returns the USDC price of requested tokens

func (*WSClient) GetPricesStream added in v1.2.0

func (w *WSClient) GetPricesStream(ctx context.Context, projects []pb.Project, tokens []string) (connections.Streamer[*pb.GetPricesStreamResponse], error)

GetPricesStream subscribes to a stream for getting recent quotes of tokens of interest.

func (*WSClient) GetPriorityFee added in v1.9.3

func (w *WSClient) GetPriorityFee(ctx context.Context, percentile *float64) (*pb.GetPriorityFeeResponse, error)

GetPriorityFee returns an suggested priority fee based on a given percentile

func (*WSClient) GetPriorityFeeStream added in v1.9.3

func (w *WSClient) GetPriorityFeeStream(ctx context.Context, percentile *float64) (connections.Streamer[*pb.GetPriorityFeeResponse], error)

GetPriorityFeeStream subscribes to a stream for getting a recent priority fee estimate based on a percentile.

func (*WSClient) GetQuotes

func (w *WSClient) GetQuotes(ctx context.Context, inToken, outToken string, inAmount, slippage float64, limit int32, projects []pb.Project) (*pb.GetQuotesResponse, error)

GetQuotes returns the possible amount(s) of outToken for an inToken and the route to achieve it

func (*WSClient) GetQuotesStream added in v1.2.0

func (w *WSClient) GetQuotesStream(ctx context.Context, projects []pb.Project, tokenPairs []*pb.TokenPair) (connections.Streamer[*pb.GetQuotesStreamResponse], error)

GetQuotesStream subscribes to a stream for getting recent quotes of tokens of interest.

func (*WSClient) GetRateLimit added in v1.9.3

func (w *WSClient) GetRateLimit(ctx context.Context, request *pb.GetRateLimitRequest) (*pb.GetRateLimitResponse, error)

GetRateLimit returns details of an account rate-limits

func (*WSClient) GetRaydiumPools added in v1.8.0

func (w *WSClient) GetRaydiumPools(ctx context.Context, request *pb.GetRaydiumPoolsRequest) (*pb.GetRaydiumPoolsResponse, error)

GetRaydiumPools returns pools on Raydium

func (*WSClient) GetRaydiumPrices added in v1.8.0

func (w *WSClient) GetRaydiumPrices(ctx context.Context, request *pb.GetRaydiumPricesRequest) (*pb.GetRaydiumPricesResponse, error)

GetRaydiumPrices returns the USDC price of requested tokens on Raydium

func (*WSClient) GetRaydiumQuotes added in v1.8.0

func (w *WSClient) GetRaydiumQuotes(ctx context.Context, request *pb.GetRaydiumQuotesRequest) (*pb.GetRaydiumQuotesResponse, error)

GetRaydiumQuotes returns the possible amount(s) of outToken for an inToken and the route to achieve it on Raydium

func (*WSClient) GetRecentBlockHashStream

func (w *WSClient) GetRecentBlockHashStream(ctx context.Context) (connections.Streamer[*pb.GetRecentBlockHashResponse], error)

GetRecentBlockHashStream subscribes to a stream for getting recent block hash.

func (*WSClient) GetSwapsStream added in v1.2.0

func (w *WSClient) GetSwapsStream(
	ctx context.Context,
	projects []pb.Project,
	markets []string,
	includeFailed bool,
) (connections.Streamer[*pb.GetSwapsStreamResponse], error)

GetSwapsStream subscribes to a stream for getting recent swaps on projects & markets of interest.

func (*WSClient) GetTickers

func (w *WSClient) GetTickers(ctx context.Context, market string, project pb.Project) (*pb.GetTickersResponse, error)

GetTickers returns the requested market tickets. Set market to "" for all markets.

func (*WSClient) GetTickersV2 added in v1.8.0

func (w *WSClient) GetTickersV2(ctx context.Context, market string) (*pb.GetTickersResponseV2, error)

GetTickersV2 returns the requested market tickets. Set market to "" for all markets.

func (*WSClient) GetTrades

func (w *WSClient) GetTrades(ctx context.Context, market string, limit uint32, project pb.Project) (*pb.GetTradesResponse, error)

GetTrades returns the requested market's currently executing trades. Set limit to 0 for all trades.

func (*WSClient) GetTradesStream

func (w *WSClient) GetTradesStream(ctx context.Context, market string, limit uint32, project pb.Project) (connections.Streamer[*pb.GetTradesStreamResponse], error)

GetTradesStream subscribes to a stream for trades as they execute. Set limit to 0 for all trades.

func (*WSClient) GetTransaction added in v1.9.2

func (w *WSClient) GetTransaction(ctx context.Context, request *pb.GetTransactionRequest) (*pb.GetTransactionResponse, error)

GetTransaction returns details of a recent transaction

func (*WSClient) GetUnsettled

func (w *WSClient) GetUnsettled(ctx context.Context, market string, ownerAddress string, project pb.Project) (*pb.GetUnsettledResponse, error)

GetUnsettled returns all OpenOrders accounts for a given market with the amounts of unsettled funds

func (*WSClient) GetUnsettledV2 added in v1.8.0

func (w *WSClient) GetUnsettledV2(ctx context.Context, market string, ownerAddress string) (*pb.GetUnsettledResponse, error)

GetUnsettledV2 returns all OpenOrders accounts for a given market with the amounts of unsettled funds

func (*WSClient) PostCancelAll

func (w *WSClient) PostCancelAll(
	ctx context.Context,
	market,
	owner string,
	openOrdersAddresses []string,
	project pb.Project,
) (*pb.PostCancelAllResponse, error)

func (*WSClient) PostCancelByClientOrderID

func (w *WSClient) PostCancelByClientOrderID(
	ctx context.Context,
	clientOrderID uint64,
	owner,
	market,
	openOrders string,
	project pb.Project,
) (*pb.PostCancelOrderResponse, error)

PostCancelByClientOrderID builds a Serum cancel order by client ID.

func (*WSClient) PostCancelOrder

func (w *WSClient) PostCancelOrder(ctx context.Context, request *pb.PostCancelOrderRequest) (*pb.PostCancelOrderResponse, error)

PostCancelOrder builds a Serum cancel order.

func (*WSClient) PostCancelOrderV2 added in v1.8.0

func (w *WSClient) PostCancelOrderV2(ctx context.Context, request *pb.PostCancelOrderRequestV2) (*pb.PostCancelOrderResponseV2, error)

PostCancelOrderV2 builds a Serum cancel order.

func (*WSClient) PostJupiterRouteSwap added in v1.8.0

func (w *WSClient) PostJupiterRouteSwap(ctx context.Context, request *pb.PostJupiterRouteSwapRequest) (*pb.PostJupiterRouteSwapResponse, error)

PostJupiterRouteSwap returns a partially signed transaction(s) for submitting a swap request on Jupiter

func (*WSClient) PostJupiterSwap added in v1.8.0

func (w *WSClient) PostJupiterSwap(ctx context.Context, request *pb.PostJupiterSwapRequest) (*pb.PostJupiterSwapResponse, error)

PostJupiterSwap returns a partially signed transaction(s) for submitting a swap request on Jupiter

func (*WSClient) PostOrder

func (w *WSClient) PostOrder(ctx context.Context, owner, payer, market string, side pb.Side, types []common.OrderType, amount, price float64, project pb.Project, opts PostOrderOpts) (*pb.PostOrderResponse, error)

PostOrder returns a partially signed transaction for placing a Serum market order. Typically, you want to use SubmitOrder instead of this.

func (*WSClient) PostOrderV2 added in v1.8.0

func (w *WSClient) PostOrderV2(ctx context.Context, owner, payer, market string, side string, orderType string, amount, price float64, opts PostOrderOpts) (*pb.PostOrderResponse, error)

PostOrderV2 returns a partially signed transaction for placing a Serum market order. Typically, you want to use SubmitOrder instead of this.

func (*WSClient) PostRaydiumRouteSwap added in v1.8.0

func (w *WSClient) PostRaydiumRouteSwap(ctx context.Context, request *pb.PostRaydiumRouteSwapRequest) (*pb.PostRaydiumRouteSwapResponse, error)

PostRaydiumRouteSwap returns a partially signed transaction(s) for submitting a swap request on Raydium

func (*WSClient) PostRaydiumSwap added in v1.8.0

func (w *WSClient) PostRaydiumSwap(ctx context.Context, request *pb.PostRaydiumSwapRequest) (*pb.PostRaydiumSwapResponse, error)

PostRaydiumSwap returns a partially signed transaction(s) for submitting a swap request on Raydium

func (*WSClient) PostReplaceByClientOrderID

func (w *WSClient) PostReplaceByClientOrderID(ctx context.Context, owner, payer, market string, side pb.Side, types []common.OrderType, amount, price float64, project pb.Project, opts PostOrderOpts) (*pb.PostOrderResponse, error)

func (*WSClient) PostReplaceOrder

func (w *WSClient) PostReplaceOrder(ctx context.Context, orderID, owner, payer, market string, side pb.Side, types []common.OrderType, amount, price float64, project pb.Project, opts PostOrderOpts) (*pb.PostOrderResponse, error)

func (*WSClient) PostReplaceOrderV2 added in v1.8.0

func (w *WSClient) PostReplaceOrderV2(ctx context.Context, orderID, owner, payer, market string, side string, orderType string, amount, price float64, opts PostOrderOpts) (*pb.PostOrderResponse, error)

func (*WSClient) PostRouteTradeSwap added in v1.1.1

func (w *WSClient) PostRouteTradeSwap(ctx context.Context, request *pb.RouteTradeSwapRequest) (*pb.TradeSwapResponse, error)

PostRouteTradeSwap returns a partially signed transaction(s) for submitting a swap request

func (*WSClient) PostSettle

func (w *WSClient) PostSettle(ctx context.Context, owner, market, baseTokenWallet, quoteTokenWallet, openOrdersAccount string, project pb.Project) (*pb.PostSettleResponse, error)

PostSettle returns a partially signed transaction for settling market funds. Typically, you want to use SubmitSettle instead of this.

func (*WSClient) PostSettleV2 added in v1.8.0

func (w *WSClient) PostSettleV2(ctx context.Context, owner, market, baseTokenWallet, quoteTokenWallet, openOrdersAccount string) (*pb.PostSettleResponse, error)

PostSettleV2 returns a partially signed transaction for settling market funds. Typically, you want to use SubmitSettle instead of this.

func (*WSClient) PostSubmit

func (w *WSClient) PostSubmit(ctx context.Context, txBase64 string, skipPreFlight bool, frontRunningProtection bool) (*pb.PostSubmitResponse, error)

PostSubmit posts the transaction string to the Solana network.

func (*WSClient) PostSubmitBatch added in v1.2.0

func (w *WSClient) PostSubmitBatch(ctx context.Context, request *pb.PostSubmitBatchRequest) (*pb.PostSubmitBatchResponse, error)

PostSubmitBatch posts a bundle of transactions string based on a specific SubmitStrategy to the Solana network.

func (*WSClient) PostSubmitBatchV2 added in v1.9.0

func (w *WSClient) PostSubmitBatchV2(ctx context.Context, request *pb.PostSubmitBatchRequest) (*pb.PostSubmitBatchResponse, error)

PostSubmitBatchV2 posts a bundle of transactions string based on a specific SubmitStrategy to the Solana network.

func (*WSClient) PostSubmitV2 added in v1.9.0

func (w *WSClient) PostSubmitV2(ctx context.Context, txBase64 string, skipPreFlight bool, useBundle bool) (*pb.PostSubmitResponse, error)

PostSubmitV2 posts the transaction string to the Solana network.

func (*WSClient) PostTradeSwap

func (w *WSClient) PostTradeSwap(ctx context.Context, ownerAddress, inToken, outToken string, inAmount, slippage float64, projectStr string) (*pb.TradeSwapResponse, error)

PostTradeSwap returns a partially signed transaction for submitting a swap request

func (*WSClient) PostTradeSwapWithPriorityFee added in v1.9.0

func (w *WSClient) PostTradeSwapWithPriorityFee(ctx context.Context, ownerAddress, inToken, outToken string, inAmount,
	slippage float64, computeLimit uint32, computePrice uint64, projectStr string) (*pb.TradeSwapResponse, error)

PostTradeSwapWithPriorityFee returns a partially signed transaction for submitting a swap request with computeLimit and computePrice

func (*WSClient) RecentBlockHash

func (w *WSClient) RecentBlockHash(ctx context.Context) (*pb.GetRecentBlockHashResponse, error)

func (*WSClient) SignAndSubmit added in v1.9.3

func (w *WSClient) SignAndSubmit(ctx context.Context, tx *pb.TransactionMessage, skipPreFlight bool, frontRunningProtection bool) (string, error)

SignAndSubmit signs the given transaction and submits it.

func (*WSClient) SignAndSubmitBatch added in v1.9.3

func (w *WSClient) SignAndSubmitBatch(ctx context.Context, transactions []*pb.TransactionMessage, useBundle bool, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

signAndSubmitBatch signs the given transactions and submits them.

func (*WSClient) SubmitCancelAll

func (w *WSClient) SubmitCancelAll(ctx context.Context, market, owner string, openOrdersAddresses []string, project pb.Project, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

func (*WSClient) SubmitCancelByClientOrderID

func (w *WSClient) SubmitCancelByClientOrderID(
	ctx context.Context,
	clientOrderID uint64,
	owner,
	market,
	openOrders string,
	project pb.Project,
	skipPreFlight bool,
) (string, error)

SubmitCancelByClientOrderID builds a Serum cancel order by client ID, signs and submits it to the network.

func (*WSClient) SubmitCancelOrder

func (w *WSClient) SubmitCancelOrder(ctx context.Context, request *pb.PostCancelOrderRequest, skipPreFlight bool) (string, error)

SubmitCancelOrder builds a Serum cancel order, signs and submits it to the network.

func (*WSClient) SubmitCancelOrderV2 added in v1.8.0

func (w *WSClient) SubmitCancelOrderV2(ctx context.Context, request *pb.PostCancelOrderRequestV2, skipPreFlight bool) (*pb.PostSubmitBatchResponse, error)

SubmitCancelOrderV2 builds a Serum cancel order, signs and submits it to the network.

func (*WSClient) SubmitJupiterRouteSwap added in v1.8.0

func (w *WSClient) SubmitJupiterRouteSwap(ctx context.Context, request *pb.PostJupiterRouteSwapRequest, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

SubmitJupiterRouteSwap builds a Jupiter RouteSwap transaction then signs it, and submits to the network.

func (*WSClient) SubmitJupiterSwap added in v1.8.0

func (w *WSClient) SubmitJupiterSwap(ctx context.Context, request *pb.PostJupiterSwapRequest, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

SubmitJupiterSwap builds a Jupiter Swap transaction then signs it, and submits to the network.

func (*WSClient) SubmitOrder

func (w *WSClient) SubmitOrder(ctx context.Context, owner, payer, market string, side pb.Side, types []common.OrderType, amount, price float64, project pb.Project, opts PostOrderOpts) (string, error)

SubmitOrder builds a Serum market order, signs it, and submits to the network.

func (*WSClient) SubmitOrderV2 added in v1.8.0

func (w *WSClient) SubmitOrderV2(ctx context.Context, owner, payer, market string, side string, orderType string, amount, price float64, opts PostOrderOpts) (string, error)

SubmitOrderV2 builds a Serum market order, signs it, and submits to the network.

func (*WSClient) SubmitRaydiumRouteSwap added in v1.8.0

func (w *WSClient) SubmitRaydiumRouteSwap(ctx context.Context, request *pb.PostRaydiumRouteSwapRequest, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

SubmitRaydiumRouteSwap builds a Raydium RouteSwap transaction then signs it, and submits to the network.

func (*WSClient) SubmitRaydiumSwap added in v1.8.0

func (w *WSClient) SubmitRaydiumSwap(ctx context.Context, request *pb.PostRaydiumSwapRequest, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

SubmitRaydiumSwap builds a Raydium Swap transaction then signs it, and submits to the network.

func (*WSClient) SubmitReplaceByClientOrderID

func (w *WSClient) SubmitReplaceByClientOrderID(ctx context.Context, owner, payer, market string, side pb.Side, types []common.OrderType, amount, price float64, project pb.Project, opts PostOrderOpts) (string, error)

func (*WSClient) SubmitReplaceOrder

func (w *WSClient) SubmitReplaceOrder(ctx context.Context, orderID, owner, payer, market string, side pb.Side, types []common.OrderType, amount, price float64, project pb.Project, opts PostOrderOpts) (string, error)

func (*WSClient) SubmitReplaceOrderV2 added in v1.8.0

func (w *WSClient) SubmitReplaceOrderV2(ctx context.Context, orderID, owner, payer, market string, side string, orderType string, amount, price float64, opts PostOrderOpts) (string, error)

func (*WSClient) SubmitRouteTradeSwap added in v1.1.1

func (w *WSClient) SubmitRouteTradeSwap(ctx context.Context, request *pb.RouteTradeSwapRequest, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

SubmitRouteTradeSwap builds a RouteTradeSwap transaction then signs it, and submits to the network.

func (*WSClient) SubmitSettle

func (w *WSClient) SubmitSettle(ctx context.Context, owner, market, baseTokenWallet, quoteTokenWallet, openOrdersAccount string, project pb.Project, skipPreflight bool) (string, error)

SubmitSettle builds a market SubmitSettle transaction, signs it, and submits to the network.

func (*WSClient) SubmitSettleV2 added in v1.8.0

func (w *WSClient) SubmitSettleV2(ctx context.Context, owner, market, baseTokenWallet, quoteTokenWallet, openOrdersAccount string, skipPreflight bool) (string, error)

SubmitSettleV2 builds a market SubmitSettle transaction, signs it, and submits to the network.

func (*WSClient) SubmitTradeSwap

func (w *WSClient) SubmitTradeSwap(ctx context.Context, owner, inToken, outToken string, inAmount, slippage float64, project string, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

SubmitTradeSwap builds a TradeSwap transaction then signs it, and submits to the network.

func (*WSClient) SubmitTradeSwapWithPriorityFee added in v1.9.0

func (w *WSClient) SubmitTradeSwapWithPriorityFee(ctx context.Context, owner, inToken, outToken string,
	inAmount, slippage float64, project string, computeLimit uint32, computePrice uint64, opts SubmitOpts) (*pb.PostSubmitBatchResponse, error)

SubmitTradeSwapWithPriorityFee builds a TradeSwap transaction then signs it, and submits to the network.

Jump to

Keyboard shortcuts

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