Versions in this module Expand all Collapse all v0 v0.1.4 Mar 13, 2026 v0.1.3 Mar 13, 2026 Changes in this version + type OrderUpdateReason string + const OrderReasonCanceled + const OrderReasonFilled + const OrderReasonPlaced v0.1.2 Mar 13, 2026 v0.1.1 Mar 13, 2026 v0.1.0 Mar 13, 2026 Changes in this version + const AppendixMaskIsolated + const AppendixMaskOrderType + const AppendixMaskReduceOnly + const AppendixMaskTriggerType + const AppendixMaskValue + const AppendixMaskVersion + const AppendixOffsetIsolated + const AppendixOffsetOrderType + const AppendixOffsetReduceOnly + const AppendixOffsetReserved + const AppendixOffsetTriggerType + const AppendixOffsetValue + const AppendixOffsetVersion + const AppendixOrderTypeDefault + const AppendixOrderTypeFOK + const AppendixOrderTypeIOC + const AppendixOrderTypePostOnly + const AppendixTriggerTypeNone + const AppendixTriggerTypePrice + const AppendixTriggerTypeTWAP + const AppendixTriggerTypeTWAPCustomAmounts + const AppendixVersion + const ArchiveV1URL + const ArchiveV2URL + const AuthRequestID + const ChainID + const EIP712DomainName + const EIP712DomainVersion + const EndpointAddress + const GatewayV1URL + const GatewayV2URL + const PingInterval + const ReadTimeout + const TriggerTypeNone + const TriggerTypePrice + const TriggerTypeTwap + const TriggerTypeTwapCustomAmounts + const TwapMaskSlippage + const TwapMaskTimes + const TwapOffsetSlippage + const TwapOffsetTimes + const TwapSlippageScale + const WsSubscriptionsURL + const WsURL + var CancelOrdersTypes = []apitypes.Type + var CancelProductOrdersTypes = []apitypes.Type + var ErrCredentialsRequired = errors.New("nado: credentials required") + var ErrInvalidOrderType = errors.New("nado: invalid order type") + var ErrInvalidSide = errors.New("nado: invalid side") + var ErrInvalidSymbol = errors.New("nado: invalid symbol") + var ErrNotAuthenticated = errors.New("nado: not authenticated") + var ErrTimeout = errors.New("nado: timeout") + var OrderTypes = []apitypes.Type + var StreamAuthenticationTypes = []apitypes.Type + func BuildAppendix(input ClientOrderInput) string + func BuildSender(address common.Address, subAccountName string) string + func GenOrderVerifyingContract(productID int64) string + func GetNonce() int64 + func MulX18(x, y *big.Int) *big.Int + func RoundX18(val, increment *big.Int) *big.Int + func ToBigInt(val string) *big.Int + func ToX18(v interface{}) *big.Int + type AccountInfo struct + Exists bool + HealthContributions []HealthContribution + Healths []Health + PerpBalances []Balance + PerpCount int + SpotBalances []Balance + SpotCount int + Subaccount string + type AccountProductOrders struct + Orders []Order + ProductID int64 + Sender string + type AccountSnapshotsQuery struct + Subaccounts []string + Timestamps []int64 + type ApiV1Response struct + Data json.RawMessage + Error string + ErrorCode int + RequestType string + Status string + type AprV2 struct + BorrowApr float64 + DepositApr float64 + Name string + ProductID string + Symbol string + Tvl float64 + type ArchiveCandlestick struct + CloseX18 string + Granularity int64 + HighX18 string + LowX18 string + OpenX18 string + ProductID int64 + SubmissionIdx string + Timestamp string + Volume string + type ArchiveMatchesRequest struct + Matches MatchesQuery + type ArchiveMatchesResponse struct + Matches []Match + Txs []Tx + type ArchiveSnapshotRequest struct + AccountSnapshots AccountSnapshotsQuery + type ArchiveSnapshotResponse struct + Snapshots []Snapshot + type AssetV2 struct + CanDeposit bool + CanWithdraw bool + MakerFee *float64 + MarketType string + Name string + ProductId int64 + Symbol string + TakerFee *float64 + TickerId string + type Balance struct + Balance struct{ ... } + ProductID int64 + type BaseWsClient struct + Logger *zap.SugaredLogger + func NewBaseWsClient(ctx context.Context, url string, onMessage func([]byte)) *BaseWsClient + func (c *BaseWsClient) Close() + func (c *BaseWsClient) Connect() error + func (c *BaseWsClient) IsConnected() bool + func (c *BaseWsClient) SendMessage(v interface{}) error + type CancelOrdersInput struct + Digests []string + ProductIds []int64 + type CancelOrdersResponse struct + CancelledOrders []Order + type CancelProductOrdersResponse struct + CancelledOrders []Order + type Candlestick struct + CloseX18 string + Granularity int32 + HighX18 string + LowX18 string + OpenX18 string + ProductId int64 + Timestamp string + Type string + Volume string + type CandlestickRequest struct + Candlesticks Candlesticks + type CandlestickResponse struct + Candlesticks []ArchiveCandlestick + type Candlesticks struct + Granularity int64 + Limit int + MaxTime int64 + ProductID int64 + type Client struct + Signer *Signer + func NewClient() *Client + func (c *Client) CancelAndPlace(ctx context.Context, cancelInput CancelOrdersInput, ...) (*PlaceOrderResponse, error) + func (c *Client) CancelOrders(ctx context.Context, input CancelOrdersInput) (*CancelOrdersResponse, error) + func (c *Client) CancelProductOrders(ctx context.Context, productIds []int64) (*CancelProductOrdersResponse, error) + func (c *Client) Execute(ctx context.Context, reqBody interface{}) ([]byte, error) + func (c *Client) GetAccount(ctx context.Context) (*AccountInfo, error) + func (c *Client) GetAccountMultiProductsOrders(ctx context.Context, productIDs []int64, sender string) (*AccountProductOrders, error) + func (c *Client) GetAccountProductOrders(ctx context.Context, productID int64, sender string) (*AccountProductOrders, error) + func (c *Client) GetAllFundingRates(ctx context.Context) ([]FundingRateData, error) + func (c *Client) GetApr(ctx context.Context) ([]AprV2, error) + func (c *Client) GetAssets(ctx context.Context) ([]AssetV2, error) + func (c *Client) GetCandlesticks(ctx context.Context, req CandlestickRequest) ([]ArchiveCandlestick, error) + func (c *Client) GetContracts(ctx context.Context, edge *bool) (ContractV2Map, error) + func (c *Client) GetContractsV1(ctx context.Context) (*ContractV1, error) + func (c *Client) GetFeeRates(ctx context.Context) (*FeeRates, error) + func (c *Client) GetFundingRate(ctx context.Context, productID int64) (*FundingRateData, error) + func (c *Client) GetMarketLiquidity(ctx context.Context, productID int64, depth int) (*MarketLiquidity, error) + func (c *Client) GetMarketPrice(ctx context.Context, productID int64) (*MarketPrice, error) + func (c *Client) GetMarketPrices(ctx context.Context, productID []int) ([]MarketPrice, error) + func (c *Client) GetMatches(ctx context.Context, subaccount string, productIDs []int64, limit int) (*ArchiveMatchesResponse, error) + func (c *Client) GetNonces(ctx context.Context) (*Nonce, error) + func (c *Client) GetOrder(ctx context.Context, productID int64, digest string) (*Order, error) + func (c *Client) GetOrderBook(ctx context.Context, tickerID string, depth int) (*OrderBookV2, error) + func (c *Client) GetPairs(ctx context.Context, market *string) ([]PairV2, error) + func (c *Client) GetSubaccountSnapshots(ctx context.Context, subaccounts []string, timestamps []int64) (*ArchiveSnapshotResponse, error) + func (c *Client) GetSymbols(ctx context.Context, productType *string) (*SymbolsInfo, error) + func (c *Client) GetTickers(ctx context.Context, market MarketType, edge *bool) (TickerV2Map, error) + func (c *Client) GetTrades(ctx context.Context, tickerID string, limit *int, maxTradeID *int64) ([]TradeV2, error) + func (c *Client) PlaceMarketOrder(ctx context.Context, params PlaceMarketOrderInput) (*PlaceOrderResponse, error) + func (c *Client) PlaceOrder(ctx context.Context, input ClientOrderInput) (*PlaceOrderResponse, error) + func (c *Client) QueryArchiveV1(ctx context.Context, params interface{}) (data []byte, err error) + func (c *Client) QueryArchiveV2(ctx context.Context, path string, params url.Values, dest interface{}) error + func (c *Client) QueryGateWayV1(ctx context.Context, method string, req map[string]interface{}) ([]byte, error) + func (c *Client) QueryGatewayV2(ctx context.Context, path string, params url.Values, dest interface{}) error + func (c *Client) WithCredentials(privateKey, subaccount string) (*Client, error) + type ClientOrderInput struct + Amount string + Isolated bool + IsolatedMargin float64 + OrderType OrderType + PostOnly bool + Price string + ProductId int64 + ReduceOnly bool + Side OrderSide + TriggerType int + TwapSlippage float64 + TwapTimes int + type ContractV1 struct + ChainID string + EndpointAddress string + type ContractV2 struct + BaseCurrency string + BaseVolume float64 + ContractPrice float64 + ContractPriceCurrency string + FundingRate float64 + IndexPrice float64 + LastPrice float64 + NextFundingRateTimestamp int64 + OpenInterest float64 + OpenInterestUsd float64 + PriceChangePercent24H float64 + ProductID int + ProductType string + QuoteCurrency string + QuoteVolume float64 + TickerID string + type ContractV2Map map[string]ContractV2 + type ExecTransaction struct + Digest *string + Signature string + Tx T + type FeeRate struct + MakerFeeRate string + TakerFeeRate string + type FeeRates struct + HealthCheckSequencerFee string + LiquidationSequencerFee string + MakerFeeRateX18 []string + TakerFeeRateX18 []string + TakerSequencerFee string + WithdrawSequencerFees []string + type Fill struct + Fee string + Price string + ProductId int64 + Side string + Size string + Time int64 + TradeId string + type FundingPayment struct + CumulativeFundingLongX18 string + CumulativeFundingShortX18 string + Dt int64 + OpenInterest string + PaymentAmount string + ProductId int64 + Timestamp string + Type string + type FundingRate struct + FundingRateX18 string + ProductId int64 + Timestamp string + Type string + UpdateTime int64 + type FundingRateData struct + FundingIntervalHours int64 + FundingRate string + FundingTime int64 + NextFundingTime int64 + ProductID int64 + Symbol string + UpdateTime int64 + type FundingRateResponse struct + FundingRateX18 string + ProductID int64 + UpdateTime string + type GetAccountMultiProductsOrders struct + ProductOrders []AccountProductOrders + Sender string + type Health struct + Assets string + Health string + Liabilities string + type HealthContribution [3]string + type Liquidation struct + Amount string + Liquidatee string + Liquidator string + Price string + ProductIds []int64 + Timestamp string + Type string + type MarketLiquidity struct + Asks [][2]string + Bids [][2]string + ProductID int64 + Timestamp string + type MarketPrice struct + AskX18 string + BidX18 string + ProductID int + type MarketPricesReq struct + ProductIds []int + Type string + type MarketType string + const MarketTypePerp + const MarketTypeSpot + type Match struct + BaseFilled string + ClosedAmount string + Digest string + Fee string + NetEntryCumulative string + NetEntryUnrealized string + Order MatchOrder + PostBalance MatchBalanceOuter + PreBalance MatchBalanceOuter + QuoteFilled string + RealizedPnL string + SequencerFee string + SubmissionIdx string + Timestamp string + type MatchBalanceBase struct + Perp *MatchBalancePerp + Spot *MatchBalanceSpot + type MatchBalanceOuter struct + Base MatchBalanceBase + type MatchBalancePerp struct + Balance struct{ ... } + ProductID int64 + type MatchBalanceSpot struct + Balance struct{ ... } + ProductID int64 + type MatchOrder struct + Amount string + Appendix string + Expiration string + Nonce string + PriceX18 string + Sender string + type MatchOrders struct + Maker TxMaker + ProductId int + Taker TxTaker + type MatchesQuery struct + Limit int + MaxTime int64 + ProductIds []int64 + Subaccounts []string + type Nonce struct + OrderNonce string + TxNonce string + type Order struct + Amount string + Appendix string + Digest string + Expiration string + Nonce string + OrderType string + PlacedAt int64 + PriceX18 string + ProductID int64 + Sender string + UnfilledAmount string + type OrderBook struct + Asks [][2]string + Bids [][2]string + LastMaxTimestamp string + MaxTimestamp string + MinTimestamp string + ProductId int64 + Type string + type OrderBookV2 struct + Asks [][2]float64 + Bids [][2]float64 + ProductId int64 + TickerId string + Timestamp int64 + type OrderSide string + const OrderSideBuy + const OrderSideSell + type OrderType string + const OrderTypeFOK + const OrderTypeIOC + const OrderTypeLimit + const OrderTypeMarket + const OrderTypeStopLoss + const OrderTypeStopLossLimit + const OrderTypeTakeProfit + const OrderTypeTakeProfitLimit + type OrderUpdate struct + Amount string + Digest string + Id int64 + ProductId int64 + Reason string + Timestamp string + Type string + type PairV2 struct + Base string + ProductId int64 + Quote string + TickerId string + type PlaceMarketOrderInput struct + Amount float64 + ProductId int64 + ReduceOnly bool + Side OrderSide + Slippage float64 + SpotLeverage *float64 + type PlaceOrder struct + ID int64 + Order PlaceOrderParams + ProductID int + Signature string + type PlaceOrderParams struct + Amount float64 + Appendix string + Expiration string + Nonce string + PriceX18 float64 + Sender string + type PlaceOrderRequest struct + PlaceOrder PlaceOrder + type PlaceOrderResponse struct + Digest string + type PositionChange struct + Amount string + EntryPrice string + ProductId int64 + Side string + type PreparedOrder struct + Digest string + Request map[string]interface{} + Signature string + Tx TxOrder + type Product struct + BaseAsset string + Decimals int + MinSize string + ProductId int64 + QuoteAsset string + Symbol string + TickSize string + type QueryRequest struct + Address string + Depth int + Limit int + OrderId string + ProductId *int64 + Type string + type Sender struct + Address string + SubAccount string + type Signer struct + func NewSigner(privateKeyHex string) (*Signer, error) + func (s *Signer) GetAddress() common.Address + func (s *Signer) SignCancelOrders(tx TxCancelOrders, verifyingContract string) (string, error) + func (s *Signer) SignCancelProductOrders(tx TxCancelProductOrders, verifyingContract string) (string, error) + func (s *Signer) SignOrder(order TxOrder, verifyingContract string) (string, string, error) + func (s *Signer) SignStreamAuthentication(tx TxStreamAuth, verifyingContract string) (string, error) + type Snapshot struct + Balances []SnapshotBalance + Subaccount string + Timestamp int64 + type SnapshotBalance struct + Balance Balance + NetFundingCumulative string + ProductID int64 + type StreamParams struct + Granularity int32 + ProductId *int64 + Subaccount string + Type string + type SubscriptionRequest struct + Id int64 + Method string + Stream StreamParams + type Symbol struct + LongWeightInitialX18 string + LongWeightMaintenanceX18 string + MakerFeeRateX18 string + MaxOpenInterestX18 *string + MinSize string + PriceIncrementX18 string + ProductID int + SizeIncrement string + Symbol string + TakerFeeRateX18 string + TradingStatus string + Type string + type SymbolsInfo struct + Symbols map[string]Symbol + type Ticker struct + AskPrice string + AskQty string + BidPrice string + BidQty string + ProductId int64 + Timestamp string + Type string + type TickerV2 struct + BaseCurrency string + BaseVolume float64 + LastPrice float64 + PriceChangePercent24H float64 + ProductID int + QuoteCurrency string + QuoteVolume float64 + TickerID string + type TickerV2Map map[string]TickerV2 + type Trade struct + IsTakerBuyer bool + MakerQty string + Price string + ProductId int64 + TakerQty string + Timestamp string + Type string + type TradeV2 struct + BaseFilled float64 + Price float64 + ProductID int + QuoteFilled float64 + TickerID string + Timestamp int64 + TradeID int64 + TradeType string + type Tx struct + SubmissionIdx string + Timestamp string + TxInfo TxInfo + type TxCancelOrder struct + Nonce string + ProductId uint32 + Sender string + type TxCancelOrders struct + Digests []string + Nonce string + ProductIds []int64 + Sender string + type TxCancelProductOrders struct + Nonce string + ProductIds []int64 + Sender string + type TxInfo struct + MatchOrders MatchOrders + type TxMaker struct + Order TxMatchOrder + Signature string + type TxMatchOrder struct + Amount string + Appendix string + Expiration uint64 + Nonce uint64 + PriceX18 string + Sender string + type TxOrder struct + Amount string + Appendix string + Expiration string + Nonce string + PriceX18 string + ProductId uint32 + Sender string + type TxStreamAuth struct + Expiration string + Sender string + type TxTaker struct + Order TxMatchOrder + Signature string + type WsAccountClient struct + Logger *zap.SugaredLogger + func NewWsAccountClient(ctx context.Context) *WsAccountClient + func (c *WsAccountClient) Close() + func (c *WsAccountClient) Connect() error + func (c *WsAccountClient) IsConnected() bool + func (c *WsAccountClient) Subscribe(stream StreamParams, callback func([]byte)) error + func (c *WsAccountClient) SubscribeFills(productId *int64, callback func(*Fill)) error + func (c *WsAccountClient) SubscribeOrders(productId *int64, callback func(*OrderUpdate)) error + func (c *WsAccountClient) SubscribePositions(productId *int64, callback func(*PositionChange)) error + func (c *WsAccountClient) Unsubscribe(stream StreamParams) error + func (c *WsAccountClient) UnsubscribeOrders(productId *int64) error + func (c *WsAccountClient) UnsubscribePositions(productId *int64) error + func (c *WsAccountClient) WithCredentials(privateKey string) *WsAccountClient + type WsApiClient struct + Logger *zap.SugaredLogger + Signer *Signer + func NewWsApiClient(ctx context.Context, privateKey string) (*WsApiClient, error) + func (c *WsApiClient) CancelAndPlace(ctx context.Context, cancelInput CancelOrdersInput, ...) (*PlaceOrderResponse, error) + func (c *WsApiClient) CancelOrders(ctx context.Context, input CancelOrdersInput) (*CancelOrdersResponse, error) + func (c *WsApiClient) Execute(ctx context.Context, req map[string]interface{}, sig *string) (*WsResponse, error) + func (c *WsApiClient) ExecutePreparedOrder(ctx context.Context, order *PreparedOrder) (*PlaceOrderResponse, error) + func (c *WsApiClient) PlaceOrder(ctx context.Context, input ClientOrderInput) (*PlaceOrderResponse, error) + func (c *WsApiClient) PrepareOrder(ctx context.Context, input ClientOrderInput) (*PreparedOrder, error) + func (c *WsApiClient) SetSubaccount(sub string) + func (c *WsApiClient) WsCancelProductOrders(txCancel TxCancelProductOrders) (*WsResponse, error) + type WsAuthRequest struct + Id int64 + Method string + Signature string + Tx TxStreamAuth + type WsMarketClient struct + Logger *zap.SugaredLogger + func NewWsMarketClient(ctx context.Context) *WsMarketClient + func (c *WsMarketClient) Close() + func (c *WsMarketClient) Connect() error + func (c *WsMarketClient) IsConnected() bool + func (c *WsMarketClient) Subscribe(stream StreamParams, callback func([]byte)) error + func (c *WsMarketClient) SubscribeFundingPayment(productId int64, callback func(*FundingPayment)) error + func (c *WsMarketClient) SubscribeFundingRate(productId *int64, callback func(*FundingRate)) error + func (c *WsMarketClient) SubscribeLatestCandlestick(productId int64, granularity int32, callback func(*Candlestick)) error + func (c *WsMarketClient) SubscribeLiquidation(productId *int64, callback func(*Liquidation)) error + func (c *WsMarketClient) SubscribeOrderBook(productId int64, callback func(*OrderBook)) error + func (c *WsMarketClient) SubscribeTicker(productId int64, callback func(*Ticker)) error + func (c *WsMarketClient) SubscribeTrades(productId int64, callback func(*Trade)) error + func (c *WsMarketClient) Unsubscribe(stream StreamParams) error + func (c *WsMarketClient) UnsubscribeLatestCandlestick(productId int64, granularity int32) error + func (c *WsMarketClient) UnsubscribeOrderBook(productId int64) error + func (c *WsMarketClient) UnsubscribeTicker(productId int64) error + func (c *WsMarketClient) UnsubscribeTrades(productId int64) error + type WsMessage struct + Channel string + Data json.RawMessage + Error string + ErrorCode int + Id int64 + Method string + Status string + Type string + type WsResponse struct + Data json.RawMessage + Error string + ErrorCode int + Id *int64 + RequestType string + Signature *string + Status string