api

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: Apache-2.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package api is the contract (spec/openapi.yaml) as Go types: every schema of the engine's HTTP API, models only, generated by oapi-codegen with the same settings as the engine's own package, so an enum value has the same name on both sides (api.SignerAnswerKindShare, api.VenueBinance). The contract's Decimal is a string here too; nothing is parsed into a float.

Regenerate with `make gen` after the contract changes.

Package api provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	// ConfigRevision Bumped on every configuration change. Decisions record the revision they were evaluated under.
	ConfigRevision int       `json:"configRevision"`
	CreatedAt      time.Time `json:"createdAt"`

	// DefaultPortfolioId The account's default portfolio: the one an agent created without a
	// portfolio joins, and the one portfolio that cannot be deleted
	// (setDefaultPortfolio moves it).
	DefaultPortfolioId string `json:"defaultPortfolioId"`

	// Entitlements What the account's tier includes (plan doc, Pricing). Billing writes it
	// for hosted accounts and a self-hosted engine reads it from its signed
	// licence; the API only reads it. Safety is never gated: every rule, the
	// stop, the pause, cancels, exits and approvals are in every tier.
	Entitlements Entitlements `json:"entitlements"`
	Id           string       `json:"id"`

	// KillSwitch True while all trading is stopped (killAccount): every proposal
	// from every agent is refused, reduce-only included. Nothing is
	// closed or cancelled; positions and resting orders stay at the venue.
	KillSwitch bool   `json:"killSwitch"`
	Name       string `json:"name"`

	// Paused True while all trading is paused (pauseAccount): only reduce-only
	// orders pass, so agents can close their own positions. A stop
	// outranks a pause.
	Paused bool `json:"paused"`
}

Account defines model for Account.

type Agent

type Agent struct {
	CreatedAt      time.Time   `json:"createdAt"`
	Description    *string     `json:"description,omitempty"`
	Id             string      `json:"id"`
	Keys           []AgentKey  `json:"keys"`
	LastDecisionAt *time.Time  `json:"lastDecisionAt,omitempty"`
	Name           string      `json:"name"`
	PortfolioId    string      `json:"portfolioId"`
	Status         AgentStatus `json:"status"`

	// TradingAccountIds The trading accounts the agent holds an unrevoked venue key on. Derived from `venueKeys`.
	TradingAccountIds []string  `json:"tradingAccountIds"`
	UpdatedAt         time.Time `json:"updatedAt"`

	// VenueKeys The agent's trading keys, one per trading account it may use.
	VenueKeys []VenueKey `json:"venueKeys"`
}

Agent defines model for Agent.

type AgentCreate

type AgentCreate struct {
	Description *string `json:"description,omitempty"`
	Name        string  `json:"name"`

	// PortfolioId Absent for the account's default portfolio (Account.defaultPortfolioId).
	PortfolioId *string `json:"portfolioId,omitempty"`
}

AgentCreate defines model for AgentCreate.

type AgentGetPnlParams

type AgentGetPnlParams struct {
	From *openapi_types.Date `form:"from,omitempty" json:"from,omitempty"`
	To   *openapi_types.Date `form:"to,omitempty" json:"to,omitempty"`
}

AgentGetPnlParams defines parameters for AgentGetPnl.

type AgentGetVenueRulesParams

type AgentGetVenueRulesParams struct {
	// Symbol Only this symbol.
	Symbol *string `form:"symbol,omitempty" json:"symbol,omitempty"`
}

AgentGetVenueRulesParams defines parameters for AgentGetVenueRules.

type AgentId

type AgentId = string

AgentId defines model for agentId.

type AgentKey

type AgentKey struct {
	CreatedAt time.Time `json:"createdAt"`

	// Id key_<account suffix>_<12 random characters>; the account id is readable off it (acc_<suffix>), so a hosted router can map a proposal to its account's cell from the key id alone.
	Id         string     `json:"id"`
	LastUsedAt *time.Time `json:"lastUsedAt,omitempty"`

	// Prefix First characters of the key, enough to recognise it. Never the secret.
	Prefix string `json:"prefix"`

	// PublicKey The agent's Ed25519 public key, base64. The engine verifies proposal signatures with it.
	PublicKey *string    `json:"publicKey,omitempty"`
	RevokedAt *time.Time `json:"revokedAt,omitempty"`
}

AgentKey defines model for AgentKey.

type AgentKeyIssued

type AgentKeyIssued struct {
	CreatedAt time.Time `json:"createdAt"`

	// Id key_<account suffix>_<12 random characters>; the account id is readable off it (acc_<suffix>), so a hosted router can map a proposal to its account's cell from the key id alone.
	Id         string     `json:"id"`
	LastUsedAt *time.Time `json:"lastUsedAt,omitempty"`

	// Prefix First characters of the key, enough to recognise it. Never the secret.
	Prefix string `json:"prefix"`

	// PublicKey The agent's Ed25519 public key, base64. The engine verifies proposal signatures with it.
	PublicKey *string    `json:"publicKey,omitempty"`
	RevokedAt *time.Time `json:"revokedAt,omitempty"`

	// Secret The agent's Ed25519 private key seed, base64. Shown once. The
	// engine keeps only the public key, so a leaked engine database
	// cannot sign as the agent.
	Secret string `json:"secret"`
}

AgentKeyIssued defines model for AgentKeyIssued.

type AgentListApprovalsParams

type AgentListApprovalsParams struct {
	Status *ApprovalStatus `form:"status,omitempty" json:"status,omitempty"`
}

AgentListApprovalsParams defines parameters for AgentListApprovals.

type AgentListDecisionsParams

type AgentListDecisionsParams struct {
	TradingAccountId *string    `form:"tradingAccountId,omitempty" json:"tradingAccountId,omitempty"`
	Verdict          *Verdict   `form:"verdict,omitempty" json:"verdict,omitempty"`
	From             *time.Time `form:"from,omitempty" json:"from,omitempty"`
	To               *time.Time `form:"to,omitempty" json:"to,omitempty"`
	Cursor           *string    `form:"cursor,omitempty" json:"cursor,omitempty"`
	Limit            *int       `form:"limit,omitempty" json:"limit,omitempty"`
}

AgentListDecisionsParams defines parameters for AgentListDecisions.

type AgentStatus

type AgentStatus string

AgentStatus defines model for AgentStatus.

const (
	AgentStatusActive AgentStatus = "active"
	AgentStatusKilled AgentStatus = "killed"
	AgentStatusPaused AgentStatus = "paused"
)

Defines values for AgentStatus.

func (AgentStatus) Valid

func (e AgentStatus) Valid() bool

Valid indicates whether the value is a known member of the AgentStatus enum.

type AgentUnauthorized

type AgentUnauthorized = Error

AgentUnauthorized defines model for AgentUnauthorized.

type AgentUpdate

type AgentUpdate struct {
	Description *string `json:"description,omitempty"`
	Name        *string `json:"name,omitempty"`
	PortfolioId *string `json:"portfolioId,omitempty"`
}

AgentUpdate defines model for AgentUpdate.

type Approval

type Approval struct {
	Comment     *string        `json:"comment,omitempty"`
	DecidedAt   *time.Time     `json:"decidedAt,omitempty"`
	DecidedBy   *string        `json:"decidedBy,omitempty"`
	Decision    Decision       `json:"decision"`
	DecisionId  string         `json:"decisionId"`
	ExpiresAt   time.Time      `json:"expiresAt"`
	Id          string         `json:"id"`
	RequestedAt time.Time      `json:"requestedAt"`
	Status      ApprovalStatus `json:"status"`
}

Approval defines model for Approval.

type ApprovalDecide

type ApprovalDecide struct {
	Comment *string `json:"comment,omitempty"`
}

ApprovalDecide defines model for ApprovalDecide.

type ApprovalId

type ApprovalId = string

ApprovalId defines model for approvalId.

type ApprovalOutcome

type ApprovalOutcome struct {
	Comment     *string        `json:"comment,omitempty"`
	DecidedAt   *time.Time     `json:"decidedAt,omitempty"`
	DecidedBy   *string        `json:"decidedBy,omitempty"`
	ExpiresAt   time.Time      `json:"expiresAt"`
	Id          string         `json:"id"`
	RequestedAt time.Time      `json:"requestedAt"`
	Status      ApprovalStatus `json:"status"`
}

ApprovalOutcome defines model for ApprovalOutcome.

type ApprovalStatus

type ApprovalStatus string

ApprovalStatus defines model for ApprovalStatus.

const (
	ApprovalStatusApproved ApprovalStatus = "approved"
	ApprovalStatusExpired  ApprovalStatus = "expired"
	ApprovalStatusPending  ApprovalStatus = "pending"
	ApprovalStatusRejected ApprovalStatus = "rejected"
)

Defines values for ApprovalStatus.

func (ApprovalStatus) Valid

func (e ApprovalStatus) Valid() bool

Valid indicates whether the value is a known member of the ApprovalStatus enum.

type ApproveApprovalJSONRequestBody

type ApproveApprovalJSONRequestBody = ApprovalDecide

ApproveApprovalJSONRequestBody defines body for ApproveApproval for application/json ContentType.

type CommitmentBatch

type CommitmentBatch struct {
	// BatchSize The account's entitlement (Entitlements.commitmentBatch).
	BatchSize int `json:"batchSize"`

	// EngineInstance The engine instance that issued the batch; it changes each time
	// the engine starts. The engine keeps the secret half of each
	// commitment in memory only (written down, a restored backup could
	// sign two messages with one nonce and give the engine's key share
	// away), so after a restart the batch is unknown to it and a
	// proposal using one is refused with 409. The signer poll names the
	// current instance, so a signer drops a stale batch before it
	// proposes with it.
	EngineInstance string             `json:"engineInstance"`
	Items          []EngineCommitment `json:"items"`

	// Outstanding Unused commitments the signer holds for this key, these included.
	Outstanding int `json:"outstanding"`

	// Scheme The protocol a sign request runs, decided by the venue key's scheme (VenueKeyScheme), never chosen by anyone.
	Scheme     SigningScheme `json:"scheme"`
	VenueKeyId string        `json:"venueKeyId"`
}

CommitmentBatch defines model for CommitmentBatch.

type CommitmentRequest

type CommitmentRequest struct {
	// Count How many the signer wants. Default and cap, the entitlement less what it already holds unused.
	Count      *int   `json:"count,omitempty"`
	VenueKeyId string `json:"venueKeyId"`
}

CommitmentRequest defines model for CommitmentRequest.

type CosignerCallbackSetup

type CosignerCallbackSetup struct {
	// ApiUserId The Fireblocks API user that maps to this trading account.
	ApiUserId         *string `json:"apiUserId,omitempty"`
	CallbackPublicKey string  `json:"callbackPublicKey"`

	// CallbackUrl Register this as the co-signer callback.
	CallbackUrl string                    `json:"callbackUrl"`
	Kind        CosignerCallbackSetupKind `json:"kind"`
}

CosignerCallbackSetup defines model for CosignerCallbackSetup.

type CosignerCallbackSetupKind

type CosignerCallbackSetupKind string

CosignerCallbackSetupKind defines model for CosignerCallbackSetup.Kind.

const (
	CosignerCallbackSetupKindCosignerCallback CosignerCallbackSetupKind = "cosigner_callback"
)

Defines values for CosignerCallbackSetupKind.

func (CosignerCallbackSetupKind) Valid

func (e CosignerCallbackSetupKind) Valid() bool

Valid indicates whether the value is a known member of the CosignerCallbackSetupKind enum.

type CreateAgentJSONRequestBody

type CreateAgentJSONRequestBody = AgentCreate

CreateAgentJSONRequestBody defines body for CreateAgent for application/json ContentType.

type CreatePortfolioJSONRequestBody

type CreatePortfolioJSONRequestBody = PortfolioCreate

CreatePortfolioJSONRequestBody defines body for CreatePortfolio for application/json ContentType.

type CreateRuleJSONRequestBody

type CreateRuleJSONRequestBody = RuleCreate

CreateRuleJSONRequestBody defines body for CreateRule for application/json ContentType.

type CreateTradingAccountJSONRequestBody

type CreateTradingAccountJSONRequestBody = TradingAccountCreate

CreateTradingAccountJSONRequestBody defines body for CreateTradingAccount for application/json ContentType.

type CreateVenueKeyJSONRequestBody

type CreateVenueKeyJSONRequestBody = VenueKeyCreate

CreateVenueKeyJSONRequestBody defines body for CreateVenueKey for application/json ContentType.

type CreateWalletApprovalJSONRequestBody

type CreateWalletApprovalJSONRequestBody = WalletApprovalRequest

CreateWalletApprovalJSONRequestBody defines body for CreateWalletApproval for application/json ContentType.

type Decimal

type Decimal = string

Decimal A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and quantities are never JSON numbers. A string survives every language's float formatting unchanged, so the bytes an agent signs are the bytes the engine verifies, and sums of cents stay exact.

type Decision

type Decision struct {
	AgentId        string `json:"agentId"`
	AgentName      string `json:"agentName"`
	AgentSignature string `json:"agentSignature"`

	// Approval The approval's outcome, when the decision was parked for a person.
	Approval   *ApprovalOutcome `json:"approval,omitempty"`
	ApprovalId *string          `json:"approvalId,omitempty"`

	// Cancellation How the order left the venue's book without filling completely, once the
	// engine knows (the `cancelled` ledger event). Absent while it rests, after it
	// filled completely, and on orders that never rested. Not covered by
	// engineSignature: it arrives later, as a chained event.
	Cancellation   *OrderCancellation `json:"cancellation,omitempty"`
	ConfigRevision int                `json:"configRevision"`
	CreatedAt      time.Time          `json:"createdAt"`

	// EngineSignature The engine key's Ed25519 signature over the decision record as written
	// (every field above plus `submission`, without `venueAck`, `approval`,
	// `signing` and this field), base64. Present on every decision. See
	// docs/ledger.md.
	EngineSignature *string          `json:"engineSignature,omitempty"`
	Evaluations     []RuleEvaluation `json:"evaluations"`

	// Exit True when the engine judged the order an exit (see submitProposal):
	// every rule without appliesToExits was waived. Absent otherwise.
	Exit        *bool   `json:"exit,omitempty"`
	Id          string  `json:"id"`
	LatencyMs   float64 `json:"latencyMs"`
	PortfolioId string  `json:"portfolioId"`

	// Proposal The proposal as the engine priced it. For a cancel, the order fields
	// (side, size, price, orderType, reduceOnly) describe the order being
	// cancelled as its own decision recorded it, and notionalUsd is "0": a
	// cancel adds no exposure.
	Proposal Proposal `json:"proposal"`

	// Reason One line for a person, e.g. the rule that blocked it or the kill switch that was engaged.
	Reason *string `json:"reason,omitempty"`

	// Signing Where the order stands with the agent's signer. Absent on trading accounts that
	// need no signer (the paper simulator, co-signer callbacks).
	Signing *SigningStatus `json:"signing,omitempty"`
	State   StateSnapshot  `json:"state"`

	// Submission What the agent submitted that the priced proposal does not keep, so the
	// agent's signature can be verified again from the ledger alone: the key,
	// the nonce, the submission time, the price as sent (absent for a market
	// order, whose stored price is the mark the engine used) and the
	// one-shot venue message when there was one. A cancel's target is on the
	// proposal (`targetClientOrderId`).
	Submission       *DecisionSubmission `json:"submission,omitempty"`
	TradingAccountId string              `json:"tradingAccountId"`
	VenueAck         *VenueAck           `json:"venueAck,omitempty"`
	Verdict          Verdict             `json:"verdict"`
}

Decision defines model for Decision.

type DecisionPage

type DecisionPage struct {
	Items      []Decision `json:"items"`
	NextCursor *string    `json:"nextCursor,omitempty"`
}

DecisionPage defines model for DecisionPage.

type DecisionSubmission

type DecisionSubmission struct {
	KeyId string `json:"keyId"`
	Nonce string `json:"nonce"`

	// Price A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	Price      *Decimal  `json:"price,omitempty"`
	ProposedAt time.Time `json:"proposedAt"`

	// VenueMessage The one-shot path. The agent's signer builds the venue request and
	// signs its half before the proposal leaves the agent's machine, so an
	// allowed order needs no round trip to the signer: the engine decodes
	// `message`, checks it against the proposal and the trading account's venue rules,
	// runs the rules, and only then adds its own half and forwards. It is
	// inside the signed proposal, so nobody can pair a proposal with a
	// message the agent did not mean. The engine spends the commitment named
	// here whatever the outcome: it signs with it when the order is allowed
	// and discards it on a block, a park or a refusal. A parked order is
	// signed again through the signer channel once a person decides, since
	// this message would be stale by then. Without this field the engine
	// asks the signer through the channel.
	VenueMessage *ProposalVenueMessage `json:"venueMessage,omitempty"`
}

DecisionSubmission What the agent submitted that the priced proposal does not keep, so the agent's signature can be verified again from the ledger alone: the key, the nonce, the submission time, the price as sent (absent for a market order, whose stored price is the mark the engine used) and the one-shot venue message when there was one. A cancel's target is on the proposal (`targetClientOrderId`).

type Discrepancy

type Discrepancy struct {
	// Asset The asset concerned
	Asset *string `json:"asset,omitempty"`

	// BooksQuantity What the books add up to, the unassigned book included.
	BooksQuantity *Decimal  `json:"booksQuantity,omitempty"`
	DetectedAt    time.Time `json:"detectedAt"`

	// Difference venueQuantity minus booksQuantity.
	Difference *Decimal `json:"difference,omitempty"`

	// DuringMaintenance The fill fell in a maintenance window, so it restricts nothing.
	DuringMaintenance *bool            `json:"duringMaintenance,omitempty"`
	Fill              *DiscrepancyFill `json:"fill,omitempty"`
	Id                string           `json:"id"`

	// Kind foreign_fill: a fill the venue reported that Mishmar did not place;
	// restricts an agents-only trading account, and on a shared trading account is already in the
	// unassigned book and listed only for re-attribution. unexplained_position: a
	// venue position that disagrees with the books with nothing to explain
	// it; that asset on the trading account is degraded, and every agent holding it has
	// the difference added to its agent rules in whichever direction is
	// worse. unexplained_balance: a cash or collateral change with nothing to
	// explain it; nothing is degraded, a drop counts as a loss and a rise is
	// not counted until resolved. ambiguous_transfer: an asset several agents
	// hold was transferred out beyond what the unassigned book holds; that asset
	// is degraded until the owner names the agent it came from. stream_gap:
	// the venue's stream missed more than its history can fill; the whole
	// trading account is degraded until the engine has re-read the venue.
	Kind       DiscrepancyKind `json:"kind"`
	Resolution *struct {
		AgentId *string `json:"agentId,omitempty"`

		// AssignTo unassigned: book it to the trading account's unassigned book. agent: book it to `agentId`'s
		// book, an agent on the trading account (for an ambiguous transfer, the agent it
		// came from). capital: it was a transfer in or out, recorded at the mark,
		// moving equity and the drawdown baseline together.
		AssignTo  DiscrepancyAssignTo `json:"assignTo"`
		Comment   *string             `json:"comment,omitempty"`
		DecidedAt time.Time           `json:"decidedAt"`
		DecidedBy string              `json:"decidedBy"`
	} `json:"resolution,omitempty"`

	// Restricts What it blocks for new risk while open. Exits always pass.
	Restricts DiscrepancyRestricts `json:"restricts"`
	Status    DiscrepancyStatus    `json:"status"`

	// Suggestion The engine's guess, e.g. a fill that exactly offsets one agent's position.
	Suggestion *struct {
		AgentId *string `json:"agentId,omitempty"`

		// AssignTo unassigned: book it to the trading account's unassigned book. agent: book it to `agentId`'s
		// book, an agent on the trading account (for an ambiguous transfer, the agent it
		// came from). capital: it was a transfer in or out, recorded at the mark,
		// moving equity and the drawdown baseline together.
		AssignTo DiscrepancyAssignTo `json:"assignTo"`
		Reason   string              `json:"reason"`
	} `json:"suggestion,omitempty"`
	TradingAccountId string `json:"tradingAccountId"`

	// VenueQuantity The venue's position (signed, long positive) or balance when detected.
	VenueQuantity *Decimal `json:"venueQuantity,omitempty"`
}

Discrepancy defines model for Discrepancy.

type DiscrepancyAssignTo

type DiscrepancyAssignTo string

DiscrepancyAssignTo unassigned: book it to the trading account's unassigned book. agent: book it to `agentId`'s book, an agent on the trading account (for an ambiguous transfer, the agent it came from). capital: it was a transfer in or out, recorded at the mark, moving equity and the drawdown baseline together.

const (
	DiscrepancyAssignToAgent      DiscrepancyAssignTo = "agent"
	DiscrepancyAssignToCapital    DiscrepancyAssignTo = "capital"
	DiscrepancyAssignToUnassigned DiscrepancyAssignTo = "unassigned"
)

Defines values for DiscrepancyAssignTo.

func (DiscrepancyAssignTo) Valid

func (e DiscrepancyAssignTo) Valid() bool

Valid indicates whether the value is a known member of the DiscrepancyAssignTo enum.

type DiscrepancyFill

type DiscrepancyFill struct {
	At time.Time `json:"at"`

	// Price A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	Price Decimal `json:"price"`
	Side  Side    `json:"side"`

	// Size A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	Size        Decimal `json:"size"`
	Symbol      string  `json:"symbol"`
	VenueFillId string  `json:"venueFillId"`
}

DiscrepancyFill defines model for DiscrepancyFill.

type DiscrepancyId

type DiscrepancyId = string

DiscrepancyId defines model for discrepancyId.

type DiscrepancyKind

type DiscrepancyKind string

DiscrepancyKind foreign_fill: a fill the venue reported that Mishmar did not place; restricts an agents-only trading account, and on a shared trading account is already in the unassigned book and listed only for re-attribution. unexplained_position: a venue position that disagrees with the books with nothing to explain it; that asset on the trading account is degraded, and every agent holding it has the difference added to its agent rules in whichever direction is worse. unexplained_balance: a cash or collateral change with nothing to explain it; nothing is degraded, a drop counts as a loss and a rise is not counted until resolved. ambiguous_transfer: an asset several agents hold was transferred out beyond what the unassigned book holds; that asset is degraded until the owner names the agent it came from. stream_gap: the venue's stream missed more than its history can fill; the whole trading account is degraded until the engine has re-read the venue.

const (
	DiscrepancyKindAmbiguousTransfer   DiscrepancyKind = "ambiguous_transfer"
	DiscrepancyKindForeignFill         DiscrepancyKind = "foreign_fill"
	DiscrepancyKindStreamGap           DiscrepancyKind = "stream_gap"
	DiscrepancyKindUnexplainedBalance  DiscrepancyKind = "unexplained_balance"
	DiscrepancyKindUnexplainedPosition DiscrepancyKind = "unexplained_position"
)

Defines values for DiscrepancyKind.

func (DiscrepancyKind) Valid

func (e DiscrepancyKind) Valid() bool

Valid indicates whether the value is a known member of the DiscrepancyKind enum.

type DiscrepancyResolve

type DiscrepancyResolve struct {
	// AgentId Required when assignTo is agent, refused otherwise.
	AgentId *string `json:"agentId,omitempty"`

	// AssignTo unassigned: book it to the trading account's unassigned book. agent: book it to `agentId`'s
	// book, an agent on the trading account (for an ambiguous transfer, the agent it
	// came from). capital: it was a transfer in or out, recorded at the mark,
	// moving equity and the drawdown baseline together.
	AssignTo DiscrepancyAssignTo `json:"assignTo"`
	Comment  *string             `json:"comment,omitempty"`
}

DiscrepancyResolve defines model for DiscrepancyResolve.

type DiscrepancyRestricts

type DiscrepancyRestricts string

DiscrepancyRestricts What it blocks for new risk while open. Exits always pass.

const (
	DiscrepancyRestrictsAsset          DiscrepancyRestricts = "asset"
	DiscrepancyRestrictsNone           DiscrepancyRestricts = "none"
	DiscrepancyRestrictsTradingAccount DiscrepancyRestricts = "trading_account"
)

Defines values for DiscrepancyRestricts.

func (DiscrepancyRestricts) Valid

func (e DiscrepancyRestricts) Valid() bool

Valid indicates whether the value is a known member of the DiscrepancyRestricts enum.

type DiscrepancyStatus

type DiscrepancyStatus string

DiscrepancyStatus defines model for DiscrepancyStatus.

const (
	DiscrepancyStatusOpen     DiscrepancyStatus = "open"
	DiscrepancyStatusResolved DiscrepancyStatus = "resolved"
)

Defines values for DiscrepancyStatus.

func (DiscrepancyStatus) Valid

func (e DiscrepancyStatus) Valid() bool

Valid indicates whether the value is a known member of the DiscrepancyStatus enum.

type EngineCommitment

type EngineCommitment struct {
	// Commitment Base64. FROST only, the engine's nonce commitment; a two-party ECDSA slot carries nothing, since the signer's own presignature holds its side.
	Commitment *string   `json:"commitment,omitempty"`
	ExpiresAt  time.Time `json:"expiresAt"`
	Id         string    `json:"id"`
}

EngineCommitment One single-use engine nonce: a FROST commitment the signer computes against, or a presigned two-party ECDSA slot.

type EngineMode

type EngineMode string

EngineMode paper: venues are simulated or test networks; fixtures may be imported. live: real venues and real money; the engine refuses fixtures and refuses to start if any trading account's venue lacks a live adapter.

const (
	EngineModeLive  EngineMode = "live"
	EngineModePaper EngineMode = "paper"
)

Defines values for EngineMode.

func (EngineMode) Valid

func (e EngineMode) Valid() bool

Valid indicates whether the value is a known member of the EngineMode enum.

type Entitlements

type Entitlements struct {
	// CommitmentBatch The most unused engine commitments (or presignatures) an agent's
	// signer may hold per venue key: how many orders in a burst take the
	// one-shot path before the rest fall back to the signer channel.
	CommitmentBatch int `json:"commitmentBatch"`

	// DedicatedCell The account runs on a cell of its own.
	DedicatedCell bool `json:"dedicatedCell"`

	// FailoverCell A standby cell in another availability zone takes over when the account's cell fails (the uptime guarantee).
	FailoverCell bool `json:"failoverCell"`

	// MaxAgents The most agents the account may have, stopped ones included. Absent
	// means no limit. An account already over it keeps what it has;
	// createAgent is refused with `limit_reached` until one is deleted.
	MaxAgents *int `json:"maxAgents,omitempty"`

	// MaxTradingAccounts The most trading accounts the account may have, on every venue
	// together. Absent means no limit. createTradingAccount is refused
	// with `limit_reached` past it, as createAgent is.
	MaxTradingAccounts *int `json:"maxTradingAccounts,omitempty"`

	// SelfHosted Licensed to run the engine on the customer's own infrastructure.
	SelfHosted bool `json:"selfHosted"`

	// SignerTransports The transports the signer channel may use. long_poll is in every tier.
	SignerTransports []SignerTransport `json:"signerTransports"`
	Tier             Tier              `json:"tier"`

	// VenueBudgets The account's share of each venue's request budget. A venue limits
	// requests per address, and accounts may share an address, so each
	// takes no more than its share. The engine counts every request it
	// makes to the venue for the account: reads, polling, orders and
	// cancels. When the share is spent, polling waits, and a new order
	// is refused with `rate_limited` until the share refills; exits and
	// cancels always go. A venue not listed has no share of its own.
	VenueBudgets *[]VenueBudget `json:"venueBudgets,omitempty"`
}

Entitlements What the account's tier includes (plan doc, Pricing). Billing writes it for hosted accounts and a self-hosted engine reads it from its signed licence; the API only reads it. Safety is never gated: every rule, the stop, the pause, cancels, exits and approvals are in every tier.

type Error

type Error struct {
	// Code Stable machine code: `not_found`, `conflict`, `validation`, `unauthorized`,
	// `forbidden`, `unavailable`, `rate_limited`, `too_large`, `approval_expired`,
	// `venue_rejected`, `limit_reached`, `signer_unreachable`, `internal`,
	// `not_implemented` (501: in the contract, not yet in this engine).
	// `signer_unreachable` (409) means the request needs the agent's signer and none
	// answered (verifyVenueKey's co-signed read). Nothing was recorded: start the
	// signer and send the same request again.
	// `limit_reached` (403) means the account's plan holds no more of what
	// the request would add (`Entitlements.maxAgents`, `maxTradingAccounts`).
	// Sending it again changes nothing: delete one, or move to a larger plan.
	// `unavailable` (503) means the request did nothing: the engine cannot read its
	// state, or it is restarting. Send the same request again in a moment.
	// `rate_limited` (429) also means the request did nothing: this caller has sent
	// too many requests. Wait the seconds in the `Retry-After` header, then send the
	// same request again. `too_large` (413) means the body was over the limit the
	// engine accepts; sending it again changes nothing.
	Code    string                  `json:"code"`
	Details *map[string]interface{} `json:"details,omitempty"`
	Message string                  `json:"message"`
}

Error defines model for Error.

type ExchangeSetup

type ExchangeSetup struct {
	// EngineEgressIp Allowlist this at the venue on every key of the account. Present only when the engine runs in live mode and knows its egress address.
	EngineEgressIp *string `json:"engineEgressIp,omitempty"`

	// Environment Demo trading (what a paper engine creates) or the live venue.
	Environment        ExchangeSetupEnvironment `json:"environment"`
	Kind               ExchangeSetupKind        `json:"kind"`
	ReadKeyFingerprint *string                  `json:"readKeyFingerprint,omitempty"`

	// ReadKeyRegistered Whether the engine holds the account's read-only key, for margin,
	// positions and fills. The trading keys belong to the agents (VenueKey);
	// a trading account without a read key verifies and streams nothing.
	ReadKeyRegistered bool    `json:"readKeyRegistered"`
	Subaccount        *string `json:"subaccount,omitempty"`
}

ExchangeSetup defines model for ExchangeSetup.

type ExchangeSetupEnvironment

type ExchangeSetupEnvironment string

ExchangeSetupEnvironment Demo trading (what a paper engine creates) or the live venue.

const (
	ExchangeSetupEnvironmentDemo ExchangeSetupEnvironment = "demo"
	ExchangeSetupEnvironmentLive ExchangeSetupEnvironment = "live"
)

Defines values for ExchangeSetupEnvironment.

func (ExchangeSetupEnvironment) Valid

func (e ExchangeSetupEnvironment) Valid() bool

Valid indicates whether the value is a known member of the ExchangeSetupEnvironment enum.

type ExchangeSetupKind

type ExchangeSetupKind string

ExchangeSetupKind defines model for ExchangeSetup.Kind.

const (
	ExchangeSetupKindExchange ExchangeSetupKind = "exchange"
)

Defines values for ExchangeSetupKind.

func (ExchangeSetupKind) Valid

func (e ExchangeSetupKind) Valid() bool

Valid indicates whether the value is a known member of the ExchangeSetupKind enum.

type GetPnlParams

type GetPnlParams struct {
	ScopeKind ScopeKind           `form:"scopeKind" json:"scopeKind"`
	ScopeId   string              `form:"scopeId" json:"scopeId"`
	From      *openapi_types.Date `form:"from,omitempty" json:"from,omitempty"`
	To        *openapi_types.Date `form:"to,omitempty" json:"to,omitempty"`
}

GetPnlParams defines parameters for GetPnl.

type HyperliquidSetup

type HyperliquidSetup struct {
	Kind HyperliquidSetupKind `json:"kind"`

	// MasterAddress The customer's Hyperliquid master account. Reads need no key: the info
	// API is public by address. Each agent's API wallet (its VenueKey) is
	// approved by this account.
	MasterAddress string                  `json:"masterAddress"`
	Network       HyperliquidSetupNetwork `json:"network"`
}

HyperliquidSetup defines model for HyperliquidSetup.

type HyperliquidSetupKind

type HyperliquidSetupKind string

HyperliquidSetupKind defines model for HyperliquidSetup.Kind.

const (
	HyperliquidSetupKindHyperliquid HyperliquidSetupKind = "hyperliquid"
)

Defines values for HyperliquidSetupKind.

func (HyperliquidSetupKind) Valid

func (e HyperliquidSetupKind) Valid() bool

Valid indicates whether the value is a known member of the HyperliquidSetupKind enum.

type HyperliquidSetupNetwork

type HyperliquidSetupNetwork string

HyperliquidSetupNetwork defines model for HyperliquidSetup.Network.

const (
	HyperliquidSetupNetworkMainnet HyperliquidSetupNetwork = "mainnet"
	HyperliquidSetupNetworkTestnet HyperliquidSetupNetwork = "testnet"
)

Defines values for HyperliquidSetupNetwork.

func (HyperliquidSetupNetwork) Valid

func (e HyperliquidSetupNetwork) Valid() bool

Valid indicates whether the value is a known member of the HyperliquidSetupNetwork enum.

type KeygenRound

type KeygenRound struct {
	// Message Round 2. Base64, the signer's protocol message answering the engine's first.
	Message *string          `json:"message,omitempty"`
	Round   KeygenRoundRound `json:"round"`

	// SessionId Round 2. The session round 1 opened.
	SessionId  *string `json:"sessionId,omitempty"`
	VenueKeyId string  `json:"venueKeyId"`
}

KeygenRound One round of two-party key generation from the agent's signer (signerKeygen).

type KeygenRoundResult

type KeygenRoundResult struct {
	// Address Round 2. The joint key's EVM address, now recorded as VenueKey.publicKey.
	Address *string `json:"address,omitempty"`

	// Message Base64, the engine's protocol message for the round.
	Message string `json:"message"`

	// PublicKey Round 2. The joint public key, compressed SEC1 as base64, which the signer checks against its own.
	PublicKey *string `json:"publicKey,omitempty"`
	Round     int     `json:"round"`
	SessionId string  `json:"sessionId"`
}

KeygenRoundResult Key generation agrees its own session id inside the protocol; only presigning takes the joint one.

type KeygenRoundRound

type KeygenRoundRound int

KeygenRoundRound defines model for KeygenRound.Round.

const (
	KeygenRoundRoundN1 KeygenRoundRound = 1
	KeygenRoundRoundN2 KeygenRoundRound = 2
)

Defines values for KeygenRoundRound.

func (KeygenRoundRound) Valid

func (e KeygenRoundRound) Valid() bool

Valid indicates whether the value is a known member of the KeygenRoundRound enum.

type LedgerEvent

type LedgerEvent struct {
	At         time.Time              `json:"at"`
	DecisionId *string                `json:"decisionId,omitempty"`
	Hash       string                 `json:"hash"`
	Kind       LedgerEventKind        `json:"kind"`
	Payload    map[string]interface{} `json:"payload"`
	PrevHash   string                 `json:"prevHash"`
	Seq        int64                  `json:"seq"`
}

LedgerEvent One append-only entry of the audit ledger. `hash` is SHA-256 over the previous event's hash, a newline and the canonical JSON of `payload` (keys sorted, no whitespace, nulls dropped), hex; the first event's prevHash is empty. The kinds: decision (the record as written), forwarded (reason, venue ack, fills the venue returned; a cancel's own answer too), fills (fills a venue stream reported), parked, approval (the outcome), expired (approvals nobody decided in time), cancelled (an order Mishmar placed left the venue's book without filling completely, written once against the decision that placed it; the payload is that decision's OrderCancellation plus `decisionId` and `clientOrderId`), capital (a transfer in or out, valued at the mark), venue_event (funding, a liquidation or auto-deleveraging, a settlement, a rebate, interest and the venue's other non-trade entries, with how they were booked), discrepancy (one opened), resolved (one resolved, and how), reassigned (a position moved between books), maintenance (a window opened or closed).

type LedgerEventKind

type LedgerEventKind string

LedgerEventKind defines model for LedgerEvent.Kind.

const (
	LedgerEventKindApproval    LedgerEventKind = "approval"
	LedgerEventKindCancelled   LedgerEventKind = "cancelled"
	LedgerEventKindCapital     LedgerEventKind = "capital"
	LedgerEventKindDecision    LedgerEventKind = "decision"
	LedgerEventKindDiscrepancy LedgerEventKind = "discrepancy"
	LedgerEventKindExpired     LedgerEventKind = "expired"
	LedgerEventKindFills       LedgerEventKind = "fills"
	LedgerEventKindForwarded   LedgerEventKind = "forwarded"
	LedgerEventKindMaintenance LedgerEventKind = "maintenance"
	LedgerEventKindParked      LedgerEventKind = "parked"
	LedgerEventKindReassigned  LedgerEventKind = "reassigned"
	LedgerEventKindResolved    LedgerEventKind = "resolved"
	LedgerEventKindVenueEvent  LedgerEventKind = "venue_event"
)

Defines values for LedgerEventKind.

func (LedgerEventKind) Valid

func (e LedgerEventKind) Valid() bool

Valid indicates whether the value is a known member of the LedgerEventKind enum.

type LedgerEventPage

type LedgerEventPage struct {
	Items []LedgerEvent `json:"items"`

	// NextAfter Pass as `after` for the next page; absent on the last page.
	NextAfter *int64 `json:"nextAfter,omitempty"`
}

LedgerEventPage defines model for LedgerEventPage.

type LedgerHead

type LedgerHead struct {
	// EnginePublicKey The engine key's Ed25519 public key, base64. Verifies every engineSignature.
	EnginePublicKey string `json:"enginePublicKey"`
	Events          int64  `json:"events"`

	// Hash The latest event's hash
	Hash string `json:"hash"`

	// Seq The latest event's sequence number; 0 when the chain is empty.
	Seq int64 `json:"seq"`
}

LedgerHead defines model for LedgerHead.

type ListAgentsParams

type ListAgentsParams struct {
	PortfolioId *string      `form:"portfolioId,omitempty" json:"portfolioId,omitempty"`
	Status      *AgentStatus `form:"status,omitempty" json:"status,omitempty"`
}

ListAgentsParams defines parameters for ListAgents.

type ListApprovalsParams

type ListApprovalsParams struct {
	Status *ApprovalStatus `form:"status,omitempty" json:"status,omitempty"`
}

ListApprovalsParams defines parameters for ListApprovals.

type ListDecisionsParams

type ListDecisionsParams struct {
	AgentId          *string    `form:"agentId,omitempty" json:"agentId,omitempty"`
	PortfolioId      *string    `form:"portfolioId,omitempty" json:"portfolioId,omitempty"`
	TradingAccountId *string    `form:"tradingAccountId,omitempty" json:"tradingAccountId,omitempty"`
	Verdict          *Verdict   `form:"verdict,omitempty" json:"verdict,omitempty"`
	From             *time.Time `form:"from,omitempty" json:"from,omitempty"`
	To               *time.Time `form:"to,omitempty" json:"to,omitempty"`
	Cursor           *string    `form:"cursor,omitempty" json:"cursor,omitempty"`
	Limit            *int       `form:"limit,omitempty" json:"limit,omitempty"`
}

ListDecisionsParams defines parameters for ListDecisions.

type ListDiscrepanciesParams

type ListDiscrepanciesParams struct {
	TradingAccountId *string            `form:"tradingAccountId,omitempty" json:"tradingAccountId,omitempty"`
	Status           *DiscrepancyStatus `form:"status,omitempty" json:"status,omitempty"`
}

ListDiscrepanciesParams defines parameters for ListDiscrepancies.

type ListLedgerEventsParams

type ListLedgerEventsParams struct {
	// After Return events with a sequence number above this. Default 0.
	After *int64 `form:"after,omitempty" json:"after,omitempty"`

	// Limit Page size, default 200.
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
}

ListLedgerEventsParams defines parameters for ListLedgerEvents.

type ListPositionsParams

type ListPositionsParams struct {
	ScopeKind *ScopeKind `form:"scopeKind,omitempty" json:"scopeKind,omitempty"`
	ScopeId   *string    `form:"scopeId,omitempty" json:"scopeId,omitempty"`
}

ListPositionsParams defines parameters for ListPositions.

type ListRulesParams

type ListRulesParams struct {
	ScopeKind *ScopeKind `form:"scopeKind,omitempty" json:"scopeKind,omitempty"`
	ScopeId   *string    `form:"scopeId,omitempty" json:"scopeId,omitempty"`
	Enabled   *bool      `form:"enabled,omitempty" json:"enabled,omitempty"`
}

ListRulesParams defines parameters for ListRules.

type MaintenanceOpen

type MaintenanceOpen struct {
	Comment *string `json:"comment,omitempty"`
}

MaintenanceOpen defines model for MaintenanceOpen.

type MaintenanceWindow

type MaintenanceWindow struct {
	Comment  *string   `json:"comment,omitempty"`
	OpenedAt time.Time `json:"openedAt"`

	// OpenedBy The operator who opened it.
	OpenedBy string `json:"openedBy"`
}

MaintenanceWindow An open maintenance window (openMaintenance). Absent when none is open.

type MarkInput

type MarkInput struct {
	// Price A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	Price  Decimal `json:"price"`
	Symbol string  `json:"symbol"`
	Venue  Venue   `json:"venue"`
}

MarkInput defines model for MarkInput.

type OpenMaintenanceJSONRequestBody

type OpenMaintenanceJSONRequestBody = MaintenanceOpen

OpenMaintenanceJSONRequestBody defines body for OpenMaintenance for application/json ContentType.

type Operator

type Operator struct {
	// Mode paper: venues are simulated or test networks; fixtures may be imported.
	// live: real venues and real money; the engine refuses fixtures and refuses
	// to start if any trading account's venue lacks a live adapter.
	Mode EngineMode `json:"mode"`

	// Name The person behind the bearer token. Recorded on approvals as decidedBy.
	Name string `json:"name"`
}

Operator defines model for Operator.

type OrderCancellation added in v0.2.0

type OrderCancellation struct {
	// At When the venue took it off the book, or when the engine learned it did.
	At time.Time `json:"at"`

	// By agent: a cancel the agent proposed through Mishmar (`cancelDecisionId`).
	// venue: the venue pulled it itself (expiry, margin, reduce-only, self-trade,
	// delisting, liquidation, …; `venueStatus` says which). outside: cancelled at
	// the venue but not through Mishmar, by the owner in the venue's app or another
	// key. unknown: it left the venue's list of open orders with no status the
	// engine could read and no fill to explain it.
	By OrderCancellationBy `json:"by"`

	// CancelDecisionId Present when by is agent. The decision of the cancel.
	CancelDecisionId *string `json:"cancelDecisionId,omitempty"`

	// FilledSize How much of the order filled before it left the book; "0" when none did.
	FilledSize Decimal `json:"filledSize"`

	// VenueStatus The venue's own word for it when it gave one, e.g. Hyperliquid's `marginCanceled` or Binance's `EXPIRED`.
	VenueStatus *string `json:"venueStatus,omitempty"`
}

OrderCancellation The end of a resting order that did not fill completely. Each order has at most one.

type OrderCancellationBy added in v0.2.0

type OrderCancellationBy string

OrderCancellationBy agent: a cancel the agent proposed through Mishmar (`cancelDecisionId`). venue: the venue pulled it itself (expiry, margin, reduce-only, self-trade, delisting, liquidation, …; `venueStatus` says which). outside: cancelled at the venue but not through Mishmar, by the owner in the venue's app or another key. unknown: it left the venue's list of open orders with no status the engine could read and no fill to explain it.

const (
	OrderCancellationByAgent   OrderCancellationBy = "agent"
	OrderCancellationByOutside OrderCancellationBy = "outside"
	OrderCancellationByUnknown OrderCancellationBy = "unknown"
	OrderCancellationByVenue   OrderCancellationBy = "venue"
)

Defines values for OrderCancellationBy.

func (OrderCancellationBy) Valid added in v0.2.0

func (e OrderCancellationBy) Valid() bool

Valid indicates whether the value is a known member of the OrderCancellationBy enum.

type PnlDay

type PnlDay struct {
	Date openapi_types.Date `json:"date"`

	// FeesUsd Trading fees paid, negative; a rebate is positive.
	FeesUsd Decimal `json:"feesUsd"`

	// FundingUsd Funding received, negative when paid.
	FundingUsd Decimal `json:"fundingUsd"`

	// NetUsd The PnL, realized + unrealized + fees + funding. daily_loss and the portfolio and agent drawdowns read it.
	NetUsd Decimal `json:"netUsd"`

	// RealizedNetUsd The realized PnL, realized + fees + funding, without the open positions' moves. daily_realized_loss reads it.
	RealizedNetUsd Decimal `json:"realizedNetUsd"`

	// RealizedUsd Closed trading PnL, before fees and funding.
	RealizedUsd Decimal `json:"realizedUsd"`

	// UnrealizedUsd The change in the open positions' value at their marks; today's moves with the marks.
	UnrealizedUsd Decimal `json:"unrealizedUsd"`
}

PnlDay defines model for PnlDay.

type PnlSeries

type PnlSeries struct {
	Days  []PnlDay           `json:"days"`
	From  openapi_types.Date `json:"from"`
	Name  string             `json:"name"`
	Scope Scope              `json:"scope"`
	To    openapi_types.Date `json:"to"`

	// Totals PnL over a day or a range of days, for one scope. The engine books it
	// as positions move: a fill that closes part of a position realises
	// its PnL at the position's average entry, its fee goes to the book
	// whose order it was, and a funding payment is shared among the books
	// by each one's own position (the unassigned book takes what the books
	// do not explain). A day runs from the moment the engine opens it,
	// just after midnight UTC, to the next.
	Totals PnlTotals `json:"totals"`
}

PnlSeries defines model for PnlSeries.

type PnlSummary

type PnlSummary struct {
	AsOf time.Time       `json:"asOf"`
	Rows []PnlSummaryRow `json:"rows"`
}

PnlSummary defines model for PnlSummary.

type PnlSummaryRow

type PnlSummaryRow struct {
	// DayNetUsd A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	DayNetUsd Decimal `json:"dayNetUsd"`

	// GrossExposureUsd A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	GrossExposureUsd Decimal `json:"grossExposureUsd"`

	// MtdNetUsd A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	MtdNetUsd Decimal `json:"mtdNetUsd"`
	Name      string  `json:"name"`

	// ParentId The portfolio an agent belongs to. Lets the table nest rows.
	ParentId *string `json:"parentId,omitempty"`

	// RealizedUsd Month to date.
	RealizedUsd Decimal `json:"realizedUsd"`
	Scope       Scope   `json:"scope"`

	// UnrealizedUsd A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	UnrealizedUsd Decimal `json:"unrealizedUsd"`
}

PnlSummaryRow defines model for PnlSummaryRow.

type PnlTotals

type PnlTotals struct {
	// FeesUsd Trading fees paid, negative; a rebate is positive.
	FeesUsd Decimal `json:"feesUsd"`

	// FundingUsd Funding received, negative when paid.
	FundingUsd Decimal `json:"fundingUsd"`

	// NetUsd The PnL, realized + unrealized + fees + funding. daily_loss and the portfolio and agent drawdowns read it.
	NetUsd Decimal `json:"netUsd"`

	// RealizedNetUsd The realized PnL, realized + fees + funding, without the open positions' moves. daily_realized_loss reads it.
	RealizedNetUsd Decimal `json:"realizedNetUsd"`

	// RealizedUsd Closed trading PnL, before fees and funding.
	RealizedUsd Decimal `json:"realizedUsd"`

	// UnrealizedUsd The change in the open positions' value at their marks; today's moves with the marks.
	UnrealizedUsd Decimal `json:"unrealizedUsd"`
}

PnlTotals PnL over a day or a range of days, for one scope. The engine books it as positions move: a fill that closes part of a position realises its PnL at the position's average entry, its fee goes to the book whose order it was, and a funding payment is shared among the books by each one's own position (the unassigned book takes what the books do not explain). A day runs from the moment the engine opens it, just after midnight UTC, to the next.

type Portfolio

type Portfolio struct {
	AgentCount int `json:"agentCount"`

	// CapitalUsd The capital allocated to the portfolio: what leverage (gross exposure ÷
	// capital) and drawdown are measured against, for the portfolio and for
	// each of its agents. It is not a cap on exposure; a gross_exposure rule
	// is. Absent when none is set, and then no leverage or drawdown rule may
	// be scoped to the portfolio or its agents (createRule).
	CapitalUsd *Decimal  `json:"capitalUsd,omitempty"`
	CreatedAt  time.Time `json:"createdAt"`

	// DayPnlUsd A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	DayPnlUsd   Decimal `json:"dayPnlUsd"`
	Description *string `json:"description,omitempty"`

	// GrossExposureUsd A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	GrossExposureUsd Decimal `json:"grossExposureUsd"`
	Id               string  `json:"id"`

	// IsDefault True for the account's default portfolio (Account.defaultPortfolioId), which cannot be deleted.
	IsDefault bool   `json:"isDefault"`
	Name      string `json:"name"`

	// NetExposureUsd A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	NetExposureUsd Decimal         `json:"netExposureUsd"`
	Status         PortfolioStatus `json:"status"`
	UpdatedAt      time.Time       `json:"updatedAt"`
}

Portfolio defines model for Portfolio.

type PortfolioCreate

type PortfolioCreate struct {
	// CapitalUsd The capital allocated to the portfolio (Portfolio.capitalUsd). Absent for none.
	CapitalUsd  *Decimal `json:"capitalUsd,omitempty"`
	Description *string  `json:"description,omitempty"`
	Name        string   `json:"name"`
}

PortfolioCreate defines model for PortfolioCreate.

type PortfolioId

type PortfolioId = string

PortfolioId defines model for portfolioId.

type PortfolioStatus

type PortfolioStatus string

PortfolioStatus defines model for PortfolioStatus.

const (
	PortfolioStatusActive PortfolioStatus = "active"
	PortfolioStatusKilled PortfolioStatus = "killed"
)

Defines values for PortfolioStatus.

func (PortfolioStatus) Valid

func (e PortfolioStatus) Valid() bool

Valid indicates whether the value is a known member of the PortfolioStatus enum.

type PortfolioUpdate

type PortfolioUpdate struct {
	// CapitalUsd A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	CapitalUsd  *Decimal `json:"capitalUsd,omitempty"`
	Description *string  `json:"description,omitempty"`
	Name        *string  `json:"name,omitempty"`

	// RemoveCapital True takes the allocated capital away; capitalUsd must then be absent.
	// Refused while a leverage or drawdown rule is measured against it
	// (updatePortfolio).
	RemoveCapital *bool `json:"removeCapital,omitempty"`
}

PortfolioUpdate defines model for PortfolioUpdate.

type Position

type Position struct {
	AgentId *string `json:"agentId,omitempty"`

	// Book unassigned: a holding no agent owns, such as a manual trade on a shared
	// trading account, an asset deposited in kind, or what a retired agent held;
	// agentId and portfolioId are then absent. Account and trading account rules see
	// the unassigned book; agent and portfolio rules do not. Absent means agent.
	Book *PositionBook `json:"book,omitempty"`

	// EntryPrice A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	EntryPrice Decimal `json:"entryPrice"`
	Id         string  `json:"id"`

	// Leverage A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	Leverage *Decimal `json:"leverage,omitempty"`

	// MarkPrice A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	MarkPrice Decimal `json:"markPrice"`

	// NotionalUsd A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	NotionalUsd Decimal      `json:"notionalUsd"`
	PortfolioId *string      `json:"portfolioId,omitempty"`
	Side        PositionSide `json:"side"`

	// Size A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	Size             Decimal `json:"size"`
	Symbol           string  `json:"symbol"`
	TradingAccountId *string `json:"tradingAccountId,omitempty"`

	// UnrealizedUsd A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	UnrealizedUsd Decimal `json:"unrealizedUsd"`
	Venue         Venue   `json:"venue"`
}

Position defines model for Position.

type PositionBook

type PositionBook string

PositionBook unassigned: a holding no agent owns, such as a manual trade on a shared trading account, an asset deposited in kind, or what a retired agent held; agentId and portfolioId are then absent. Account and trading account rules see the unassigned book; agent and portfolio rules do not. Absent means agent.

const (
	PositionBookAgent      PositionBook = "agent"
	PositionBookUnassigned PositionBook = "unassigned"
)

Defines values for PositionBook.

func (PositionBook) Valid

func (e PositionBook) Valid() bool

Valid indicates whether the value is a known member of the PositionBook enum.

type PositionInput

type PositionInput struct {
	AgentId string `json:"agentId"`

	// EntryPrice A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	EntryPrice Decimal `json:"entryPrice"`

	// MarkPrice A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	MarkPrice Decimal           `json:"markPrice"`
	Side      PositionInputSide `json:"side"`

	// Size A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	Size             Decimal `json:"size"`
	Symbol           string  `json:"symbol"`
	TradingAccountId string  `json:"tradingAccountId"`
	Venue            Venue   `json:"venue"`
}

PositionInput defines model for PositionInput.

type PositionInputSide

type PositionInputSide string

PositionInputSide defines model for PositionInput.Side.

const (
	PositionInputSideLong  PositionInputSide = "long"
	PositionInputSideShort PositionInputSide = "short"
)

Defines values for PositionInputSide.

func (PositionInputSide) Valid

func (e PositionInputSide) Valid() bool

Valid indicates whether the value is a known member of the PositionInputSide enum.

type PositionReassign

type PositionReassign struct {
	Comment *string `json:"comment,omitempty"`

	// FromAgentId The agent giving the holding. Absent means the unassigned book.
	FromAgentId *string `json:"fromAgentId,omitempty"`

	// Size How much to move, positive, in the direction the giving book holds.
	Size   Decimal `json:"size"`
	Symbol string  `json:"symbol"`

	// ToAgentId The agent receiving it. Absent means the unassigned book; the two must differ.
	ToAgentId *string `json:"toAgentId,omitempty"`
}

PositionReassign defines model for PositionReassign.

type PositionSide

type PositionSide string

PositionSide defines model for Position.Side.

const (
	PositionSideLong  PositionSide = "long"
	PositionSideShort PositionSide = "short"
)

Defines values for PositionSide.

func (PositionSide) Valid

func (e PositionSide) Valid() bool

Valid indicates whether the value is a known member of the PositionSide enum.

type PresignRound

type PresignRound struct {
	// Count Round 1. How many nonces the signer wants. Default and cap, the entitlement less what it already holds unused.
	Count *int `json:"count,omitempty"`

	// Message Round 2. Base64, the signer's protocol message answering the engine's first.
	Message *string           `json:"message,omitempty"`
	Round   PresignRoundRound `json:"round"`

	// SessionId Round 2. The session round 1 opened.
	SessionId *string `json:"sessionId,omitempty"`

	// SignerSid Round 1. Base64 of 16 random bytes, the signer's half of the
	// session id. The engine adds 16 of its own, and both sides run the
	// protocol under SHA-256 of the signer's half then the engine's.
	SignerSid  *string `json:"signerSid,omitempty"`
	VenueKeyId string  `json:"venueKeyId"`
}

PresignRound One round of presigning from the agent's signer (signerPresign).

type PresignRoundResult

type PresignRoundResult struct {
	// BatchSize Round 2. The account's entitlement (Entitlements.commitmentBatch).
	BatchSize *int `json:"batchSize,omitempty"`

	// Count Round 1. How many nonces the session makes, after the entitlement's cap.
	Count *int `json:"count,omitempty"`

	// EngineInstance As CommitmentBatch.engineInstance; it changes when the engine or the signer behind it restarts, and the slots are gone with it.
	EngineInstance string `json:"engineInstance"`

	// EngineSid Round 1. Base64 of the engine's 16 bytes of the session id.
	EngineSid *string `json:"engineSid,omitempty"`

	// Message Base64, the engine's protocol message for the round.
	Message string `json:"message"`

	// Outstanding Round 2. Unused slots the signer holds for this key, these included.
	Outstanding *int   `json:"outstanding,omitempty"`
	Round       int    `json:"round"`
	SessionId   string `json:"sessionId"`

	// Slots Round 2. One per nonce, in the order of the signer's own presignature.
	Slots *[]EngineCommitment `json:"slots,omitempty"`
}

PresignRoundResult defines model for PresignRoundResult.

type PresignRoundRound

type PresignRoundRound int

PresignRoundRound defines model for PresignRound.Round.

const (
	PresignRoundRoundN1 PresignRoundRound = 1
	PresignRoundRoundN2 PresignRoundRound = 2
)

Defines values for PresignRoundRound.

func (PresignRoundRound) Valid

func (e PresignRoundRound) Valid() bool

Valid indicates whether the value is a known member of the PresignRoundRound enum.

type Proposal

type Proposal struct {
	// ClientOrderId Assigned by the engine. Names the agent so fills attribute per agent on a shared account.
	ClientOrderId string `json:"clientOrderId"`

	// ExpiresAt The deadline the agent set (ProposalSubmit.expiresAt). Nothing is forwarded past it.
	ExpiresAt time.Time `json:"expiresAt"`

	// Kind cancel pulls a resting order the agent placed through Mishmar, named by
	// `targetClientOrderId`; it carries no order fields.
	Kind ProposalKind `json:"kind"`

	// Leverage A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	Leverage *Decimal `json:"leverage,omitempty"`

	// NotionalUsd A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	NotionalUsd Decimal           `json:"notionalUsd"`
	OrderType   ProposalOrderType `json:"orderType"`

	// Price A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	Price      *Decimal `json:"price,omitempty"`
	ReduceOnly bool     `json:"reduceOnly"`
	Side       Side     `json:"side"`

	// Size A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	Size   Decimal `json:"size"`
	Symbol string  `json:"symbol"`

	// TargetClientOrderId Cancels only. The clientOrderId of the order being cancelled.
	TargetClientOrderId *string `json:"targetClientOrderId,omitempty"`

	// TargetDecisionId Cancels only. The decision that placed the order being cancelled.
	TargetDecisionId *string `json:"targetDecisionId,omitempty"`
	Venue            Venue   `json:"venue"`
}

Proposal The proposal as the engine priced it. For a cancel, the order fields (side, size, price, orderType, reduceOnly) describe the order being cancelled as its own decision recorded it, and notionalUsd is "0": a cancel adds no exposure.

type ProposalKind

type ProposalKind string

ProposalKind cancel pulls a resting order the agent placed through Mishmar, named by `targetClientOrderId`; it carries no order fields.

const (
	ProposalKindCancel        ProposalKind = "cancel"
	ProposalKindOrder         ProposalKind = "order"
	ProposalKindSignedMessage ProposalKind = "signed_message"
	ProposalKindTransaction   ProposalKind = "transaction"
)

Defines values for ProposalKind.

func (ProposalKind) Valid

func (e ProposalKind) Valid() bool

Valid indicates whether the value is a known member of the ProposalKind enum.

type ProposalOrderType

type ProposalOrderType string

ProposalOrderType defines model for Proposal.OrderType.

const (
	ProposalOrderTypeLimit  ProposalOrderType = "limit"
	ProposalOrderTypeMarket ProposalOrderType = "market"
)

Defines values for ProposalOrderType.

func (ProposalOrderType) Valid

func (e ProposalOrderType) Valid() bool

Valid indicates whether the value is a known member of the ProposalOrderType enum.

type ProposalSubmit

type ProposalSubmit struct {
	// ExpiresAt The latest moment the order may reach the venue. Must be after
	// proposedAt and at most 24 hours later. A decision parked for a
	// person expires then (sooner when the engine's approval window is
	// shorter), an approval after it is refused, and nothing is forwarded
	// past it. A proposal that is already past it is refused (422).
	ExpiresAt time.Time `json:"expiresAt"`

	// KeyId The id returned when the key was issued.
	KeyId string `json:"keyId"`

	// Kind cancel pulls a resting order the agent placed through Mishmar, named by
	// `targetClientOrderId`; it carries no order fields.
	Kind ProposalKind `json:"kind"`

	// Leverage A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	Leverage *Decimal `json:"leverage,omitempty"`

	// Nonce Unique per proposal. A replayed nonce is rejected.
	Nonce     string                  `json:"nonce"`
	OrderType ProposalSubmitOrderType `json:"orderType,omitempty"`

	// Price Required for limit orders. Ignored for market orders, which are priced at mark.
	Price *Decimal `json:"price,omitempty"`

	// ProposedAt Rejected when more than 60 seconds old.
	ProposedAt time.Time `json:"proposedAt"`

	// ReduceOnly The agent's claim that the order only reduces its position. With it
	// the signer sets the venue's own reduce-only flag, and the engine
	// judges whether the order is an exit (see submitProposal).
	ReduceOnly *bool `json:"reduceOnly,omitempty"`
	Side       Side  `json:"side,omitempty"`

	// Signature Base64 Ed25519 signature over the canonical JSON of every other
	// field in this object: keys sorted at every level (venueMessage
	// included), no whitespace, numbers as the shortest round-trip
	// decimal, absent optional fields omitted. Pinned in
	// spec/vectors/proposal-signing.json.
	Signature string `json:"signature"`

	// Size A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	Size Decimal `json:"size,omitempty"`

	// Symbol For a cancel, the symbol of the order being cancelled; the venues need it.
	Symbol string `json:"symbol"`

	// TargetClientOrderId Cancels only, and required for them: the clientOrderId the engine
	// assigned on the decision of the order to pull. That order must be
	// the same agent's, on the same trading account, and must have reached the
	// venue. Refused on every other kind.
	TargetClientOrderId *string `json:"targetClientOrderId,omitempty"`
	TradingAccountId    string  `json:"tradingAccountId"`

	// VenueMessage The one-shot path. The agent's signer builds the venue request and
	// signs its half before the proposal leaves the agent's machine, so an
	// allowed order needs no round trip to the signer: the engine decodes
	// `message`, checks it against the proposal and the trading account's venue rules,
	// runs the rules, and only then adds its own half and forwards. It is
	// inside the signed proposal, so nobody can pair a proposal with a
	// message the agent did not mean. The engine spends the commitment named
	// here whatever the outcome: it signs with it when the order is allowed
	// and discards it on a block, a park or a refusal. A parked order is
	// signed again through the signer channel once a person decides, since
	// this message would be stale by then. Without this field the engine
	// asks the signer through the channel.
	VenueMessage *ProposalVenueMessage `json:"venueMessage,omitempty"`
}

ProposalSubmit Every kind but cancel needs side, size, orderType and reduceOnly; a cancel needs targetClientOrderId and must leave the order fields (side, size, price, orderType, leverage, reduceOnly) out. The engine refuses either mistake (422).

type ProposalSubmitOrderType

type ProposalSubmitOrderType string

ProposalSubmitOrderType defines model for ProposalSubmit.OrderType.

const (
	ProposalSubmitOrderTypeLimit  ProposalSubmitOrderType = "limit"
	ProposalSubmitOrderTypeMarket ProposalSubmitOrderType = "market"
)

Defines values for ProposalSubmitOrderType.

func (ProposalSubmitOrderType) Valid

func (e ProposalSubmitOrderType) Valid() bool

Valid indicates whether the value is a known member of the ProposalSubmitOrderType enum.

type ProposalVenueMessage

type ProposalVenueMessage struct {
	// Commitment Base64. FROST only, the signer's own nonce commitment.
	Commitment *string `json:"commitment,omitempty"`

	// EngineCommitmentId The engine commitment (requestCommitments) or presigned slot (signerPresign) this half was computed against. Single use.
	EngineCommitmentId string `json:"engineCommitmentId"`

	// Message Base64 of the venue request before its signature: Binance's
	// parameter string (with its timestamp and recvWindow), which is what
	// its signature covers; Hyperliquid's action and nonce as the
	// exchange endpoint takes them, plus the order's Mishmar client
	// order id, which the cloid on the order is derived from and the
	// venue never sees: `{"action": …, "nonce": …, "clientOrderId": …}`,
	// no vault, built by the signer from the trading account's venue
	// rules, from which the engine derives the EIP-712 digest itself.
	Message string `json:"message"`

	// Scheme frost-ed25519 (Binance) or ecdsa-2p (Hyperliquid, its half from a
	// presigned slot, signerPresign). Never proxy: an HMAC venue's signer
	// holds the whole key and forwards the request itself.
	Scheme SigningScheme `json:"scheme"`

	// Share Base64. The signer's half: its FROST signature share, or for
	// two-party ECDSA the protocol's last message, which proves itself
	// against the slot and the message's digest, so it cannot be moved
	// to another slot or another order.
	Share string `json:"share"`

	// VenueKeyId The agent's trading key on the trading account.
	VenueKeyId string `json:"venueKeyId"`
}

ProposalVenueMessage The one-shot path. The agent's signer builds the venue request and signs its half before the proposal leaves the agent's machine, so an allowed order needs no round trip to the signer: the engine decodes `message`, checks it against the proposal and the trading account's venue rules, runs the rules, and only then adds its own half and forwards. It is inside the signed proposal, so nobody can pair a proposal with a message the agent did not mean. The engine spends the commitment named here whatever the outcome: it signs with it when the order is allowed and discards it on a block, a park or a refusal. A parked order is signed again through the signer channel once a person decides, since this message would be stale by then. Without this field the engine asks the signer through the channel.

type ReassignPositionJSONRequestBody

type ReassignPositionJSONRequestBody = PositionReassign

ReassignPositionJSONRequestBody defines body for ReassignPosition for application/json ContentType.

type RegisterVenueKeyJSONRequestBody

type RegisterVenueKeyJSONRequestBody = VenueKeyRegistration

RegisterVenueKeyJSONRequestBody defines body for RegisterVenueKey for application/json ContentType.

type RejectApprovalJSONRequestBody

type RejectApprovalJSONRequestBody = ApprovalDecide

RejectApprovalJSONRequestBody defines body for RejectApproval for application/json ContentType.

type ReplacePositionsJSONRequestBody

type ReplacePositionsJSONRequestBody = StateImport

ReplacePositionsJSONRequestBody defines body for ReplacePositions for application/json ContentType.

type RequestCommitmentsJSONRequestBody

type RequestCommitmentsJSONRequestBody = CommitmentRequest

RequestCommitmentsJSONRequestBody defines body for RequestCommitments for application/json ContentType.

type ResolveDiscrepancyJSONRequestBody

type ResolveDiscrepancyJSONRequestBody = DiscrepancyResolve

ResolveDiscrepancyJSONRequestBody defines body for ResolveDiscrepancy for application/json ContentType.

type Rule

type Rule struct {
	// AppliesToExits Whether the rule also judges exits (see submitProposal). False by
	// default: the rule is waived for an exit, and the waiver is recorded
	// on the decision's evaluation. Set it for a rule that must hold even
	// while an agent closes, an order-size cap on a thin market, say.
	AppliesToExits bool `json:"appliesToExits"`

	// Asset Narrow the metric to one asset, e.g. `NVDA` or `BTC`.
	Asset     *string   `json:"asset,omitempty"`
	CreatedAt time.Time `json:"createdAt"`
	Enabled   bool      `json:"enabled"`
	Id        string    `json:"id"`

	// Metric gross_exposure, net_exposure, daily_loss, daily_realized_loss, order_size are in USD.
	// leverage is a ratio. concentration and drawdown are percentages.
	// leverage is gross exposure ÷ equity at account and trading account scope, and
	// gross exposure ÷ the portfolio's allocated capital (Portfolio.capitalUsd) at
	// portfolio and agent scope, where drawdown is measured against that capital too;
	// a portfolio without capital cannot have such rules (createRule).
	// net_exposure and concentration accept an `asset` to narrow to one name.
	// daily_loss is today's loss counting open positions at their marks
	// (PnlTotals.netUsd); daily_realized_loss counts only what was closed,
	// with fees and funding (PnlTotals.realizedNetUsd).
	Metric RuleMetric `json:"metric"`
	Name   string     `json:"name"`

	// Outcome What happens when the threshold is breached. `allow` records the breach and lets it through.
	Outcome RuleOutcome `json:"outcome"`

	// Revision The configuration revision that last changed this rule.
	Revision int   `json:"revision"`
	Scope    Scope `json:"scope"`

	// Threshold A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	Threshold Decimal   `json:"threshold"`
	Unit      RuleUnit  `json:"unit"`
	UpdatedAt time.Time `json:"updatedAt"`
}

Rule defines model for Rule.

type RuleCreate

type RuleCreate struct {
	AppliesToExits *bool   `json:"appliesToExits,omitempty"`
	Asset          *string `json:"asset,omitempty"`
	Enabled        *bool   `json:"enabled,omitempty"`

	// Metric gross_exposure, net_exposure, daily_loss, daily_realized_loss, order_size are in USD.
	// leverage is a ratio. concentration and drawdown are percentages.
	// leverage is gross exposure ÷ equity at account and trading account scope, and
	// gross exposure ÷ the portfolio's allocated capital (Portfolio.capitalUsd) at
	// portfolio and agent scope, where drawdown is measured against that capital too;
	// a portfolio without capital cannot have such rules (createRule).
	// net_exposure and concentration accept an `asset` to narrow to one name.
	// daily_loss is today's loss counting open positions at their marks
	// (PnlTotals.netUsd); daily_realized_loss counts only what was closed,
	// with fees and funding (PnlTotals.realizedNetUsd).
	Metric RuleMetric `json:"metric"`
	Name   string     `json:"name"`

	// Outcome What happens when the threshold is breached. `allow` records the breach and lets it through.
	Outcome RuleOutcome `json:"outcome"`
	Scope   Scope       `json:"scope"`

	// Threshold A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	Threshold Decimal  `json:"threshold"`
	Unit      RuleUnit `json:"unit"`
}

RuleCreate defines model for RuleCreate.

type RuleEvaluation

type RuleEvaluation struct {
	// Metric gross_exposure, net_exposure, daily_loss, daily_realized_loss, order_size are in USD.
	// leverage is a ratio. concentration and drawdown are percentages.
	// leverage is gross exposure ÷ equity at account and trading account scope, and
	// gross exposure ÷ the portfolio's allocated capital (Portfolio.capitalUsd) at
	// portfolio and agent scope, where drawdown is measured against that capital too;
	// a portfolio without capital cannot have such rules (createRule).
	// net_exposure and concentration accept an `asset` to narrow to one name.
	// daily_loss is today's loss counting open positions at their marks
	// (PnlTotals.netUsd); daily_realized_loss counts only what was closed,
	// with fees and funding (PnlTotals.realizedNetUsd).
	Metric RuleMetric `json:"metric"`

	// Observed The metric's value after the proposal, as evaluated.
	Observed Decimal `json:"observed"`

	// Outcome What happens when the threshold is breached. `allow` records the breach and lets it through.
	Outcome  RuleOutcome `json:"outcome"`
	Passed   bool        `json:"passed"`
	RuleId   string      `json:"ruleId"`
	RuleName string      `json:"ruleName"`
	Scope    Scope       `json:"scope"`

	// Threshold A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	Threshold Decimal  `json:"threshold"`
	Unit      RuleUnit `json:"unit"`

	// Waived True when the order is an exit and the rule does not apply to exits.
	// The rule is still evaluated and `observed` and `passed` recorded, so
	// the ledger shows what was skipped, but a waived evaluation never
	// affects the verdict. Absent when the rule applied.
	Waived *bool `json:"waived,omitempty"`

	// WaivedReason Why the rule was waived, for a person, e.g. "exit of 0.5 BTC; the rule does not apply to exits".
	WaivedReason *string `json:"waivedReason,omitempty"`
}

RuleEvaluation defines model for RuleEvaluation.

type RuleId

type RuleId = string

RuleId defines model for ruleId.

type RuleMetric

type RuleMetric string

RuleMetric gross_exposure, net_exposure, daily_loss, daily_realized_loss, order_size are in USD. leverage is a ratio. concentration and drawdown are percentages. leverage is gross exposure ÷ equity at account and trading account scope, and gross exposure ÷ the portfolio's allocated capital (Portfolio.capitalUsd) at portfolio and agent scope, where drawdown is measured against that capital too; a portfolio without capital cannot have such rules (createRule). net_exposure and concentration accept an `asset` to narrow to one name. daily_loss is today's loss counting open positions at their marks (PnlTotals.netUsd); daily_realized_loss counts only what was closed, with fees and funding (PnlTotals.realizedNetUsd).

const (
	RuleMetricConcentration     RuleMetric = "concentration"
	RuleMetricDailyLoss         RuleMetric = "daily_loss"
	RuleMetricDailyRealizedLoss RuleMetric = "daily_realized_loss"
	RuleMetricDrawdown          RuleMetric = "drawdown"
	RuleMetricGrossExposure     RuleMetric = "gross_exposure"
	RuleMetricLeverage          RuleMetric = "leverage"
	RuleMetricNetExposure       RuleMetric = "net_exposure"
	RuleMetricOrderSize         RuleMetric = "order_size"
)

Defines values for RuleMetric.

func (RuleMetric) Valid

func (e RuleMetric) Valid() bool

Valid indicates whether the value is a known member of the RuleMetric enum.

type RuleOutcome

type RuleOutcome string

RuleOutcome What happens when the threshold is breached. `allow` records the breach and lets it through.

const (
	RuleOutcomeAllow           RuleOutcome = "allow"
	RuleOutcomeBlock           RuleOutcome = "block"
	RuleOutcomeRequireApproval RuleOutcome = "require_approval"
)

Defines values for RuleOutcome.

func (RuleOutcome) Valid

func (e RuleOutcome) Valid() bool

Valid indicates whether the value is a known member of the RuleOutcome enum.

type RuleUnit

type RuleUnit string

RuleUnit defines model for RuleUnit.

const (
	RuleUnitPct   RuleUnit = "pct"
	RuleUnitRatio RuleUnit = "ratio"
	RuleUnitUsd   RuleUnit = "usd"
)

Defines values for RuleUnit.

func (RuleUnit) Valid

func (e RuleUnit) Valid() bool

Valid indicates whether the value is a known member of the RuleUnit enum.

type RuleUpdate

type RuleUpdate struct {
	AppliesToExits *bool   `json:"appliesToExits,omitempty"`
	Asset          *string `json:"asset,omitempty"`
	Enabled        *bool   `json:"enabled,omitempty"`

	// Metric gross_exposure, net_exposure, daily_loss, daily_realized_loss, order_size are in USD.
	// leverage is a ratio. concentration and drawdown are percentages.
	// leverage is gross exposure ÷ equity at account and trading account scope, and
	// gross exposure ÷ the portfolio's allocated capital (Portfolio.capitalUsd) at
	// portfolio and agent scope, where drawdown is measured against that capital too;
	// a portfolio without capital cannot have such rules (createRule).
	// net_exposure and concentration accept an `asset` to narrow to one name.
	// daily_loss is today's loss counting open positions at their marks
	// (PnlTotals.netUsd); daily_realized_loss counts only what was closed,
	// with fees and funding (PnlTotals.realizedNetUsd).
	Metric *RuleMetric `json:"metric,omitempty"`
	Name   *string     `json:"name,omitempty"`

	// Outcome What happens when the threshold is breached. `allow` records the breach and lets it through.
	Outcome *RuleOutcome `json:"outcome,omitempty"`
	Scope   *Scope       `json:"scope,omitempty"`

	// Threshold A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	Threshold *Decimal  `json:"threshold,omitempty"`
	Unit      *RuleUnit `json:"unit,omitempty"`
}

RuleUpdate defines model for RuleUpdate.

type Scope

type Scope struct {
	Id   string    `json:"id"`
	Kind ScopeKind `json:"kind"`
}

Scope defines model for Scope.

type ScopeKind

type ScopeKind string

ScopeKind defines model for ScopeKind.

const (
	ScopeKindAccount        ScopeKind = "account"
	ScopeKindAgent          ScopeKind = "agent"
	ScopeKindPortfolio      ScopeKind = "portfolio"
	ScopeKindTradingAccount ScopeKind = "trading_account"
)

Defines values for ScopeKind.

func (ScopeKind) Valid

func (e ScopeKind) Valid() bool

Valid indicates whether the value is a known member of the ScopeKind enum.

type SetAccountEntitlementsJSONRequestBody

type SetAccountEntitlementsJSONRequestBody = Entitlements

SetAccountEntitlementsJSONRequestBody defines body for SetAccountEntitlements for application/json ContentType.

type Side

type Side string

Side defines model for Side.

const (
	SideBuy  Side = "buy"
	SideSell Side = "sell"
)

Defines values for Side.

func (Side) Valid

func (e Side) Valid() bool

Valid indicates whether the value is a known member of the Side enum.

type SignRequest

type SignRequest struct {
	AgentId string `json:"agentId"`

	// Attempt Increments each time the request is handed out again after a signer took it and did not answer.
	Attempt       int     `json:"attempt"`
	ClientOrderId *string `json:"clientOrderId,omitempty"`
	DecisionId    *string `json:"decisionId,omitempty"`

	// Engine The engine's part of the round.
	Engine *SignRequestEngine `json:"engine,omitempty"`

	// ExpiresAt Seconds after `issuedAt` for a fresh proposal. For an order signed
	// again after a person approved it, the grace period, capped by the
	// proposal's own deadline.
	ExpiresAt time.Time `json:"expiresAt"`

	// Id Unique per request; the answer names it.
	Id       string    `json:"id"`
	IssuedAt time.Time `json:"issuedAt"`

	// Message Base64 of the exact bytes the venue will verify: Binance's parameter
	// string, Hyperliquid's EIP-712 digest. The signer decodes them itself
	// and checks them against the order it proposed; `order` is a courtesy,
	// never the thing checked. A digest cannot be decoded, so a
	// two-party ECDSA request also carries the action and nonce it was
	// computed from in `venueRequest.body`, and the signer recomputes
	// the digest from them before it signs.
	Message string            `json:"message"`
	Order   *SignRequestOrder `json:"order,omitempty"`

	// Proposal The agent's own signed proposal this request serves (orders and
	// cancels), so a signer that is not the proposer (a standalone signer,
	// a proxy) can verify that the agent authorized the order before it
	// signs. Absent for `verify`.
	Proposal *ProposalSubmit `json:"proposal,omitempty"`

	// Purpose What the signature is for. `order` and `cancel` carry the decision
	// and the agent's proposal; `verify` is the harmless read the engine
	// co-signs to prove the key (verifyVenueKey), and carries neither.
	// A signer refuses an `order` it did not propose; it may sign a
	// `verify` whose message decodes to no order at all.
	Purpose SignRequestPurpose `json:"purpose"`
	Round   int                `json:"round"`

	// Scheme The protocol a sign request runs, decided by the venue key's scheme (VenueKeyScheme), never chosen by anyone.
	Scheme SigningScheme `json:"scheme"`

	// SessionId Groups the rounds of one signature. A one-round scheme has one request per session.
	SessionId        string `json:"sessionId"`
	TradingAccountId string `json:"tradingAccountId"`
	Venue            Venue  `json:"venue"`

	// VenueKeyId The agent's trading key on the trading account, so the signer picks the right share.
	VenueKeyId string `json:"venueKeyId"`

	// VenueRequest The venue request the signature serves. For the proxy scheme it is the
	// request the proxy signs with the key it holds and sends to the venue;
	// for the others it is informational (an exchange signs its query string,
	// which does not name the endpoint, so this says what the engine will call).
	VenueRequest *VenueRequest `json:"venueRequest,omitempty"`
}

SignRequest defines model for SignRequest.

type SignRequestEngine

type SignRequestEngine struct {
	// Commitment Base64. The engine's FROST nonce commitment for this signature.
	Commitment *string `json:"commitment,omitempty"`

	// Payload Base64. Round data for the two-party ECDSA and RSA schemes.
	Payload *string `json:"payload,omitempty"`

	// Signature Base64 Ed25519 signature by the engine's key (see getLedgerHead)
	// over `message`. Present for the proxy scheme: the proxy forwards
	// nothing that does not carry it.
	Signature *string `json:"signature,omitempty"`
}

SignRequestEngine The engine's part of the round.

type SignRequestOrder

type SignRequestOrder struct {
	OrderType SignRequestOrderOrderType `json:"orderType"`

	// Price A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	Price      *Decimal `json:"price,omitempty"`
	ReduceOnly bool     `json:"reduceOnly"`
	Side       Side     `json:"side"`

	// Size As the venue will receive it, after rounding to its step.
	Size   Decimal `json:"size"`
	Symbol string  `json:"symbol"`
}

SignRequestOrder defines model for SignRequestOrder.

type SignRequestOrderOrderType

type SignRequestOrderOrderType string

SignRequestOrderOrderType defines model for SignRequestOrder.OrderType.

const (
	SignRequestOrderOrderTypeLimit  SignRequestOrderOrderType = "limit"
	SignRequestOrderOrderTypeMarket SignRequestOrderOrderType = "market"
)

Defines values for SignRequestOrderOrderType.

func (SignRequestOrderOrderType) Valid

func (e SignRequestOrderOrderType) Valid() bool

Valid indicates whether the value is a known member of the SignRequestOrderOrderType enum.

type SignRequestPurpose

type SignRequestPurpose string

SignRequestPurpose What the signature is for. `order` and `cancel` carry the decision and the agent's proposal; `verify` is the harmless read the engine co-signs to prove the key (verifyVenueKey), and carries neither. A signer refuses an `order` it did not propose; it may sign a `verify` whose message decodes to no order at all.

const (
	SignRequestPurposeCancel SignRequestPurpose = "cancel"
	SignRequestPurposeOrder  SignRequestPurpose = "order"
	SignRequestPurposeVerify SignRequestPurpose = "verify"
)

Defines values for SignRequestPurpose.

func (SignRequestPurpose) Valid

func (e SignRequestPurpose) Valid() bool

Valid indicates whether the value is a known member of the SignRequestPurpose enum.

type SignerAnswer

type SignerAnswer struct {
	// Commitment Base64. The signer's FROST nonce commitment.
	Commitment *string `json:"commitment,omitempty"`

	// EngineCommitmentId Two-party ECDSA only. The presigned slot (signerPresign) the share was made with; spent whatever the outcome.
	EngineCommitmentId *string `json:"engineCommitmentId,omitempty"`

	// Kind Must fit the request's scheme; `share` for FROST, ECDSA and RSA rounds, `venue_response` for the proxy.
	Kind    SignerAnswerKind `json:"kind"`
	Refusal *struct {
		// Reason Why the signer would not sign; recorded on the decision.
		Reason string `json:"reason"`
	} `json:"refusal,omitempty"`

	// Share Base64. The signer's signature share (FROST), or its round data (two-party ECDSA, RSA).
	Share *string `json:"share,omitempty"`

	// Signature Base64. A whole signature, for a scheme where the signer finishes one.
	Signature     *string        `json:"signature,omitempty"`
	VenueResponse *VenueResponse `json:"venueResponse,omitempty"`
}

SignerAnswer defines model for SignerAnswer.

type SignerAnswerJSONRequestBody

type SignerAnswerJSONRequestBody = SignerAnswer

SignerAnswerJSONRequestBody defines body for SignerAnswer for application/json ContentType.

type SignerAnswerKind

type SignerAnswerKind string

SignerAnswerKind Must fit the request's scheme; `share` for FROST, ECDSA and RSA rounds, `venue_response` for the proxy.

const (
	SignerAnswerKindRefusal       SignerAnswerKind = "refusal"
	SignerAnswerKindShare         SignerAnswerKind = "share"
	SignerAnswerKindSignature     SignerAnswerKind = "signature"
	SignerAnswerKindVenueResponse SignerAnswerKind = "venue_response"
)

Defines values for SignerAnswerKind.

func (SignerAnswerKind) Valid

func (e SignerAnswerKind) Valid() bool

Valid indicates whether the value is a known member of the SignerAnswerKind enum.

type SignerKeygenJSONRequestBody

type SignerKeygenJSONRequestBody = KeygenRound

SignerKeygenJSONRequestBody defines body for SignerKeygen for application/json ContentType.

type SignerPoll

type SignerPoll struct {
	// WaitSeconds How long the engine may hold the poll open waiting for something to sign.
	WaitSeconds *int `json:"waitSeconds,omitempty"`
}

SignerPoll defines model for SignerPoll.

type SignerPollJSONRequestBody

type SignerPollJSONRequestBody = SignerPoll

SignerPollJSONRequestBody defines body for SignerPoll for application/json ContentType.

type SignerPresignJSONRequestBody

type SignerPresignJSONRequestBody = PresignRound

SignerPresignJSONRequestBody defines body for SignerPresign for application/json ContentType.

type SignerTransport

type SignerTransport string

SignerTransport How the engine reaches an agent's signer. The messages are the same on every transport.

const (
	SignerTransportLongPoll  SignerTransport = "long_poll"
	SignerTransportQueue     SignerTransport = "queue"
	SignerTransportWebhook   SignerTransport = "webhook"
	SignerTransportWebsocket SignerTransport = "websocket"
)

Defines values for SignerTransport.

func (SignerTransport) Valid

func (e SignerTransport) Valid() bool

Valid indicates whether the value is a known member of the SignerTransport enum.

type SigningScheme

type SigningScheme string

SigningScheme The protocol a sign request runs, decided by the venue key's scheme (VenueKeyScheme), never chosen by anyone.

const (
	SigningSchemeEcdsa2p      SigningScheme = "ecdsa-2p"
	SigningSchemeFrostEd25519 SigningScheme = "frost-ed25519"
	SigningSchemeProxy        SigningScheme = "proxy"
	SigningSchemeRsa2p        SigningScheme = "rsa-2p"
)

Defines values for SigningScheme.

func (SigningScheme) Valid

func (e SigningScheme) Valid() bool

Valid indicates whether the value is a known member of the SigningScheme enum.

type SigningStatus

type SigningStatus struct {
	AnsweredAt *time.Time `json:"answeredAt,omitempty"`
	Attempts   *int       `json:"attempts,omitempty"`

	// Detail The signer's refusal reason, or why it could not be reached.
	Detail      *string             `json:"detail,omitempty"`
	RequestedAt *time.Time          `json:"requestedAt,omitempty"`
	Status      SigningStatusStatus `json:"status"`
}

SigningStatus Where an order stands with the agent's signer, on decisions through a trading account whose venue key needs the signer (every exchange and Hyperliquid trading account).

type SigningStatusStatus

type SigningStatusStatus string

SigningStatusStatus defines model for SigningStatus.Status.

const (
	SigningStatusStatusRefused     SigningStatusStatus = "refused"
	SigningStatusStatusSigned      SigningStatusStatus = "signed"
	SigningStatusStatusUnreachable SigningStatusStatus = "unreachable"
	SigningStatusStatusWaiting     SigningStatusStatus = "waiting"
)

Defines values for SigningStatusStatus.

func (SigningStatusStatus) Valid

func (e SigningStatusStatus) Valid() bool

Valid indicates whether the value is a known member of the SigningStatusStatus enum.

type StateImport

type StateImport struct {
	// EquityUsd Account equity, the denominator for account-scope leverage.
	EquityUsd Decimal `json:"equityUsd"`

	// HighWaterMarkUsd Peak equity, the reference for account-scope drawdown.
	HighWaterMarkUsd Decimal `json:"highWaterMarkUsd"`

	// Marks Last known prices per venue symbol. Market orders are priced at the
	// mark; a symbol without one is blocked. Nothing is assumed, not even
	// that a stablecoin is worth 1.
	Marks     []MarkInput     `json:"marks"`
	Positions []PositionInput `json:"positions"`
}

StateImport defines model for StateImport.

type StateSnapshot

type StateSnapshot struct {
	AsOf time.Time `json:"asOf"`

	// DailyPnlUsd A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	DailyPnlUsd Decimal `json:"dailyPnlUsd"`

	// DrawdownPct A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	DrawdownPct Decimal `json:"drawdownPct"`

	// GrossExposureUsd A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	GrossExposureUsd Decimal `json:"grossExposureUsd"`

	// Leverage A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	Leverage Decimal `json:"leverage"`

	// NetExposureUsd A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	NetExposureUsd Decimal `json:"netExposureUsd"`
}

StateSnapshot defines model for StateSnapshot.

type SubmitProposalJSONRequestBody

type SubmitProposalJSONRequestBody = ProposalSubmit

SubmitProposalJSONRequestBody defines body for SubmitProposal for application/json ContentType.

type SubmitWalletApprovalJSONRequestBody

type SubmitWalletApprovalJSONRequestBody = WalletApprovalSignature

SubmitWalletApprovalJSONRequestBody defines body for SubmitWalletApproval for application/json ContentType.

type SymbolRules

type SymbolRules struct {
	// AssetIndex Hyperliquid only. The asset's index, which orders name instead of the symbol.
	AssetIndex *int `json:"assetIndex,omitempty"`

	// MaxLeverage A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	MaxLeverage *Decimal `json:"maxLeverage,omitempty"`

	// MinNotional A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	MinNotional *Decimal `json:"minNotional,omitempty"`

	// MinSize A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	MinSize *Decimal `json:"minSize,omitempty"`

	// SizeDecimals Hyperliquid only. Decimals a size may have.
	SizeDecimals *int `json:"sizeDecimals,omitempty"`

	// StepSize A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	StepSize *Decimal `json:"stepSize,omitempty"`
	Symbol   string   `json:"symbol"`

	// TickSize A decimal number as a string: "98000.25", "-1234.5", "0.001". Money and
	// quantities are never JSON numbers. A string survives every language's
	// float formatting unchanged, so the bytes an agent signs are the bytes the
	// engine verifies, and sums of cents stay exact.
	TickSize *Decimal `json:"tickSize,omitempty"`
}

SymbolRules One market's rules as the venue states them. Fields the venue does not state are absent. Hyperliquid states no tick: a perp price has at most five significant figures and at most (6 - sizeDecimals) decimals, and any integer price is valid.

type Tier

type Tier string

Tier defines model for Tier.

const (
	TierEnterprise Tier = "enterprise"
	TierFree       Tier = "free"
	TierPro        Tier = "pro"
	TierTeam       Tier = "team"
)

Defines values for Tier.

func (Tier) Valid

func (e Tier) Valid() bool

Valid indicates whether the value is a known member of the Tier enum.

type TradingAccount

type TradingAccount struct {
	CreatedAt time.Time `json:"createdAt"`
	Id        string    `json:"id"`

	// Kind An exchange account reached with API keys, a Hyperliquid master account, or a custodian's co-signer callback.
	Kind TradingAccountKind `json:"kind"`

	// Maintenance An open maintenance window (openMaintenance). Absent when none is open.
	Maintenance *MaintenanceWindow `json:"maintenance,omitempty"`

	// Mode What a fill Mishmar did not place means on the trading account. Several agents
	// may share a trading account in either mode, and transfers, funding, liquidations
	// and the venue's other entries are handled the same way in both.
	// agents_only (the default): Mishmar is the only thing trading on the
	// trading account, so such a fill restricts new risk on the trading account, exits still
	// passing, until the owner assigns it (resolveDiscrepancy) or it falls in
	// a maintenance window. shared: such a fill is booked to the unassigned book
	// and trading continues; account and trading account rules see it, agent rules do not.
	Mode TradingAccountMode `json:"mode"`
	Name string             `json:"name"`

	// Restrictions What blocks new risk on the trading account right now, set by the engine
	// rather than by a person (pause and stop are `status`). Exits pass
	// under every restriction. Absent when there is none.
	Restrictions *[]TradingAccountRestriction `json:"restrictions,omitempty"`
	Setup        TradingAccountSetup          `json:"setup"`
	Status       TradingAccountStatus         `json:"status"`
	UpdatedAt    time.Time                    `json:"updatedAt"`
	Venue        Venue                        `json:"venue"`
	Verification *TradingAccountVerification  `json:"verification,omitempty"`
}

TradingAccount defines model for TradingAccount.

type TradingAccountCreate

type TradingAccountCreate struct {
	// Exchange An exchange account. The trading keys come later, one per agent (VenueKey).
	Exchange *struct {
		// ReadApiKey A key with read permissions only, for the account's margin, positions and fills. Write-only.
		ReadApiKey string `json:"readApiKey"`

		// ReadApiSecret The read-only key's secret (HMAC). Write-only and stored whole; it cannot trade or withdraw.
		ReadApiSecret string  `json:"readApiSecret"`
		Subaccount    *string `json:"subaccount,omitempty"`
	} `json:"exchange,omitempty"`
	Fireblocks *struct {
		ApiUserId string `json:"apiUserId"`
	} `json:"fireblocks,omitempty"`
	Hyperliquid *struct {
		MasterAddress string `json:"masterAddress"`

		// Network A paper-mode engine accepts testnet only; a live engine accepts mainnet only.
		Network TradingAccountCreateHyperliquidNetwork `json:"network"`
	} `json:"hyperliquid,omitempty"`

	// Mode Default agents_only.
	Mode  *TradingAccountMode `json:"mode,omitempty"`
	Name  string              `json:"name"`
	Venue Venue               `json:"venue"`
}

TradingAccountCreate defines model for TradingAccountCreate.

type TradingAccountCreateHyperliquidNetwork

type TradingAccountCreateHyperliquidNetwork string

TradingAccountCreateHyperliquidNetwork A paper-mode engine accepts testnet only; a live engine accepts mainnet only.

const (
	TradingAccountCreateHyperliquidNetworkMainnet TradingAccountCreateHyperliquidNetwork = "mainnet"
	TradingAccountCreateHyperliquidNetworkTestnet TradingAccountCreateHyperliquidNetwork = "testnet"
)

Defines values for TradingAccountCreateHyperliquidNetwork.

func (TradingAccountCreateHyperliquidNetwork) Valid

Valid indicates whether the value is a known member of the TradingAccountCreateHyperliquidNetwork enum.

type TradingAccountId

type TradingAccountId = string

TradingAccountId defines model for tradingAccountId.

type TradingAccountKind

type TradingAccountKind string

TradingAccountKind An exchange account reached with API keys, a Hyperliquid master account, or a custodian's co-signer callback.

const (
	TradingAccountKindCosignerCallback TradingAccountKind = "cosigner_callback"
	TradingAccountKindExchange         TradingAccountKind = "exchange"
	TradingAccountKindHyperliquid      TradingAccountKind = "hyperliquid"
)

Defines values for TradingAccountKind.

func (TradingAccountKind) Valid

func (e TradingAccountKind) Valid() bool

Valid indicates whether the value is a known member of the TradingAccountKind enum.

type TradingAccountMode

type TradingAccountMode string

TradingAccountMode What a fill Mishmar did not place means on the trading account. Several agents may share a trading account in either mode, and transfers, funding, liquidations and the venue's other entries are handled the same way in both. agents_only (the default): Mishmar is the only thing trading on the trading account, so such a fill restricts new risk on the trading account, exits still passing, until the owner assigns it (resolveDiscrepancy) or it falls in a maintenance window. shared: such a fill is booked to the unassigned book and trading continues; account and trading account rules see it, agent rules do not.

const (
	TradingAccountModeAgentsOnly TradingAccountMode = "agents_only"
	TradingAccountModeShared     TradingAccountMode = "shared"
)

Defines values for TradingAccountMode.

func (TradingAccountMode) Valid

func (e TradingAccountMode) Valid() bool

Valid indicates whether the value is a known member of the TradingAccountMode enum.

type TradingAccountRestriction

type TradingAccountRestriction struct {
	// Asset The asset
	Asset *string `json:"asset,omitempty"`

	// Cause foreign_fill: an agents-only trading account saw a fill Mishmar did not place.
	// unexplained_position: the venue's position in the asset disagrees
	// with the books and nothing explains it. ambiguous_transfer: an
	// asset several agents hold was transferred out beyond what the unassigned
	// book holds. stream_gap: the venue's stream missed more than its
	// history can fill. state_unavailable: the venue's state cannot be read.
	// venue_unreachable: the engine has no live stream of the trading account's
	// fills and orders from the venue: the venue refused the subscription, or the
	// stream has been down past its grace. It lifts by itself once the stream is
	// back and the engine has caught up.
	Cause TradingAccountRestrictionCause `json:"cause"`

	// Detail More than the cause says, when there is more: for venue_unreachable,
	// why the stream is down, in the venue's words where it gave any.
	Detail *string `json:"detail,omitempty"`

	// DiscrepancyId The discrepancy that lifts it once resolved
	DiscrepancyId *string `json:"discrepancyId,omitempty"`

	// Scope The whole trading account, or one asset on it (every market that trades that asset).
	Scope TradingAccountRestrictionScope `json:"scope"`
	Since time.Time                      `json:"since"`
}

TradingAccountRestriction defines model for TradingAccountRestriction.

type TradingAccountRestrictionCause

type TradingAccountRestrictionCause string

TradingAccountRestrictionCause foreign_fill: an agents-only trading account saw a fill Mishmar did not place. unexplained_position: the venue's position in the asset disagrees with the books and nothing explains it. ambiguous_transfer: an asset several agents hold was transferred out beyond what the unassigned book holds. stream_gap: the venue's stream missed more than its history can fill. state_unavailable: the venue's state cannot be read. venue_unreachable: the engine has no live stream of the trading account's fills and orders from the venue: the venue refused the subscription, or the stream has been down past its grace. It lifts by itself once the stream is back and the engine has caught up.

const (
	TradingAccountRestrictionCauseAmbiguousTransfer   TradingAccountRestrictionCause = "ambiguous_transfer"
	TradingAccountRestrictionCauseForeignFill         TradingAccountRestrictionCause = "foreign_fill"
	TradingAccountRestrictionCauseStateUnavailable    TradingAccountRestrictionCause = "state_unavailable"
	TradingAccountRestrictionCauseStreamGap           TradingAccountRestrictionCause = "stream_gap"
	TradingAccountRestrictionCauseUnexplainedPosition TradingAccountRestrictionCause = "unexplained_position"
	TradingAccountRestrictionCauseVenueUnreachable    TradingAccountRestrictionCause = "venue_unreachable"
)

Defines values for TradingAccountRestrictionCause.

func (TradingAccountRestrictionCause) Valid

Valid indicates whether the value is a known member of the TradingAccountRestrictionCause enum.

type TradingAccountRestrictionScope

type TradingAccountRestrictionScope string

TradingAccountRestrictionScope The whole trading account, or one asset on it (every market that trades that asset).

const (
	TradingAccountRestrictionScopeAsset          TradingAccountRestrictionScope = "asset"
	TradingAccountRestrictionScopeTradingAccount TradingAccountRestrictionScope = "trading_account"
)

Defines values for TradingAccountRestrictionScope.

func (TradingAccountRestrictionScope) Valid

Valid indicates whether the value is a known member of the TradingAccountRestrictionScope enum.

type TradingAccountSetup

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

TradingAccountSetup defines model for TradingAccountSetup.

func (TradingAccountSetup) AsCosignerCallbackSetup

func (t TradingAccountSetup) AsCosignerCallbackSetup() (CosignerCallbackSetup, error)

AsCosignerCallbackSetup returns the union data inside the TradingAccountSetup as a CosignerCallbackSetup

func (TradingAccountSetup) AsExchangeSetup

func (t TradingAccountSetup) AsExchangeSetup() (ExchangeSetup, error)

AsExchangeSetup returns the union data inside the TradingAccountSetup as a ExchangeSetup

func (TradingAccountSetup) AsHyperliquidSetup

func (t TradingAccountSetup) AsHyperliquidSetup() (HyperliquidSetup, error)

AsHyperliquidSetup returns the union data inside the TradingAccountSetup as a HyperliquidSetup

func (TradingAccountSetup) Discriminator

func (t TradingAccountSetup) Discriminator() (string, error)

func (*TradingAccountSetup) FromCosignerCallbackSetup

func (t *TradingAccountSetup) FromCosignerCallbackSetup(v CosignerCallbackSetup) error

FromCosignerCallbackSetup overwrites any union data inside the TradingAccountSetup as the provided CosignerCallbackSetup

func (*TradingAccountSetup) FromExchangeSetup

func (t *TradingAccountSetup) FromExchangeSetup(v ExchangeSetup) error

FromExchangeSetup overwrites any union data inside the TradingAccountSetup as the provided ExchangeSetup

func (*TradingAccountSetup) FromHyperliquidSetup

func (t *TradingAccountSetup) FromHyperliquidSetup(v HyperliquidSetup) error

FromHyperliquidSetup overwrites any union data inside the TradingAccountSetup as the provided HyperliquidSetup

func (TradingAccountSetup) MarshalJSON

func (t TradingAccountSetup) MarshalJSON() ([]byte, error)

func (*TradingAccountSetup) MergeCosignerCallbackSetup

func (t *TradingAccountSetup) MergeCosignerCallbackSetup(v CosignerCallbackSetup) error

MergeCosignerCallbackSetup performs a merge with any union data inside the TradingAccountSetup, using the provided CosignerCallbackSetup

func (*TradingAccountSetup) MergeExchangeSetup

func (t *TradingAccountSetup) MergeExchangeSetup(v ExchangeSetup) error

MergeExchangeSetup performs a merge with any union data inside the TradingAccountSetup, using the provided ExchangeSetup

func (*TradingAccountSetup) MergeHyperliquidSetup

func (t *TradingAccountSetup) MergeHyperliquidSetup(v HyperliquidSetup) error

MergeHyperliquidSetup performs a merge with any union data inside the TradingAccountSetup, using the provided HyperliquidSetup

func (*TradingAccountSetup) UnmarshalJSON

func (t *TradingAccountSetup) UnmarshalJSON(b []byte) error

func (TradingAccountSetup) ValueByDiscriminator

func (t TradingAccountSetup) ValueByDiscriminator() (interface{}, error)

type TradingAccountStatus

type TradingAccountStatus string

TradingAccountStatus defines model for TradingAccountStatus.

const (
	TradingAccountStatusActive  TradingAccountStatus = "active"
	TradingAccountStatusKilled  TradingAccountStatus = "killed"
	TradingAccountStatusPaused  TradingAccountStatus = "paused"
	TradingAccountStatusPending TradingAccountStatus = "pending"
)

Defines values for TradingAccountStatus.

func (TradingAccountStatus) Valid

func (e TradingAccountStatus) Valid() bool

Valid indicates whether the value is a known member of the TradingAccountStatus enum.

type TradingAccountUpdate

type TradingAccountUpdate struct {
	// Mode What a fill Mishmar did not place means on the trading account. Several agents
	// may share a trading account in either mode, and transfers, funding, liquidations
	// and the venue's other entries are handled the same way in both.
	// agents_only (the default): Mishmar is the only thing trading on the
	// trading account, so such a fill restricts new risk on the trading account, exits still
	// passing, until the owner assigns it (resolveDiscrepancy) or it falls in
	// a maintenance window. shared: such a fill is booked to the unassigned book
	// and trading continues; account and trading account rules see it, agent rules do not.
	Mode *TradingAccountMode `json:"mode,omitempty"`
	Name *string             `json:"name,omitempty"`
}

TradingAccountUpdate defines model for TradingAccountUpdate.

type TradingAccountVerification

type TradingAccountVerification struct {
	Checks []struct {
		Detail *string `json:"detail,omitempty"`
		Name   string  `json:"name"`
		Passed bool    `json:"passed"`
	} `json:"checks"`
	VerifiedAt *time.Time `json:"verifiedAt,omitempty"`
}

TradingAccountVerification defines model for TradingAccountVerification.

type UpdateAgentJSONRequestBody

type UpdateAgentJSONRequestBody = AgentUpdate

UpdateAgentJSONRequestBody defines body for UpdateAgent for application/json ContentType.

type UpdatePortfolioJSONRequestBody

type UpdatePortfolioJSONRequestBody = PortfolioUpdate

UpdatePortfolioJSONRequestBody defines body for UpdatePortfolio for application/json ContentType.

type UpdateRuleJSONRequestBody

type UpdateRuleJSONRequestBody = RuleUpdate

UpdateRuleJSONRequestBody defines body for UpdateRule for application/json ContentType.

type UpdateTradingAccountJSONRequestBody

type UpdateTradingAccountJSONRequestBody = TradingAccountUpdate

UpdateTradingAccountJSONRequestBody defines body for UpdateTradingAccount for application/json ContentType.

type Venue

type Venue string

Venue defines model for Venue.

const (
	VenueBinance     Venue = "binance"
	VenueBybit       Venue = "bybit"
	VenueCoinbase    Venue = "coinbase"
	VenueFireblocks  Venue = "fireblocks"
	VenueHyperliquid Venue = "hyperliquid"
	VenueOkx         Venue = "okx"
)

Defines values for Venue.

func (Venue) Valid

func (e Venue) Valid() bool

Valid indicates whether the value is a known member of the Venue enum.

type VenueAck

type VenueAck struct {
	// ClientOrderId The id the venue indexed the order under when it is not the proposal's own clientOrderId (Hyperliquid derives a 16-byte cloid from it). Fills the venue reports under it are attributed to this decision, also after the engine restarts.
	ClientOrderId *string   `json:"clientOrderId,omitempty"`
	OrderId       string    `json:"orderId"`
	ReceivedAt    time.Time `json:"receivedAt"`
	Status        string    `json:"status"`
}

VenueAck defines model for VenueAck.

type VenueBudget added in v0.2.0

type VenueBudget struct {
	Venue Venue `json:"venue"`

	// WeightPerMinute Request weight a minute, in the venue's own units: Hyperliquid's
	// and Binance's published weights per request.
	WeightPerMinute int `json:"weightPerMinute"`
}

VenueBudget defines model for VenueBudget.

type VenueKey

type VenueKey struct {
	AgentId string `json:"agentId"`

	// ApiKeyRegistered Whether the engine holds the key id the exchange issued (`register`). True from creation for HMAC keys, whose id the signer carries, and for Hyperliquid, which has none.
	ApiKeyRegistered bool      `json:"apiKeyRegistered"`
	CreatedAt        time.Time `json:"createdAt"`

	// ExpiresAt When the key stops working: 100 days after it became active, or
	// the venue's own expiry if that comes first (a Hyperliquid
	// approval carries the same date). The engine stops signing with it
	// then and its status becomes `expired`; the console warns from 7
	// days before. Absent until the key is active.
	ExpiresAt   *time.Time `json:"expiresAt,omitempty"`
	Fingerprint *string    `json:"fingerprint,omitempty"`

	// Hyperliquid Hyperliquid keys only. The master wallet's approval of the API wallet.
	Hyperliquid *struct {
		ApprovalStatus VenueKeyHyperliquidApprovalStatus `json:"approvalStatus"`

		// ApprovedAt When the engine first saw the master account's approval on the venue.
		ApprovedAt *time.Time `json:"approvedAt,omitempty"`

		// ValidUntil When the venue will expire the approval, as the venue reports it.
		ValidUntil *time.Time `json:"validUntil,omitempty"`
	} `json:"hyperliquid,omitempty"`
	Id            string `json:"id"`
	IpAllowlisted *bool  `json:"ipAllowlisted,omitempty"`

	// Keygen Two-party ECDSA keys, which are made by key generation: pending
	// until the agent's signer has run signerKeygen, when `publicKey`
	// appears. Absent for dealt keys and the other schemes.
	Keygen *VenueKeyKeygen `json:"keygen,omitempty"`

	// PublicKey What the venue needs to know the key: the public key to register at an
	// exchange (SPKI PEM), or the API wallet's address for the master wallet
	// to approve on Hyperliquid. Absent for HMAC keys, and for an ECDSA
	// key until its key generation is done.
	PublicKey *string `json:"publicKey,omitempty"`

	// Replaces The key this one replaces (VenueKeyCreate.replaces), revoked when this one became active.
	Replaces  *string    `json:"replaces,omitempty"`
	RevokedAt *time.Time `json:"revokedAt,omitempty"`

	// Scheme The venue's key type, which alone decides how the key is held and used:
	// Ed25519, ECDSA and RSA keys are two-party keys (FROST, two-party ECDSA,
	// two-party RSA) with one share in the engine and one in the agent's
	// signer; HMAC keys are held whole by the signer the customer runs, which
	// signs only what both the agent and the engine signed. Per venue:
	// Binance ed25519, Hyperliquid ecdsa (an API wallet), Bybit rsa, Coinbase
	// ecdsa, OKX hmac.
	Scheme VenueKeyScheme `json:"scheme"`

	// Status pending until the venue accepts a co-signed read, active until
	// `expiresAt` or revocation. An expired key never signs again: the
	// engine forgets its share, as on revocation.
	Status              VenueKeyStatus              `json:"status"`
	TradingAccountId    string                      `json:"tradingAccountId"`
	Venue               Venue                       `json:"venue"`
	Verification        *TradingAccountVerification `json:"verification,omitempty"`
	WithdrawalsDisabled *bool                       `json:"withdrawalsDisabled,omitempty"`
}

VenueKey One agent's trading key on one trading account. Created with the engine's share (or nothing, for HMAC venues), registered or approved at the venue, verified by a co-signed read, revoked by the operator.

type VenueKeyCreate

type VenueKeyCreate struct {
	// EngineShare The engine's share as `mishmar keygen` printed it (JSON). Required for
	// venues with Ed25519 or RSA keys, refused for HMAC venues. For
	// venues with ECDSA keys leave it out: the key is made by two-party
	// key generation (signerKeygen) and a dealt share is refused.
	// Write-only; the agent's share never passes through the engine, and
	// the public key is derived from this share.
	EngineShare *string `json:"engineShare,omitempty"`

	// Replaces The agent's live key on the same trading account that this one
	// replaces. It must be active and not expired, and nothing else may
	// be replacing it. It keeps signing until this key becomes active,
	// and is revoked then.
	Replaces         *string `json:"replaces,omitempty"`
	TradingAccountId string  `json:"tradingAccountId"`
}

VenueKeyCreate defines model for VenueKeyCreate.

type VenueKeyHyperliquidApprovalStatus

type VenueKeyHyperliquidApprovalStatus string

VenueKeyHyperliquidApprovalStatus defines model for VenueKey.Hyperliquid.ApprovalStatus.

const (
	VenueKeyHyperliquidApprovalStatusApproved VenueKeyHyperliquidApprovalStatus = "approved"
	VenueKeyHyperliquidApprovalStatusPending  VenueKeyHyperliquidApprovalStatus = "pending"
)

Defines values for VenueKeyHyperliquidApprovalStatus.

func (VenueKeyHyperliquidApprovalStatus) Valid

Valid indicates whether the value is a known member of the VenueKeyHyperliquidApprovalStatus enum.

type VenueKeyId

type VenueKeyId = string

VenueKeyId defines model for venueKeyId.

type VenueKeyKeygen

type VenueKeyKeygen string

VenueKeyKeygen Two-party ECDSA keys, which are made by key generation: pending until the agent's signer has run signerKeygen, when `publicKey` appears. Absent for dealt keys and the other schemes.

const (
	VenueKeyKeygenDone    VenueKeyKeygen = "done"
	VenueKeyKeygenPending VenueKeyKeygen = "pending"
)

Defines values for VenueKeyKeygen.

func (VenueKeyKeygen) Valid

func (e VenueKeyKeygen) Valid() bool

Valid indicates whether the value is a known member of the VenueKeyKeygen enum.

type VenueKeyRegistration

type VenueKeyRegistration struct {
	// ApiKey The key id the exchange issued when the public key was registered.
	ApiKey string `json:"apiKey"`
}

VenueKeyRegistration defines model for VenueKeyRegistration.

type VenueKeyScheme

type VenueKeyScheme string

VenueKeyScheme The venue's key type, which alone decides how the key is held and used: Ed25519, ECDSA and RSA keys are two-party keys (FROST, two-party ECDSA, two-party RSA) with one share in the engine and one in the agent's signer; HMAC keys are held whole by the signer the customer runs, which signs only what both the agent and the engine signed. Per venue: Binance ed25519, Hyperliquid ecdsa (an API wallet), Bybit rsa, Coinbase ecdsa, OKX hmac.

const (
	VenueKeySchemeEcdsa   VenueKeyScheme = "ecdsa"
	VenueKeySchemeEd25519 VenueKeyScheme = "ed25519"
	VenueKeySchemeHmac    VenueKeyScheme = "hmac"
	VenueKeySchemeRsa     VenueKeyScheme = "rsa"
)

Defines values for VenueKeyScheme.

func (VenueKeyScheme) Valid

func (e VenueKeyScheme) Valid() bool

Valid indicates whether the value is a known member of the VenueKeyScheme enum.

type VenueKeyStatus

type VenueKeyStatus string

VenueKeyStatus pending until the venue accepts a co-signed read, active until `expiresAt` or revocation. An expired key never signs again: the engine forgets its share, as on revocation.

const (
	VenueKeyStatusActive  VenueKeyStatus = "active"
	VenueKeyStatusExpired VenueKeyStatus = "expired"
	VenueKeyStatusPending VenueKeyStatus = "pending"
	VenueKeyStatusRevoked VenueKeyStatus = "revoked"
)

Defines values for VenueKeyStatus.

func (VenueKeyStatus) Valid

func (e VenueKeyStatus) Valid() bool

Valid indicates whether the value is a known member of the VenueKeyStatus enum.

type VenueRequest

type VenueRequest struct {
	// Body Base64.
	Body    *string            `json:"body,omitempty"`
	Headers *map[string]string `json:"headers,omitempty"`
	Method  string             `json:"method"`
	Url     string             `json:"url"`
}

VenueRequest The venue request the signature serves. For the proxy scheme it is the request the proxy signs with the key it holds and sends to the venue; for the others it is informational (an exchange signs its query string, which does not name the endpoint, so this says what the engine will call).

type VenueResponse

type VenueResponse struct {
	// Body Base64.
	Body    string             `json:"body"`
	Headers *map[string]string `json:"headers,omitempty"`
	Status  int                `json:"status"`
}

VenueResponse defines model for VenueResponse.

type VenueRules

type VenueRules struct {
	// AsOf When the engine last read the rules from the venue.
	AsOf             time.Time     `json:"asOf"`
	Symbols          []SymbolRules `json:"symbols"`
	TradingAccountId string        `json:"tradingAccountId"`
	Venue            Venue         `json:"venue"`
}

VenueRules defines model for VenueRules.

type Verdict

type Verdict string

Verdict defines model for Verdict.

const (
	VerdictAllow           Verdict = "allow"
	VerdictBlock           Verdict = "block"
	VerdictRequireApproval Verdict = "require_approval"
)

Defines values for Verdict.

func (Verdict) Valid

func (e Verdict) Valid() bool

Valid indicates whether the value is a known member of the Verdict enum.

type WalletApproval

type WalletApproval struct {
	// ApprovalId Correlates the signature with this typed data. Single use.
	ApprovalId string    `json:"approvalId"`
	ExpiresAt  time.Time `json:"expiresAt"`

	// TypedData EIP-712 typed data (domain, types, primaryType, message) for the wallet's signTypedData call.
	TypedData map[string]interface{} `json:"typedData"`
}

WalletApproval defines model for WalletApproval.

type WalletApprovalRequest

type WalletApprovalRequest struct {
	// WalletChainId The chain the browser wallet is connected to, as the wallet reports it
	// (hex, e.g. "0x66eee"). Some wallets refuse typed data for another chain;
	// Hyperliquid accepts any chain id in the signature domain.
	WalletChainId *string `json:"walletChainId,omitempty"`
}

WalletApprovalRequest defines model for WalletApprovalRequest.

type WalletApprovalSignature

type WalletApprovalSignature struct {
	ApprovalId string `json:"approvalId"`

	// Signature The 65-byte hex signature the master wallet produced, 0x-prefixed.
	Signature string `json:"signature"`
}

WalletApprovalSignature defines model for WalletApprovalSignature.

Jump to

Keyboard shortcuts

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