code.vegaprotocol.io/vega@v0.79.0/datanode/gateway/graphql/models.go (about)

     1  // Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
     2  
     3  package gql
     4  
     5  import (
     6  	"fmt"
     7  	"io"
     8  	"strconv"
     9  
    10  	"code.vegaprotocol.io/vega/protos/data-node/api/v2"
    11  	"code.vegaprotocol.io/vega/protos/vega"
    12  	"code.vegaprotocol.io/vega/protos/vega/data/v1"
    13  )
    14  
    15  // One of the possible asset sources
    16  type AssetSource interface {
    17  	IsAssetSource()
    18  }
    19  
    20  type DataSourceKind interface {
    21  	IsDataSourceKind()
    22  }
    23  
    24  // Union type for wrapped events in stream PROPOSAL is mapped to governance data, something to keep in mind
    25  type Event interface {
    26  	IsEvent()
    27  }
    28  
    29  type ExternalDataSourceKind interface {
    30  	IsExternalDataSourceKind()
    31  }
    32  
    33  type GameEntity interface {
    34  	IsGameEntity()
    35  }
    36  
    37  type GovernanceTransferKind interface {
    38  	IsGovernanceTransferKind()
    39  }
    40  
    41  type InternalDataSourceKind interface {
    42  	IsInternalDataSourceKind()
    43  }
    44  
    45  type Oracle interface {
    46  	IsOracle()
    47  }
    48  
    49  type Product interface {
    50  	IsProduct()
    51  }
    52  
    53  type ProductConfiguration interface {
    54  	IsProductConfiguration()
    55  }
    56  
    57  type ProductData interface {
    58  	IsProductData()
    59  }
    60  
    61  type ProposalChange interface {
    62  	IsProposalChange()
    63  }
    64  
    65  type ProposalNode interface {
    66  	IsProposalNode()
    67  }
    68  
    69  type RiskModel interface {
    70  	IsRiskModel()
    71  }
    72  
    73  type SignerKind interface {
    74  	IsSignerKind()
    75  }
    76  
    77  type StopOrderTrigger interface {
    78  	IsStopOrderTrigger()
    79  }
    80  
    81  type TransferKind interface {
    82  	IsTransferKind()
    83  }
    84  
    85  type TriggerKind interface {
    86  	IsTriggerKind()
    87  }
    88  
    89  // One of the possible asset sources for update assets proposals
    90  type UpdateAssetSource interface {
    91  	IsUpdateAssetSource()
    92  }
    93  
    94  type UpdateMarketRiskParameters interface {
    95  	IsUpdateMarketRiskParameters()
    96  }
    97  
    98  type UpdateProductConfiguration interface {
    99  	IsUpdateProductConfiguration()
   100  }
   101  
   102  type WithdrawalDetails interface {
   103  	IsWithdrawalDetails()
   104  }
   105  
   106  // Margins for a hypothetical position not related to any existing party
   107  type AbstractMarginLevels struct {
   108  	// Market in which the margin is required for this party
   109  	Market *vega.Market `json:"market"`
   110  	// Asset for the current margins
   111  	Asset *vega.Asset `json:"asset"`
   112  	// Minimal margin for the position to be maintained in the network (unsigned integer)
   113  	MaintenanceLevel string `json:"maintenanceLevel"`
   114  	// If the margin is between maintenance and search, the network will initiate a collateral search, expressed as unsigned integer
   115  	SearchLevel string `json:"searchLevel"`
   116  	// This is the minimum margin required for a party to place a new order on the network, expressed as unsigned integer
   117  	InitialLevel string `json:"initialLevel"`
   118  	// When in isolated margin, the required order margin level, otherwise, 0
   119  	OrderMarginLevel string `json:"orderMarginLevel"`
   120  	// If the margin of the party is greater than this level, then collateral will be released from the margin account into
   121  	// the general account of the party for the given asset.
   122  	CollateralReleaseLevel string `json:"collateralReleaseLevel"`
   123  	// Margin mode of the party, cross margin or isolated margin
   124  	MarginMode vega.MarginMode `json:"marginMode"`
   125  	// Margin factor, only relevant for isolated margin mode, else 0
   126  	MarginFactor string `json:"marginFactor"`
   127  }
   128  
   129  // An auction duration is used to configure 3 auction periods:
   130  // 1. `duration > 0`, `volume == 0`:
   131  // The auction will last for at least N seconds.
   132  // 2. `duration == 0`, `volume > 0`:
   133  // The auction will end once the given volume will match at uncrossing.
   134  // 3. `duration > 0`, `volume > 0`:
   135  // The auction will take at least N seconds, but can end sooner if the market can trade a certain volume.
   136  type AuctionDuration struct {
   137  	// Duration of the auction in seconds
   138  	DurationSecs int `json:"durationSecs"`
   139  	// Target uncrossing trading volume
   140  	Volume int `json:"volume"`
   141  }
   142  
   143  type BatchProposal struct {
   144  	// Proposal ID that is provided by Vega once proposal reaches the network
   145  	ID *string `json:"id,omitempty"`
   146  	// A UUID reference to aid tracking proposals on Vega
   147  	Reference string `json:"reference"`
   148  	// Party that prepared the proposal
   149  	Party *vega.Party `json:"party"`
   150  	// State of the proposal
   151  	State vega.Proposal_State `json:"state"`
   152  	// RFC3339Nano time and date when the proposal reached the network
   153  	Datetime int64 `json:"datetime"`
   154  	// Terms of all the proposals in the batch
   155  	BatchTerms *vega.BatchProposalTerms `json:"batchTerms,omitempty"`
   156  	// Rationale behind the proposal
   157  	Rationale *vega.ProposalRationale `json:"rationale"`
   158  	// Votes cast for this proposal
   159  	Votes *ProposalVotes `json:"votes"`
   160  	// Reason the proposal was rejected
   161  	RejectionReason *vega.ProposalError `json:"rejectionReason,omitempty"`
   162  	// Details of the rejection reason
   163  	ErrorDetails *string `json:"errorDetails,omitempty"`
   164  	// Required majority for this proposal to succeed
   165  	RequiredMajority string `json:"requiredMajority"`
   166  	// Required participation for this proposal to succeed
   167  	RequiredParticipation string `json:"requiredParticipation"`
   168  	// Equity-like share required for a market amendment proposal to be enacted, represented as a fraction that can be converted to a percentage. If not met, the proposal will not be enacted
   169  	RequiredLpMajority *string `json:"requiredLpMajority,omitempty"`
   170  	// The market share of LPs' equity-like share that must take part in a market amendment vote for the proposal to pass. This means the votes of LPs that have submitted more liquidity to that market, or have been LPs from the start carry more weight. If it requires 50% of a market's equity-like share for a majority, and the full batch of proposals receives all YES votes but only LPs with 49% of the equity-like share voted, the proposal will not pass
   171  	RequiredLpParticipation *string `json:"requiredLpParticipation,omitempty"`
   172  	// Proposals that are part of the batch
   173  	SubProposals []*vega.Proposal `json:"subProposals,omitempty"`
   174  }
   175  
   176  func (BatchProposal) IsProposalNode() {}
   177  
   178  // A Vega builtin asset, mostly for testing purpose
   179  type BuiltinAsset struct {
   180  	// Maximum amount that can be requested by a party through the built-in asset faucet at a time
   181  	MaxFaucetAmountMint string `json:"maxFaucetAmountMint"`
   182  }
   183  
   184  func (BuiltinAsset) IsAssetSource() {}
   185  
   186  type BusEvent struct {
   187  	// The ID for this event
   188  	ID string `json:"id"`
   189  	// The block hash
   190  	Block string `json:"block"`
   191  	// The type of event
   192  	Type BusEventType `json:"type"`
   193  	// The payload - the wrapped event
   194  	Event Event `json:"event"`
   195  }
   196  
   197  // Condition describes the condition that must be validated by the data source engine
   198  type Condition struct {
   199  	// The type of comparison to make on the value.
   200  	Operator v1.Condition_Operator `json:"operator"`
   201  	// The value to compare against.
   202  	Value *string `json:"value,omitempty"`
   203  }
   204  
   205  // A mode where Vega tries to execute orders as soon as they are received
   206  type ContinuousTrading struct {
   207  	// Size of an increment in price in terms of the quote currency
   208  	TickSize string `json:"tickSize"`
   209  }
   210  
   211  // A data source contains the data sent by a data source
   212  type Data struct {
   213  	// signers is the list of public keys/ETH addresses that signed the data
   214  	Signers []*Signer `json:"signers,omitempty"`
   215  	// properties contains all the properties sent by a data source
   216  	Data     []*v1.Property `json:"data,omitempty"`
   217  	MetaData []*v1.Property `json:"metaData,omitempty"`
   218  	// List of all the data specs that matched this source data.
   219  	// When the array is empty, it means no data spec matched this source data.
   220  	MatchedSpecIds []string `json:"matchedSpecIds,omitempty"`
   221  	// RFC3339Nano formatted date and time for when the data was broadcast to the markets
   222  	// with a matching data spec.
   223  	// It has no value when the source data does not match any data spec.
   224  	BroadcastAt int64 `json:"broadcastAt"`
   225  }
   226  
   227  // An data source specification describes the data source data that a product (or a risk model)
   228  // wants to get from the oracle engine.
   229  type DataSourceSpec struct {
   230  	// ID is a hash generated from the DataSourceSpec data.
   231  	ID string `json:"id"`
   232  	// RFC3339Nano creation date time
   233  	CreatedAt int64 `json:"createdAt"`
   234  	// RFC3339Nano last updated timestamp
   235  	UpdatedAt *int64                     `json:"updatedAt,omitempty"`
   236  	Data      *vega.DataSourceDefinition `json:"data"`
   237  	// Status describes the status of the data source spec
   238  	Status DataSourceSpecStatus `json:"status"`
   239  }
   240  
   241  type DiscountFactors struct {
   242  	// The proportion of the referee's taker infrastructure fees to be discounted
   243  	InfrastructureFactor string `json:"infrastructureFactor"`
   244  	// The proportion of the referee's taker maker fees to be discounted
   245  	MakerFactor string `json:"makerFactor"`
   246  	// The proportion of the referee's taker liquidity fees to be discounted
   247  	LiquidityFactor string `json:"liquidityFactor"`
   248  }
   249  
   250  // Frequent batch auctions trading mode
   251  type DiscreteTrading struct {
   252  	// Duration of the discrete trading batch in nanoseconds. Maximum 1 month.
   253  	Duration int `json:"duration"`
   254  	// Size of an increment in price in terms of the quote currency
   255  	TickSize string `json:"tickSize"`
   256  }
   257  
   258  // An asset originated from an Ethereum ERC20 Token
   259  type Erc20 struct {
   260  	// The address of the ERC20 contract
   261  	ContractAddress string `json:"contractAddress"`
   262  	// The lifetime limits deposit per address
   263  	// Note: this is a temporary measure that can be changed by governance
   264  	LifetimeLimit string `json:"lifetimeLimit"`
   265  	// The maximum you can withdraw instantly. All withdrawals over the threshold will be delayed by the withdrawal delay.
   266  	// There is no limit on the size of a withdrawal
   267  	// Note: this is a temporary measure that can be changed by governance
   268  	WithdrawThreshold string `json:"withdrawThreshold"`
   269  	// The chain ID the asset originates from.
   270  	ChainID string `json:"chainId"`
   271  }
   272  
   273  func (Erc20) IsAssetSource() {}
   274  
   275  type ERC20MultiSigSignerAddedBundleEdge struct {
   276  	Node   *v2.ERC20MultiSigSignerAddedBundle `json:"node"`
   277  	Cursor string                             `json:"cursor"`
   278  }
   279  
   280  // Response for the signature bundle to add a particular validator to the signer list of the multisig contract
   281  type ERC20MultiSigSignerAddedConnection struct {
   282  	Edges    []*ERC20MultiSigSignerAddedBundleEdge `json:"edges,omitempty"`
   283  	PageInfo *v2.PageInfo                          `json:"pageInfo,omitempty"`
   284  }
   285  
   286  type ERC20MultiSigSignerRemovedBundleEdge struct {
   287  	Node   *v2.ERC20MultiSigSignerRemovedBundle `json:"node"`
   288  	Cursor string                               `json:"cursor"`
   289  }
   290  
   291  // Response for the signature bundle to remove a particular validator from the signer list of the multisig contract
   292  type ERC20MultiSigSignerRemovedConnection struct {
   293  	// The list of signer bundles for that validator
   294  	Edges []*ERC20MultiSigSignerRemovedBundleEdge `json:"edges,omitempty"`
   295  	// The pagination information
   296  	PageInfo *v2.PageInfo `json:"pageInfo,omitempty"`
   297  }
   298  
   299  // Response for the signature bundle to update the token limits (maxLifetimeDeposit and withdrawThreshold) for a given ERC20 token (already allowlisted) in the collateral bridge
   300  type ERC20SetAssetLimitsBundle struct {
   301  	// The address of the asset on ethereum
   302  	AssetSource string `json:"assetSource"`
   303  	// The ID of the vega asset
   304  	VegaAssetID string `json:"vegaAssetId"`
   305  	// The nonce, which is actually the internal reference for the proposal
   306  	Nonce string `json:"nonce"`
   307  	// The lifetime limit deposit for this asset
   308  	LifetimeLimit string `json:"lifetimeLimit"`
   309  	// The threshold withdraw for this asset
   310  	Threshold string `json:"threshold"`
   311  	// The signatures bundle as hex encoded data, forward by 0x
   312  	// e.g: 0x + sig1 + sig2 + ... + sixN
   313  	Signatures string `json:"signatures"`
   314  }
   315  
   316  type ETHAddress struct {
   317  	Address *string `json:"address,omitempty"`
   318  }
   319  
   320  func (ETHAddress) IsSignerKind() {}
   321  
   322  // Summary of a node's rewards for a given epoch
   323  type EpochParticipation struct {
   324  	Epoch *vega.Epoch `json:"epoch,omitempty"`
   325  	// RFC3339 timestamp
   326  	Offline *int64 `json:"offline,omitempty"`
   327  	// RFC3339 timestamp
   328  	Online *int64 `json:"online,omitempty"`
   329  	// Total amount rewarded for participation in the given epoch
   330  	TotalRewards *float64 `json:"totalRewards,omitempty"`
   331  }
   332  
   333  // Response for the signature bundle to allowlist an ERC20 token in the collateral bridge
   334  type Erc20ListAssetBundle struct {
   335  	// The source asset in the ethereum network
   336  	AssetSource string `json:"assetSource"`
   337  	// The ID of the vega asset
   338  	VegaAssetID string `json:"vegaAssetId"`
   339  	// The nonce to be used in the request
   340  	Nonce string `json:"nonce"`
   341  	// Signature aggregate from the nodes, in the following format:
   342  	// 0x + sig1 + sig2 + ... + sigN
   343  	Signatures string `json:"signatures"`
   344  }
   345  
   346  // All the data related to the approval of a withdrawal from the network
   347  type Erc20WithdrawalApproval struct {
   348  	// The source asset on the bridged EVM chain
   349  	AssetSource string `json:"assetSource"`
   350  	// The amount to be withdrawn
   351  	Amount string `json:"amount"`
   352  	// The nonce to be used in the request
   353  	Nonce string `json:"nonce"`
   354  	// Signature aggregate from the nodes, in the following format:
   355  	// 0x + sig1 + sig2 + ... + sigN
   356  	Signatures string `json:"signatures"`
   357  	// The target address that will receive the funds
   358  	TargetAddress string `json:"targetAddress"`
   359  	// RFC3339Nano timestamp at which the withdrawal was created
   360  	Creation string `json:"creation"`
   361  	// The chain ID of the bridged EVM chain
   362  	SourceChainID string `json:"sourceChainId"`
   363  }
   364  
   365  // Specific details for an erc20 withdrawal
   366  type Erc20WithdrawalDetails struct {
   367  	// The ethereum address of the receiver of the asset funds
   368  	ReceiverAddress string `json:"receiverAddress"`
   369  }
   370  
   371  func (Erc20WithdrawalDetails) IsWithdrawalDetails() {}
   372  
   373  // EthCallTrigger is the type of trigger used to make calls to Ethereum network.
   374  type EthCallTrigger struct {
   375  	Trigger TriggerKind `json:"trigger"`
   376  }
   377  
   378  // Trigger for an Ethereum call based on the Ethereum block timestamp. Can be
   379  // one-off or repeating.
   380  type EthTimeTrigger struct {
   381  	// Trigger when the Ethereum time is greater or equal to this time, in Unix seconds.
   382  	Initial *int64 `json:"initial,omitempty"`
   383  	// Repeat the call every n seconds after the initial call. If no time for
   384  	// initial call was specified, begin repeating immediately.
   385  	Every *int `json:"every,omitempty"`
   386  	// If repeating, stop once Ethereum time is greater than this time, in Unix
   387  	// seconds. If not set, then repeat indefinitely.
   388  	Until *int64 `json:"until,omitempty"`
   389  }
   390  
   391  func (EthTimeTrigger) IsTriggerKind() {}
   392  
   393  // An Ethereum data source
   394  type EthereumEvent struct {
   395  	// The ID of the ethereum contract to use (string)
   396  	ContractID string `json:"contractId"`
   397  	// Name of the Ethereum event to listen to. (string)
   398  	Event string `json:"event"`
   399  }
   400  
   401  func (EthereumEvent) IsOracle() {}
   402  
   403  type ExternalData struct {
   404  	Data *Data `json:"data"`
   405  }
   406  
   407  // externalDataSourceSpec is the type that wraps the DataSourceSpec type in order to be further used/extended
   408  // by the OracleSpec
   409  type ExternalDataSourceSpec struct {
   410  	Spec *DataSourceSpec `json:"spec"`
   411  }
   412  
   413  // An estimate of the fee to be paid for the order
   414  type FeeEstimate struct {
   415  	// The estimated fees if the order was to trade
   416  	Fees *TradeFee `json:"fees"`
   417  	// The total estimated amount of fees if the order was to trade
   418  	TotalFeeAmount string `json:"totalFeeAmount"`
   419  }
   420  
   421  // Filter describes the conditions under which oracle data is considered of
   422  // interest or not.
   423  type Filter struct {
   424  	// key is the data source data property key targeted by the filter.
   425  	Key *PropertyKey `json:"key"`
   426  	// The conditions that should be matched by the data to be
   427  	// considered of interest.
   428  	Conditions []*Condition `json:"conditions,omitempty"`
   429  }
   430  
   431  type GamePartyScoreFilter struct {
   432  	// Zero or more game IDs to filter by
   433  	GameIds []string `json:"gameIds,omitempty"`
   434  	// Zero or more team IDs to filter by
   435  	TeamIds []string `json:"teamIds,omitempty"`
   436  	// Zero or more party IDs to filter by
   437  	PartyIds []string `json:"partyIds,omitempty"`
   438  	// Optional 'from epoch' ID for scores epoch interval
   439  	EpochFrom *int `json:"epochFrom,omitempty"`
   440  	// Optional 'to epoch' ID for scores epoch interval
   441  	EpochTo *int `json:"epochTo,omitempty"`
   442  }
   443  
   444  type GameTeamScoreFilter struct {
   445  	// Zero or more game IDs to filter by
   446  	GameIds []string `json:"gameIds,omitempty"`
   447  	// Zero or more team IDs to filter by
   448  	TeamIds []string `json:"teamIds,omitempty"`
   449  	// Optional 'from epoch' ID for scores epoch interval
   450  	EpochFrom *int `json:"epochFrom,omitempty"`
   451  	// Optional 'to epoch' ID for scores epoch interval
   452  	EpochTo *int `json:"epochTo,omitempty"`
   453  }
   454  
   455  // Individual party participating in a game and their metrics
   456  type IndividualGameEntity struct {
   457  	// Party ID of the participant
   458  	Individual string `json:"individual"`
   459  	// The rank of the individual within the game. If the individual is in a team, then the rank of the individual in the team
   460  	Rank int `json:"rank"`
   461  	// The volume traded by the individual
   462  	Volume string `json:"volume"`
   463  	// The reward metric applied to the game
   464  	RewardMetric vega.DispatchMetric `json:"rewardMetric"`
   465  	// The rewards earned by the individual during the epoch
   466  	RewardEarned string `json:"rewardEarned"`
   467  	// Total rewards earned by the individual during the game
   468  	TotalRewardsEarned string `json:"totalRewardsEarned"`
   469  	// The rewards earned by the individual during the epoch in quantum value
   470  	RewardEarnedQuantum string `json:"rewardEarnedQuantum"`
   471  	// Total rewards earned by the individual during the game in quantum value
   472  	TotalRewardsEarnedQuantum string `json:"totalRewardsEarnedQuantum"`
   473  }
   474  
   475  func (IndividualGameEntity) IsGameEntity() {}
   476  
   477  // Configuration of a market liquidity monitoring parameters
   478  type LiquidityMonitoringParameters struct {
   479  	// Specifies parameters related to target stake calculation
   480  	TargetStakeParameters *TargetStakeParameters `json:"targetStakeParameters"`
   481  }
   482  
   483  // The equity-like share of liquidity fee for each liquidity provider
   484  type LiquidityProviderFeeShare struct {
   485  	// The liquidity provider party ID
   486  	Party *vega.Party `json:"party"`
   487  	// The share owned by this liquidity provider
   488  	EquityLikeShare string `json:"equityLikeShare"`
   489  	// The average entry valuation of the liquidity provider for the market
   490  	AverageEntryValuation string `json:"averageEntryValuation"`
   491  	// The average liquidity score
   492  	AverageScore string `json:"averageScore"`
   493  	// The virtual stake for this liquidity provider
   494  	VirtualStake string `json:"virtualStake"`
   495  }
   496  
   497  // The SLA statistics for each liquidity provider
   498  type LiquidityProviderSLA struct {
   499  	// The liquidity provider party ID
   500  	Party *vega.Party `json:"party"`
   501  	// Indicates how often LP meets the commitment during the current epoch.
   502  	CurrentEpochFractionOfTimeOnBook string `json:"currentEpochFractionOfTimeOnBook"`
   503  	// Indicates how often LP met the commitment in the previous epoch.
   504  	LastEpochFractionOfTimeOnBook string `json:"lastEpochFractionOfTimeOnBook"`
   505  	// Indicates the fee penalty amount applied in the previous epoch.
   506  	LastEpochFeePenalty string `json:"lastEpochFeePenalty"`
   507  	// Indicates the bond penalty amount applied in the previous epoch.
   508  	LastEpochBondPenalty string `json:"lastEpochBondPenalty"`
   509  	// Determines how the fee penalties from past epochs affect future fee revenue.
   510  	HysteresisPeriodFeePenalties []string `json:"hysteresisPeriodFeePenalties,omitempty"`
   511  	// Represents the total amount of funds LP must supply. The amount to be supplied is in the market’s settlement currency, spread on both buy and sell sides of the order book within a defined range.
   512  	RequiredLiquidity string `json:"requiredLiquidity"`
   513  	// Notional volume of orders within the range provided on the buy side of the book.
   514  	NotionalVolumeBuys string `json:"notionalVolumeBuys"`
   515  	// Notional volume of orders within the range provided on the sell side of the book.
   516  	NotionalVolumeSells string `json:"notionalVolumeSells"`
   517  }
   518  
   519  type LossSocialization struct {
   520  	// The market ID where loss socialization happened
   521  	MarketID string `json:"marketId"`
   522  	// The party that was part of the loss socialization
   523  	PartyID string `json:"partyId"`
   524  	// The amount lost
   525  	Amount string `json:"amount"`
   526  }
   527  
   528  // The liquidity commitments for this market
   529  type MarketDataCommitments struct {
   530  	// A set of liquidity sell orders to meet the liquidity provision obligation.
   531  	Sells []*vega.LiquidityOrderReference `json:"sells,omitempty"`
   532  	// A set of liquidity buy orders to meet the liquidity provision obligation.
   533  	Buys []*vega.LiquidityOrderReference `json:"buys,omitempty"`
   534  }
   535  
   536  type MarketDepthTrade struct {
   537  	// ID of the trade for the given market (if available)
   538  	ID string `json:"id"`
   539  	// Price of the trade
   540  	Price string `json:"price"`
   541  	// Size of the trade
   542  	Size string `json:"size"`
   543  }
   544  
   545  type MarketEvent struct {
   546  	// The market ID
   547  	MarketID string `json:"marketId"`
   548  	// The message - market events are used for logging
   549  	Payload string `json:"payload"`
   550  }
   551  
   552  type MarketTick struct {
   553  	// The market ID
   554  	MarketID string `json:"marketId"`
   555  	// The block time
   556  	Time string `json:"time"`
   557  }
   558  
   559  type NewProtocolAutomatedPurchase struct {
   560  	// The source token that will be swapped
   561  	From string `json:"from"`
   562  	// The account type for the network from which the tokens will be sourced
   563  	FromAccountType vega.AccountType `json:"fromAccountType"`
   564  	// The account type for the network to which the purchased tokens will be sent
   565  	ToAccountType vega.AccountType `json:"toAccountType"`
   566  	// The market that will be used to enact the purchase/sale
   567  	MarketID *string `json:"marketId,omitempty"`
   568  	// The oracle that will define an approximate acceptable price for the transaction
   569  	PriceOracle *vega.DataSourceDefinition `json:"priceOracle"`
   570  	// The final acceptable price is the price oracle value weighted by this factor (e.g. 1.05 to allow for 5% slippage on the purchase)
   571  	OracleOffsetFactor string `json:"oracleOffsetFactor"`
   572  	// A time based oracle for when auctions will occur
   573  	AuctionSchedule *vega.DataSourceDefinition `json:"auctionSchedule,omitempty"`
   574  	// The duration of the auction
   575  	AuctionDuration string `json:"auctionDuration"`
   576  	// A time based oracle for when an observation will be taken of the balance of the source account. This will emit an event notifying of the balance planned to exchange, along with storing this value. When an auction occurs, the latest reading for this value will be used for the volume to trade, rather than the full balance of the account
   577  	AuctionVolumeSnapshotSchedule *vega.DataSourceDefinition `json:"auctionVolumeSnapshotSchedule"`
   578  	// Minimum number of tokens to be sold (specified in asset decimals). If less than this is available in the account at the last snapshot before auction, no auction will occur and the balance will roll over to the next scheduled auction
   579  	MinimumAuctionSize string `json:"minimumAuctionSize"`
   580  	// Maximum number of tokens to be sold (specified in asset decimals). If more than this is available in the account at the last snapshot before auction, this maximum value will be used instead, and the remainder will be rolled over to the next scheduled auction
   581  	MaximumAuctionSize string `json:"maximumAuctionSize"`
   582  	// The expiry timestamp in seconds of the automated purchase. 0 if no expiry configured
   583  	ExpiryTimestamp int `json:"expiryTimestamp"`
   584  	// For how long the price from the price oracle is considered usable, in seconds
   585  	OraclePriceStalenessTolerance string `json:"oraclePriceStalenessTolerance"`
   586  }
   587  
   588  func (NewProtocolAutomatedPurchase) IsProposalChange() {}
   589  
   590  // Details on the collection of nodes for particular validator status
   591  type NodeSet struct {
   592  	// Total number of nodes in the node set
   593  	Total int `json:"total"`
   594  	// Number of nodes in the node set that had a performance score of 0 at the end of the last epoch
   595  	Inactive int `json:"inactive"`
   596  	// IDs of the nodes that were promoted into this node set at the start of the epoch
   597  	Promoted []string `json:"promoted,omitempty"`
   598  	// IDs of the nodes that were demoted into this node set at the start of the epoch
   599  	Demoted []string `json:"demoted,omitempty"`
   600  	// Total number of nodes allowed in the node set
   601  	Maximum *int `json:"maximum,omitempty"`
   602  }
   603  
   604  // Normaliser to convert the data returned from the contract method
   605  // into a standard format.
   606  type Normaliser struct {
   607  	Name       string `json:"name"`
   608  	Expression string `json:"expression"`
   609  }
   610  
   611  // The equity-like share of liquidity fee for each liquidity provider
   612  type ObservableLiquidityProviderFeeShare struct {
   613  	// The liquidity provider party ID
   614  	PartyID string `json:"partyId"`
   615  	// The share owned by this liquidity provider (float)
   616  	EquityLikeShare string `json:"equityLikeShare"`
   617  	// The average entry valuation of the liquidity provider for the market
   618  	AverageEntryValuation string `json:"averageEntryValuation"`
   619  	// The average liquidity score
   620  	AverageScore string `json:"averageScore"`
   621  }
   622  
   623  // The SLA statistics for each liquidity provider
   624  type ObservableLiquidityProviderSLA struct {
   625  	// The liquidity provider party ID
   626  	Party string `json:"party"`
   627  	// Indicates how often LP meets the commitment during the current epoch.
   628  	CurrentEpochFractionOfTimeOnBook string `json:"currentEpochFractionOfTimeOnBook"`
   629  	// Indicates how often LP meets the commitment during last epoch.
   630  	LastEpochFractionOfTimeOnBook string `json:"lastEpochFractionOfTimeOnBook"`
   631  	// Indicates the fee penalty amount applied in the previous epoch.
   632  	LastEpochFeePenalty string `json:"lastEpochFeePenalty"`
   633  	// Indicates the bond penalty amount applied in the previous epoch.
   634  	LastEpochBondPenalty string `json:"lastEpochBondPenalty"`
   635  	// Determines how the fee penalties from past epochs affect future fee revenue.
   636  	HysteresisPeriodFeePenalties []string `json:"hysteresisPeriodFeePenalties,omitempty"`
   637  	// Represents the total amount of funds LP must supply. The amount to be supplied is in the market’s settlement currency, spread on both buy and sell sides of the order book within a defined range.
   638  	RequiredLiquidity string `json:"requiredLiquidity"`
   639  	// Notional volume of orders within the range provided on the buy side of the book.
   640  	NotionalVolumeBuys string `json:"notionalVolumeBuys"`
   641  	// Notional volume of orders within the range provided on the sell side of the book.
   642  	NotionalVolumeSells string `json:"notionalVolumeSells"`
   643  }
   644  
   645  type OrderByMarketAndPartyIdsFilter struct {
   646  	Order     *v2.OrderFilter `json:"order,omitempty"`
   647  	MarketIds []string        `json:"marketIds,omitempty"`
   648  	PartyIds  []string        `json:"partyIds,omitempty"`
   649  }
   650  
   651  type OrderByMarketIdsFilter struct {
   652  	Order     *v2.OrderFilter `json:"order,omitempty"`
   653  	MarketIds []string        `json:"marketIds,omitempty"`
   654  }
   655  
   656  type OrderByPartyIdsFilter struct {
   657  	Order    *v2.OrderFilter `json:"order,omitempty"`
   658  	PartyIds []string        `json:"partyIds,omitempty"`
   659  }
   660  
   661  // An estimate of the fee to be paid by the order
   662  type OrderEstimate struct {
   663  	// The estimated fee if the order was to trade
   664  	Fee *TradeFee `json:"fee"`
   665  	// The total estimated amount of fee if the order was to trade
   666  	TotalFeeAmount string `json:"totalFeeAmount"`
   667  	// The margin requirement for this order
   668  	MarginLevels *vega.MarginLevels `json:"marginLevels"`
   669  }
   670  
   671  // Response for the estimate of the margin level and, if available, collateral was provided in the request, liquidation price for the specified position
   672  type PositionEstimate struct {
   673  	// Margin level range estimate for the specified position
   674  	Margin *v2.MarginEstimate `json:"margin"`
   675  	// Estimated margin account balance increase
   676  	CollateralIncreaseEstimate *v2.CollateralIncreaseEstimate `json:"collateralIncreaseEstimate"`
   677  	// Liquidation price range estimate for the specified position. Only populated if available collateral was specified in the request
   678  	Liquidation *v2.LiquidationEstimate `json:"liquidation,omitempty"`
   679  }
   680  
   681  type PositionResolution struct {
   682  	// The market ID where position resolution happened
   683  	MarketID string `json:"marketId"`
   684  	// Number of distressed parties on market
   685  	Distressed int `json:"distressed"`
   686  	// Number of parties closed out
   687  	Closed int `json:"closed"`
   688  	// The mark price at which parties were distressed/closed out
   689  	MarkPrice string `json:"markPrice"`
   690  }
   691  
   692  // Range of valid prices and the associated price monitoring trigger
   693  type PriceMonitoringBounds struct {
   694  	// Minimum price that isn't currently breaching the specified price monitoring trigger
   695  	MinValidPrice string `json:"minValidPrice"`
   696  	// Maximum price that isn't currently breaching the specified price monitoring trigger
   697  	MaxValidPrice string `json:"maxValidPrice"`
   698  	// Price monitoring trigger associated with the bounds
   699  	Trigger *PriceMonitoringTrigger `json:"trigger"`
   700  	// Reference price used to calculate the valid price range
   701  	ReferencePrice string `json:"referencePrice"`
   702  	// Has this bound been triggered yet or is it still active
   703  	Active *bool `json:"active,omitempty"`
   704  }
   705  
   706  // PriceMonitoringParameters holds a list of triggers
   707  type PriceMonitoringParameters struct {
   708  	// The list of triggers for this price monitoring
   709  	Triggers []*PriceMonitoringTrigger `json:"triggers,omitempty"`
   710  }
   711  
   712  // Configuration of a market price monitoring auctions triggers
   713  type PriceMonitoringSettings struct {
   714  	// Specified a set of PriceMonitoringParameters to be use for price monitoring purposes
   715  	Parameters *PriceMonitoringParameters `json:"parameters,omitempty"`
   716  }
   717  
   718  // PriceMonitoringTrigger holds together price projection horizon τ, probability level p, and auction extension duration
   719  type PriceMonitoringTrigger struct {
   720  	// Price monitoring projection horizon τ in seconds (> 0).
   721  	HorizonSecs int `json:"horizonSecs"`
   722  	// Price monitoring probability level p. (>0 and < 1)
   723  	Probability float64 `json:"probability"`
   724  	// Price monitoring auction extension duration in seconds should the price
   725  	// breach its theoretical level over the specified horizon at the specified
   726  	// probability level (> 0)
   727  	AuctionExtensionSecs int `json:"auctionExtensionSecs"`
   728  }
   729  
   730  // PropertyKey describes the property key contained in a source data.
   731  type PropertyKey struct {
   732  	// The name of the property.
   733  	Name *string `json:"name,omitempty"`
   734  	// The type of the property.
   735  	Type v1.PropertyKey_Type `json:"type"`
   736  	// An optional decimal place to be applied on the provided value.
   737  	// Valid only for PropertyType of type DECIMAL, INTEGER.
   738  	NumberDecimalPlaces *int `json:"numberDecimalPlaces,omitempty"`
   739  }
   740  
   741  type ProposalVote struct {
   742  	// Cast vote
   743  	Vote *vega.Vote `json:"vote"`
   744  	// Proposal ID the vote is cast on
   745  	ProposalID string `json:"proposalId"`
   746  }
   747  
   748  // Connection type for retrieving cursor-based paginated proposal vote information
   749  type ProposalVoteConnection struct {
   750  	// The proposal votes in this connection
   751  	Edges []*ProposalVoteEdge `json:"edges,omitempty"`
   752  	// The pagination information
   753  	PageInfo *v2.PageInfo `json:"pageInfo,omitempty"`
   754  }
   755  
   756  // Edge type containing the proposal vote and cursor information returned by a ProposalVoteConnection
   757  type ProposalVoteEdge struct {
   758  	// The proposal vote
   759  	Node *ProposalVote `json:"node"`
   760  	// The cursor for this proposal vote
   761  	Cursor *string `json:"cursor,omitempty"`
   762  }
   763  
   764  type ProposalVoteSide struct {
   765  	// All votes cast for this side
   766  	Votes []*vega.Vote `json:"votes,omitempty"`
   767  	// Total number of votes cast for this side
   768  	TotalNumber string `json:"totalNumber"`
   769  	// Total weight of governance token from the votes cast for this side
   770  	TotalWeight string `json:"totalWeight"`
   771  	// Total number of governance tokens from the votes cast for this side
   772  	TotalTokens string `json:"totalTokens"`
   773  	// Total equity-like share weight for this side (only for UpdateMarket Proposals)
   774  	TotalEquityLikeShareWeight string `json:"totalEquityLikeShareWeight"`
   775  }
   776  
   777  type ProposalVotes struct {
   778  	// Yes votes cast for this proposal
   779  	Yes *ProposalVoteSide `json:"yes"`
   780  	// No votes cast for this proposal
   781  	No *ProposalVoteSide `json:"no"`
   782  }
   783  
   784  type ProtocolAutomatedPurchaseState struct {
   785  	// The ID of the active protocol automated purchase
   786  	ID string `json:"id"`
   787  	// The order ID of the active order placed on behalf of the active protocol automated purchase
   788  	OrderID *string `json:"orderId,omitempty"`
   789  }
   790  
   791  // Indicator showing whether the data-node is ready for the protocol upgrade to begin.
   792  type ProtocolUpgradeStatus struct {
   793  	Ready bool `json:"ready"`
   794  }
   795  
   796  type PubKey struct {
   797  	Key *string `json:"key,omitempty"`
   798  }
   799  
   800  func (PubKey) IsSignerKind() {}
   801  
   802  // Queries allow a caller to read data and filter data via GraphQL.
   803  type Query struct {
   804  }
   805  
   806  type RewardFactors struct {
   807  	// The proportion of the referee's taker infrastructure fees to be rewarded to the referrer
   808  	InfrastructureFactor string `json:"infrastructureFactor"`
   809  	// The proportion of the referee's taker maker fees to be rewarded to the referrer
   810  	MakerFactor string `json:"makerFactor"`
   811  	// The proportion of the referee's taker liquidity fees to be rewarded to the referrer
   812  	LiquidityFactor string `json:"liquidityFactor"`
   813  }
   814  
   815  // Connection type for retrieving cursor-based paginated reward summary information
   816  type RewardSummaryConnection struct {
   817  	// List of reward summaries available for the connection
   818  	Edges []*RewardSummaryEdge `json:"edges,omitempty"`
   819  	// Page information for the connection
   820  	PageInfo *v2.PageInfo `json:"pageInfo"`
   821  }
   822  
   823  // Edge type containing the reward summary and cursor information returned by a RewardSummaryConnection
   824  type RewardSummaryEdge struct {
   825  	// The reward summary
   826  	Node *vega.RewardSummary `json:"node"`
   827  	// Cursor identifying the reward summary
   828  	Cursor string `json:"cursor"`
   829  }
   830  
   831  type SettleDistressed struct {
   832  	// The market in which a position was closed out
   833  	MarketID string `json:"marketId"`
   834  	// The party that was closed out
   835  	PartyID string `json:"partyId"`
   836  	// The margin taken from distressed party
   837  	Margin string `json:"margin"`
   838  	// The price at which the position was closed out
   839  	Price string `json:"price"`
   840  }
   841  
   842  type SettlePosition struct {
   843  	// The market in which a position was settled
   844  	MarketID string `json:"marketId"`
   845  	// The party who settled a position
   846  	PartyID string `json:"partyId"`
   847  	// The settle price
   848  	Price string `json:"price"`
   849  	// The trades that were settled to close the overall position
   850  	TradeSettlements []*TradeSettlement `json:"tradeSettlements,omitempty"`
   851  }
   852  
   853  // Signer is the authorized signature used for the data.
   854  type Signer struct {
   855  	Signer SignerKind `json:"signer"`
   856  }
   857  
   858  // Describes which property of the data source data should be
   859  // used as composite price source.
   860  type SpecBindingForCompositePrice struct {
   861  	PriceSourceProperty string `json:"priceSourceProperty"`
   862  }
   863  
   864  // All staking information related to a Party.
   865  // Contains the current recognised balance by the network and
   866  // all the StakeLink/Unlink seen by the network
   867  type StakingSummary struct {
   868  	// The stake currently available for the party
   869  	CurrentStakeAvailable string `json:"currentStakeAvailable"`
   870  	// The list of all stake link/unlink for the party
   871  	Linkings *v2.StakesConnection `json:"linkings"`
   872  }
   873  
   874  // Price at which a stop order will trigger
   875  type StopOrderPrice struct {
   876  	Price string `json:"price"`
   877  }
   878  
   879  func (StopOrderPrice) IsStopOrderTrigger() {}
   880  
   881  // Percentage movement in the price at which a stop order will trigger.
   882  type StopOrderTrailingPercentOffset struct {
   883  	TrailingPercentOffset string `json:"trailingPercentOffset"`
   884  }
   885  
   886  func (StopOrderTrailingPercentOffset) IsStopOrderTrigger() {}
   887  
   888  // Subscriptions allow a caller to receive new information as it is available from the Vega network.
   889  type Subscription struct {
   890  }
   891  
   892  // TargetStakeParameters contains parameters used in target stake calculation
   893  type TargetStakeParameters struct {
   894  	// Specifies length of time window expressed in seconds for target stake calculation
   895  	TimeWindow int `json:"timeWindow"`
   896  	// Specifies scaling factors used in target stake calculation
   897  	ScalingFactor float64 `json:"scalingFactor"`
   898  }
   899  
   900  // Team participating in a game and their metrics.
   901  type TeamGameEntity struct {
   902  	// Breakdown of the team members and their contributions to the total team metrics.
   903  	Team *TeamParticipation `json:"team"`
   904  	// Rank of the team within the game.
   905  	Rank int `json:"rank"`
   906  	// Total volume traded by the team
   907  	Volume string `json:"volume"`
   908  	// Reward metric applied to the game.
   909  	RewardMetric vega.DispatchMetric `json:"rewardMetric"`
   910  	// Total rewards earned by the team during the epoch
   911  	RewardEarned string `json:"rewardEarned"`
   912  	// Total rewards earned by the team for the game
   913  	TotalRewardsEarned string `json:"totalRewardsEarned"`
   914  	// Total rewards earned by the team during the epoch in quantum value
   915  	RewardEarnedQuantum string `json:"rewardEarnedQuantum"`
   916  	// Total rewards earned by the team for the game in quantum value
   917  	TotalRewardsEarnedQuantum string `json:"totalRewardsEarnedQuantum"`
   918  }
   919  
   920  func (TeamGameEntity) IsGameEntity() {}
   921  
   922  // Team participation information, i.e. the team ID and the metrics for each participating team member.
   923  type TeamParticipation struct {
   924  	// Team ID
   925  	TeamID string `json:"teamId"`
   926  	// List of participating team members and their metrics.
   927  	MembersParticipating []*IndividualGameEntity `json:"membersParticipating"`
   928  }
   929  
   930  type TimeUpdate struct {
   931  	// RFC3339Nano time of new block time
   932  	Timestamp int64 `json:"timestamp"`
   933  }
   934  
   935  func (TimeUpdate) IsEvent() {}
   936  
   937  // The fee paid by the party when a trade occurs
   938  type TradeFee struct {
   939  	// The maker fee, paid by the aggressive party to the other party (the one who had an order in the book)
   940  	MakerFee string `json:"makerFee"`
   941  	// The infrastructure fee, a fee paid to the validators to maintain the Vega network
   942  	InfrastructureFee string `json:"infrastructureFee"`
   943  	// The fee paid to the liquidity providers that committed liquidity to the market
   944  	LiquidityFee string `json:"liquidityFee"`
   945  	// The fee paid into the protocol buy-back account
   946  	BuyBackFee string `json:"buyBackFee"`
   947  	// The fee paid into the network treasury
   948  	TreasuryFee string `json:"treasuryFee"`
   949  	// The fee paid to a high-volume maker as a rebate
   950  	HighVolumeMakerFee string `json:"highVolumeMakerFee"`
   951  	// Referral discount on maker fees for the trade
   952  	MakerFeeReferralDiscount *string `json:"makerFeeReferralDiscount,omitempty"`
   953  	// Volume discount on maker fees for the trade
   954  	MakerFeeVolumeDiscount *string `json:"makerFeeVolumeDiscount,omitempty"`
   955  	// Referral discount on infrastructure fees for the trade
   956  	InfrastructureFeeReferralDiscount *string `json:"infrastructureFeeReferralDiscount,omitempty"`
   957  	// Volume discount on infrastructure fees for the trade
   958  	InfrastructureFeeVolumeDiscount *string `json:"infrastructureFeeVolumeDiscount,omitempty"`
   959  	// Referral discount on liquidity fees for the trade
   960  	LiquidityFeeReferralDiscount *string `json:"liquidityFeeReferralDiscount,omitempty"`
   961  	// Volume discount on liquidity fees for the trade
   962  	LiquidityFeeVolumeDiscount *string `json:"liquidityFeeVolumeDiscount,omitempty"`
   963  }
   964  
   965  type TradeSettlement struct {
   966  	// The size of the trade
   967  	Size int `json:"size"`
   968  	// The price of the trade
   969  	Price string `json:"price"`
   970  }
   971  
   972  // Filter to apply to the trade connection query
   973  type TradesFilter struct {
   974  	PartyIds  []string `json:"partyIds,omitempty"`
   975  	MarketIds []string `json:"marketIds,omitempty"`
   976  	OrderIds  []string `json:"orderIds,omitempty"`
   977  }
   978  
   979  // Filter to apply to the trade subscription request
   980  type TradesSubscriptionFilter struct {
   981  	PartyIds  []string `json:"partyIds,omitempty"`
   982  	MarketIds []string `json:"marketIds,omitempty"`
   983  }
   984  
   985  type TransactionSubmitted struct {
   986  	Success bool `json:"success"`
   987  }
   988  
   989  type TransferBalance struct {
   990  	// Account involved in transfer
   991  	Account *vega.AccountDetails `json:"account"`
   992  	// The new balance of the account
   993  	Balance string `json:"balance"`
   994  }
   995  
   996  // A transfer fee record
   997  type TransferFee struct {
   998  	// Transfer ID of the transfer for which the fee was paid
   999  	TransferID string `json:"transferId"`
  1000  	// The fee amount
  1001  	Amount string `json:"amount"`
  1002  	// The epoch when this fee was paid
  1003  	Epoch int `json:"epoch"`
  1004  }
  1005  
  1006  type TransferResponse struct {
  1007  	// The ledger entries and balances resulting from a transfer request
  1008  	Transfers []*vega.LedgerEntry `json:"transfers,omitempty"`
  1009  	// The balances of accounts involved in the transfer
  1010  	Balances []*TransferBalance `json:"balances,omitempty"`
  1011  }
  1012  
  1013  type TransferResponses struct {
  1014  	// A group of transfer responses - events from core
  1015  	Responses []*TransferResponse `json:"responses,omitempty"`
  1016  }
  1017  
  1018  // An asset originated from an Ethereum ERC20 Token
  1019  type UpdateErc20 struct {
  1020  	// The lifetime limits deposit per address
  1021  	// Note: this is a temporary measure that can be changed by governance
  1022  	LifetimeLimit string `json:"lifetimeLimit"`
  1023  	// The maximum you can withdraw instantly. All withdrawals over the threshold will be delayed by the withdrawal delay.
  1024  	// There is no limit on the size of a withdrawal
  1025  	// Note: this is a temporary measure that can be changed by governance
  1026  	WithdrawThreshold string `json:"withdrawThreshold"`
  1027  }
  1028  
  1029  func (UpdateErc20) IsUpdateAssetSource() {}
  1030  
  1031  type UpdateInstrumentConfiguration struct {
  1032  	Code    string                     `json:"code"`
  1033  	Name    string                     `json:"name"`
  1034  	Product UpdateProductConfiguration `json:"product"`
  1035  }
  1036  
  1037  type UpdateSpotInstrumentConfiguration struct {
  1038  	// Instrument code, human-readable shortcode used to describe the instrument.
  1039  	Code string `json:"code"`
  1040  	// Instrument name
  1041  	Name string `json:"name"`
  1042  }
  1043  
  1044  type UpdateVolumeRebateProgram struct {
  1045  	// The benefit tiers for the program
  1046  	BenefitTiers []*VolumeRebateBenefitTier `json:"benefitTiers"`
  1047  	// Timestamp as Unix time in nanoseconds, after which program ends.
  1048  	EndOfProgramTimestamp int64 `json:"endOfProgramTimestamp"`
  1049  	// The window length to consider for the volume discount program
  1050  	WindowLength int `json:"windowLength"`
  1051  }
  1052  
  1053  func (UpdateVolumeRebateProgram) IsProposalChange() {}
  1054  
  1055  type VolumeRebateBenefitTier struct {
  1056  	// The required volume fraction for a party to access this tier
  1057  	MinimumPartyMakerVolumeFraction string `json:"minimumPartyMakerVolumeFraction"`
  1058  	// The additional rebate factor (in percentage of trade_value_for_fee_purposes a party at this tier will receive when they are the maker side of a trade
  1059  	AdditionalMakerRebate string `json:"additionalMakerRebate"`
  1060  	// The tier number
  1061  	TierNumber *int `json:"tierNumber,omitempty"`
  1062  }
  1063  
  1064  // Event types
  1065  type BusEventType string
  1066  
  1067  const (
  1068  	// Vega Time has changed
  1069  	BusEventTypeTimeUpdate BusEventType = "TimeUpdate"
  1070  	// Collateral has deposited in to this Vega network via the bridge
  1071  	BusEventTypeDeposit BusEventType = "Deposit"
  1072  	// Collateral has been withdrawn from this Vega network via the bridge
  1073  	BusEventTypeWithdrawal BusEventType = "Withdrawal"
  1074  	// The results from processing at transaction
  1075  	BusEventTypeTransactionResult BusEventType = "TransactionResult"
  1076  )
  1077  
  1078  var AllBusEventType = []BusEventType{
  1079  	BusEventTypeTimeUpdate,
  1080  	BusEventTypeDeposit,
  1081  	BusEventTypeWithdrawal,
  1082  	BusEventTypeTransactionResult,
  1083  }
  1084  
  1085  func (e BusEventType) IsValid() bool {
  1086  	switch e {
  1087  	case BusEventTypeTimeUpdate, BusEventTypeDeposit, BusEventTypeWithdrawal, BusEventTypeTransactionResult:
  1088  		return true
  1089  	}
  1090  	return false
  1091  }
  1092  
  1093  func (e BusEventType) String() string {
  1094  	return string(e)
  1095  }
  1096  
  1097  func (e *BusEventType) UnmarshalGQL(v interface{}) error {
  1098  	str, ok := v.(string)
  1099  	if !ok {
  1100  		return fmt.Errorf("enums must be strings")
  1101  	}
  1102  
  1103  	*e = BusEventType(str)
  1104  	if !e.IsValid() {
  1105  		return fmt.Errorf("%s is not a valid BusEventType", str)
  1106  	}
  1107  	return nil
  1108  }
  1109  
  1110  func (e BusEventType) MarshalGQL(w io.Writer) {
  1111  	fmt.Fprint(w, strconv.Quote(e.String()))
  1112  }
  1113  
  1114  type CompositePriceType string
  1115  
  1116  const (
  1117  	// Composite price is calculated as a weighted average of the underlying price sources
  1118  	CompositePriceTypeCompositePriceTypeWeighted CompositePriceType = "COMPOSITE_PRICE_TYPE_WEIGHTED"
  1119  	// Composite price is calculated as a median of the underlying price sources
  1120  	CompositePriceTypeCompositePriceTypeMedian CompositePriceType = "COMPOSITE_PRICE_TYPE_MEDIAN"
  1121  	// Composite price is set to the last trade (legacy)
  1122  	CompositePriceTypeCompositePriceTypeLastTrade CompositePriceType = "COMPOSITE_PRICE_TYPE_LAST_TRADE"
  1123  )
  1124  
  1125  var AllCompositePriceType = []CompositePriceType{
  1126  	CompositePriceTypeCompositePriceTypeWeighted,
  1127  	CompositePriceTypeCompositePriceTypeMedian,
  1128  	CompositePriceTypeCompositePriceTypeLastTrade,
  1129  }
  1130  
  1131  func (e CompositePriceType) IsValid() bool {
  1132  	switch e {
  1133  	case CompositePriceTypeCompositePriceTypeWeighted, CompositePriceTypeCompositePriceTypeMedian, CompositePriceTypeCompositePriceTypeLastTrade:
  1134  		return true
  1135  	}
  1136  	return false
  1137  }
  1138  
  1139  func (e CompositePriceType) String() string {
  1140  	return string(e)
  1141  }
  1142  
  1143  func (e *CompositePriceType) UnmarshalGQL(v interface{}) error {
  1144  	str, ok := v.(string)
  1145  	if !ok {
  1146  		return fmt.Errorf("enums must be strings")
  1147  	}
  1148  
  1149  	*e = CompositePriceType(str)
  1150  	if !e.IsValid() {
  1151  		return fmt.Errorf("%s is not a valid CompositePriceType", str)
  1152  	}
  1153  	return nil
  1154  }
  1155  
  1156  func (e CompositePriceType) MarshalGQL(w io.Writer) {
  1157  	fmt.Fprint(w, strconv.Quote(e.String()))
  1158  }
  1159  
  1160  // Describes the status of the data spec
  1161  type DataSourceSpecStatus string
  1162  
  1163  const (
  1164  	// Describes an active data spec
  1165  	DataSourceSpecStatusStatusActive DataSourceSpecStatus = "STATUS_ACTIVE"
  1166  	// Describes a data spec that is not listening to data
  1167  	// anymore
  1168  	DataSourceSpecStatusStatusDeactivated DataSourceSpecStatus = "STATUS_DEACTIVATED"
  1169  )
  1170  
  1171  var AllDataSourceSpecStatus = []DataSourceSpecStatus{
  1172  	DataSourceSpecStatusStatusActive,
  1173  	DataSourceSpecStatusStatusDeactivated,
  1174  }
  1175  
  1176  func (e DataSourceSpecStatus) IsValid() bool {
  1177  	switch e {
  1178  	case DataSourceSpecStatusStatusActive, DataSourceSpecStatusStatusDeactivated:
  1179  		return true
  1180  	}
  1181  	return false
  1182  }
  1183  
  1184  func (e DataSourceSpecStatus) String() string {
  1185  	return string(e)
  1186  }
  1187  
  1188  func (e *DataSourceSpecStatus) UnmarshalGQL(v interface{}) error {
  1189  	str, ok := v.(string)
  1190  	if !ok {
  1191  		return fmt.Errorf("enums must be strings")
  1192  	}
  1193  
  1194  	*e = DataSourceSpecStatus(str)
  1195  	if !e.IsValid() {
  1196  		return fmt.Errorf("%s is not a valid DataSourceSpecStatus", str)
  1197  	}
  1198  	return nil
  1199  }
  1200  
  1201  func (e DataSourceSpecStatus) MarshalGQL(w io.Writer) {
  1202  	fmt.Fprint(w, strconv.Quote(e.String()))
  1203  }
  1204  
  1205  type GovernanceTransferType string
  1206  
  1207  const (
  1208  	// Default value, always invalid
  1209  	GovernanceTransferTypeGovernanceTransferTypeUnspecified GovernanceTransferType = "GOVERNANCE_TRANSFER_TYPE_UNSPECIFIED"
  1210  	// Transfers the specified amount or does not transfer anything
  1211  	GovernanceTransferTypeGovernanceTransferTypeAllOrNothing GovernanceTransferType = "GOVERNANCE_TRANSFER_TYPE_ALL_OR_NOTHING"
  1212  	// Transfers the specified amount or the max allowable amount if this is less than the specified amount
  1213  	GovernanceTransferTypeGovernanceTransferTypeBestEffort GovernanceTransferType = "GOVERNANCE_TRANSFER_TYPE_BEST_EFFORT"
  1214  )
  1215  
  1216  var AllGovernanceTransferType = []GovernanceTransferType{
  1217  	GovernanceTransferTypeGovernanceTransferTypeUnspecified,
  1218  	GovernanceTransferTypeGovernanceTransferTypeAllOrNothing,
  1219  	GovernanceTransferTypeGovernanceTransferTypeBestEffort,
  1220  }
  1221  
  1222  func (e GovernanceTransferType) IsValid() bool {
  1223  	switch e {
  1224  	case GovernanceTransferTypeGovernanceTransferTypeUnspecified, GovernanceTransferTypeGovernanceTransferTypeAllOrNothing, GovernanceTransferTypeGovernanceTransferTypeBestEffort:
  1225  		return true
  1226  	}
  1227  	return false
  1228  }
  1229  
  1230  func (e GovernanceTransferType) String() string {
  1231  	return string(e)
  1232  }
  1233  
  1234  func (e *GovernanceTransferType) UnmarshalGQL(v interface{}) error {
  1235  	str, ok := v.(string)
  1236  	if !ok {
  1237  		return fmt.Errorf("enums must be strings")
  1238  	}
  1239  
  1240  	*e = GovernanceTransferType(str)
  1241  	if !e.IsValid() {
  1242  		return fmt.Errorf("%s is not a valid GovernanceTransferType", str)
  1243  	}
  1244  	return nil
  1245  }
  1246  
  1247  func (e GovernanceTransferType) MarshalGQL(w io.Writer) {
  1248  	fmt.Fprint(w, strconv.Quote(e.String()))
  1249  }
  1250  
  1251  type MarketUpdateType string
  1252  
  1253  const (
  1254  	// Default value, always invalid
  1255  	MarketUpdateTypeMarketStateUpdateTypeUnspecified MarketUpdateType = "MARKET_STATE_UPDATE_TYPE_UNSPECIFIED"
  1256  	// Terminate the market
  1257  	MarketUpdateTypeMarketStateUpdateTypeTerminate MarketUpdateType = "MARKET_STATE_UPDATE_TYPE_TERMINATE"
  1258  	// Suspend the market
  1259  	MarketUpdateTypeMarketStateUpdateTypeSuspend MarketUpdateType = "MARKET_STATE_UPDATE_TYPE_SUSPEND"
  1260  	// Resume a suspended market
  1261  	MarketUpdateTypeMarketStateUpdateTypeResume MarketUpdateType = "MARKET_STATE_UPDATE_TYPE_RESUME"
  1262  )
  1263  
  1264  var AllMarketUpdateType = []MarketUpdateType{
  1265  	MarketUpdateTypeMarketStateUpdateTypeUnspecified,
  1266  	MarketUpdateTypeMarketStateUpdateTypeTerminate,
  1267  	MarketUpdateTypeMarketStateUpdateTypeSuspend,
  1268  	MarketUpdateTypeMarketStateUpdateTypeResume,
  1269  }
  1270  
  1271  func (e MarketUpdateType) IsValid() bool {
  1272  	switch e {
  1273  	case MarketUpdateTypeMarketStateUpdateTypeUnspecified, MarketUpdateTypeMarketStateUpdateTypeTerminate, MarketUpdateTypeMarketStateUpdateTypeSuspend, MarketUpdateTypeMarketStateUpdateTypeResume:
  1274  		return true
  1275  	}
  1276  	return false
  1277  }
  1278  
  1279  func (e MarketUpdateType) String() string {
  1280  	return string(e)
  1281  }
  1282  
  1283  func (e *MarketUpdateType) UnmarshalGQL(v interface{}) error {
  1284  	str, ok := v.(string)
  1285  	if !ok {
  1286  		return fmt.Errorf("enums must be strings")
  1287  	}
  1288  
  1289  	*e = MarketUpdateType(str)
  1290  	if !e.IsValid() {
  1291  		return fmt.Errorf("%s is not a valid MarketUpdateType", str)
  1292  	}
  1293  	return nil
  1294  }
  1295  
  1296  func (e MarketUpdateType) MarshalGQL(w io.Writer) {
  1297  	fmt.Fprint(w, strconv.Quote(e.String()))
  1298  }
  1299  
  1300  // Filter type for specifying the types of transfers to filter for
  1301  type TransferDirection string
  1302  
  1303  const (
  1304  	TransferDirectionTo       TransferDirection = "To"
  1305  	TransferDirectionFrom     TransferDirection = "From"
  1306  	TransferDirectionToOrFrom TransferDirection = "ToOrFrom"
  1307  )
  1308  
  1309  var AllTransferDirection = []TransferDirection{
  1310  	TransferDirectionTo,
  1311  	TransferDirectionFrom,
  1312  	TransferDirectionToOrFrom,
  1313  }
  1314  
  1315  func (e TransferDirection) IsValid() bool {
  1316  	switch e {
  1317  	case TransferDirectionTo, TransferDirectionFrom, TransferDirectionToOrFrom:
  1318  		return true
  1319  	}
  1320  	return false
  1321  }
  1322  
  1323  func (e TransferDirection) String() string {
  1324  	return string(e)
  1325  }
  1326  
  1327  func (e *TransferDirection) UnmarshalGQL(v interface{}) error {
  1328  	str, ok := v.(string)
  1329  	if !ok {
  1330  		return fmt.Errorf("enums must be strings")
  1331  	}
  1332  
  1333  	*e = TransferDirection(str)
  1334  	if !e.IsValid() {
  1335  		return fmt.Errorf("%s is not a valid TransferDirection", str)
  1336  	}
  1337  	return nil
  1338  }
  1339  
  1340  func (e TransferDirection) MarshalGQL(w io.Writer) {
  1341  	fmt.Fprint(w, strconv.Quote(e.String()))
  1342  }