Documentation
¶
Overview ¶
Package types is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func GetErrorFromUpdateResults(success bool, successPerUpdate []UpdateResult, updates []Update) error
- func NewCreateSettledFundingEvent(subaccount SubaccountId, perpetualId uint32, fundingPaid *big.Int) sdk.Event
- func RegisterCodec(cdc *codec.LegacyAmino)
- func RegisterInterfaces(registry cdctypes.InterfaceRegistry)
- func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error
- func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error
- func RegisterQueryServer(s grpc1.Server, srv QueryServer)
- type AssetPosition
- func (p *AssetPosition) DeepCopy() AssetPosition
- func (*AssetPosition) Descriptor() ([]byte, []int)
- func (m *AssetPosition) GetAssetId() uint32
- func (m *AssetPosition) GetBigQuantums() *big.Int
- func (m *AssetPosition) GetId() uint32
- func (m *AssetPosition) GetIndex() uint64
- func (m *AssetPosition) GetIsLong() bool
- func (m *AssetPosition) Marshal() (dAtA []byte, err error)
- func (m *AssetPosition) MarshalTo(dAtA []byte) (int, error)
- func (m *AssetPosition) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*AssetPosition) ProtoMessage()
- func (m *AssetPosition) Reset()
- func (m *AssetPosition) Size() (n int)
- func (m *AssetPosition) String() string
- func (m *AssetPosition) Unmarshal(dAtA []byte) error
- func (m *AssetPosition) XXX_DiscardUnknown()
- func (m *AssetPosition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *AssetPosition) XXX_Merge(src proto.Message)
- func (m *AssetPosition) XXX_Size() int
- func (m *AssetPosition) XXX_Unmarshal(b []byte) error
- type AssetUpdate
- type AssetsKeeper
- type BankKeeper
- type BaseQuantums
- type BlocktimeKeeper
- type GenesisState
- func (*GenesisState) Descriptor() ([]byte, []int)
- func (m *GenesisState) GetSubaccounts() []Subaccount
- func (m *GenesisState) Marshal() (dAtA []byte, err error)
- func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)
- func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GenesisState) ProtoMessage()
- func (m *GenesisState) Reset()
- func (m *GenesisState) Size() (n int)
- func (m *GenesisState) String() string
- func (m *GenesisState) Unmarshal(dAtA []byte) error
- func (gs GenesisState) Validate() error
- func (m *GenesisState) XXX_DiscardUnknown()
- func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GenesisState) XXX_Merge(src proto.Message)
- func (m *GenesisState) XXX_Size() int
- func (m *GenesisState) XXX_Unmarshal(b []byte) error
- type IsolatedPerpetualPositionStateTransition
- type PerpetualPosition
- func (p *PerpetualPosition) DeepCopy() PerpetualPosition
- func (*PerpetualPosition) Descriptor() ([]byte, []int)
- func (m *PerpetualPosition) GetBigQuantums() *big.Int
- func (m *PerpetualPosition) GetId() uint32
- func (m *PerpetualPosition) GetIsLong() bool
- func (m *PerpetualPosition) GetPerpetualId() uint32
- func (m *PerpetualPosition) GetQuoteBalance() *big.Int
- func (m *PerpetualPosition) Marshal() (dAtA []byte, err error)
- func (m *PerpetualPosition) MarshalTo(dAtA []byte) (int, error)
- func (m *PerpetualPosition) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PerpetualPosition) ProtoMessage()
- func (m *PerpetualPosition) Reset()
- func (m *PerpetualPosition) SetQuantums(sizeQuantums int64)
- func (m *PerpetualPosition) Size() (n int)
- func (m *PerpetualPosition) String() string
- func (m *PerpetualPosition) Unmarshal(dAtA []byte) error
- func (m *PerpetualPosition) XXX_DiscardUnknown()
- func (m *PerpetualPosition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PerpetualPosition) XXX_Merge(src proto.Message)
- func (m *PerpetualPosition) XXX_Size() int
- func (m *PerpetualPosition) XXX_Unmarshal(b []byte) error
- type PerpetualUpdate
- type PerpetualsKeeper
- type PositionSize
- type PositionStateTransition
- type PositionUpdate
- type QueryAllSubaccountRequest
- func (*QueryAllSubaccountRequest) Descriptor() ([]byte, []int)
- func (m *QueryAllSubaccountRequest) GetPagination() *query.PageRequest
- func (m *QueryAllSubaccountRequest) Marshal() (dAtA []byte, err error)
- func (m *QueryAllSubaccountRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryAllSubaccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryAllSubaccountRequest) ProtoMessage()
- func (m *QueryAllSubaccountRequest) Reset()
- func (m *QueryAllSubaccountRequest) Size() (n int)
- func (m *QueryAllSubaccountRequest) String() string
- func (m *QueryAllSubaccountRequest) Unmarshal(dAtA []byte) error
- func (m *QueryAllSubaccountRequest) XXX_DiscardUnknown()
- func (m *QueryAllSubaccountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryAllSubaccountRequest) XXX_Merge(src proto.Message)
- func (m *QueryAllSubaccountRequest) XXX_Size() int
- func (m *QueryAllSubaccountRequest) XXX_Unmarshal(b []byte) error
- type QueryClient
- type QueryCollateralPoolAddressRequest
- func (*QueryCollateralPoolAddressRequest) Descriptor() ([]byte, []int)
- func (m *QueryCollateralPoolAddressRequest) GetPerpetualId() uint32
- func (m *QueryCollateralPoolAddressRequest) Marshal() (dAtA []byte, err error)
- func (m *QueryCollateralPoolAddressRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryCollateralPoolAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryCollateralPoolAddressRequest) ProtoMessage()
- func (m *QueryCollateralPoolAddressRequest) Reset()
- func (m *QueryCollateralPoolAddressRequest) Size() (n int)
- func (m *QueryCollateralPoolAddressRequest) String() string
- func (m *QueryCollateralPoolAddressRequest) Unmarshal(dAtA []byte) error
- func (m *QueryCollateralPoolAddressRequest) XXX_DiscardUnknown()
- func (m *QueryCollateralPoolAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryCollateralPoolAddressRequest) XXX_Merge(src proto.Message)
- func (m *QueryCollateralPoolAddressRequest) XXX_Size() int
- func (m *QueryCollateralPoolAddressRequest) XXX_Unmarshal(b []byte) error
- type QueryCollateralPoolAddressResponse
- func (*QueryCollateralPoolAddressResponse) Descriptor() ([]byte, []int)
- func (m *QueryCollateralPoolAddressResponse) GetCollateralPoolAddress() string
- func (m *QueryCollateralPoolAddressResponse) Marshal() (dAtA []byte, err error)
- func (m *QueryCollateralPoolAddressResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryCollateralPoolAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryCollateralPoolAddressResponse) ProtoMessage()
- func (m *QueryCollateralPoolAddressResponse) Reset()
- func (m *QueryCollateralPoolAddressResponse) Size() (n int)
- func (m *QueryCollateralPoolAddressResponse) String() string
- func (m *QueryCollateralPoolAddressResponse) Unmarshal(dAtA []byte) error
- func (m *QueryCollateralPoolAddressResponse) XXX_DiscardUnknown()
- func (m *QueryCollateralPoolAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryCollateralPoolAddressResponse) XXX_Merge(src proto.Message)
- func (m *QueryCollateralPoolAddressResponse) XXX_Size() int
- func (m *QueryCollateralPoolAddressResponse) XXX_Unmarshal(b []byte) error
- type QueryGetSubaccountRequest
- func (*QueryGetSubaccountRequest) Descriptor() ([]byte, []int)
- func (m *QueryGetSubaccountRequest) GetNumber() uint32
- func (m *QueryGetSubaccountRequest) GetOwner() string
- func (m *QueryGetSubaccountRequest) Marshal() (dAtA []byte, err error)
- func (m *QueryGetSubaccountRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryGetSubaccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryGetSubaccountRequest) ProtoMessage()
- func (m *QueryGetSubaccountRequest) Reset()
- func (m *QueryGetSubaccountRequest) Size() (n int)
- func (m *QueryGetSubaccountRequest) String() string
- func (m *QueryGetSubaccountRequest) Unmarshal(dAtA []byte) error
- func (m *QueryGetSubaccountRequest) XXX_DiscardUnknown()
- func (m *QueryGetSubaccountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryGetSubaccountRequest) XXX_Merge(src proto.Message)
- func (m *QueryGetSubaccountRequest) XXX_Size() int
- func (m *QueryGetSubaccountRequest) XXX_Unmarshal(b []byte) error
- type QueryGetWithdrawalAndTransfersBlockedInfoRequest
- func (*QueryGetWithdrawalAndTransfersBlockedInfoRequest) Descriptor() ([]byte, []int)
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) GetPerpetualId() uint32
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) Marshal() (dAtA []byte, err error)
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryGetWithdrawalAndTransfersBlockedInfoRequest) ProtoMessage()
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) Reset()
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) Size() (n int)
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) String() string
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) Unmarshal(dAtA []byte) error
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) XXX_DiscardUnknown()
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) XXX_Merge(src proto.Message)
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) XXX_Size() int
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) XXX_Unmarshal(b []byte) error
- type QueryGetWithdrawalAndTransfersBlockedInfoResponse
- func (*QueryGetWithdrawalAndTransfersBlockedInfoResponse) Descriptor() ([]byte, []int)
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) GetChainOutageSeenAtBlock() uint32
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) GetNegativeTncSubaccountSeenAtBlock() uint32
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) GetWithdrawalsAndTransfersUnblockedAtBlock() uint32
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) Marshal() (dAtA []byte, err error)
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryGetWithdrawalAndTransfersBlockedInfoResponse) ProtoMessage()
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) Reset()
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) Size() (n int)
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) String() string
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) Unmarshal(dAtA []byte) error
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) XXX_DiscardUnknown()
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) XXX_Merge(src proto.Message)
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) XXX_Size() int
- func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) XXX_Unmarshal(b []byte) error
- type QueryServer
- type QuerySubaccountAllResponse
- func (*QuerySubaccountAllResponse) Descriptor() ([]byte, []int)
- func (m *QuerySubaccountAllResponse) GetPagination() *query.PageResponse
- func (m *QuerySubaccountAllResponse) GetSubaccount() []Subaccount
- func (m *QuerySubaccountAllResponse) Marshal() (dAtA []byte, err error)
- func (m *QuerySubaccountAllResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *QuerySubaccountAllResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QuerySubaccountAllResponse) ProtoMessage()
- func (m *QuerySubaccountAllResponse) Reset()
- func (m *QuerySubaccountAllResponse) Size() (n int)
- func (m *QuerySubaccountAllResponse) String() string
- func (m *QuerySubaccountAllResponse) Unmarshal(dAtA []byte) error
- func (m *QuerySubaccountAllResponse) XXX_DiscardUnknown()
- func (m *QuerySubaccountAllResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QuerySubaccountAllResponse) XXX_Merge(src proto.Message)
- func (m *QuerySubaccountAllResponse) XXX_Size() int
- func (m *QuerySubaccountAllResponse) XXX_Unmarshal(b []byte) error
- type QuerySubaccountResponse
- func (*QuerySubaccountResponse) Descriptor() ([]byte, []int)
- func (m *QuerySubaccountResponse) GetSubaccount() Subaccount
- func (m *QuerySubaccountResponse) Marshal() (dAtA []byte, err error)
- func (m *QuerySubaccountResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *QuerySubaccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QuerySubaccountResponse) ProtoMessage()
- func (m *QuerySubaccountResponse) Reset()
- func (m *QuerySubaccountResponse) Size() (n int)
- func (m *QuerySubaccountResponse) String() string
- func (m *QuerySubaccountResponse) Unmarshal(dAtA []byte) error
- func (m *QuerySubaccountResponse) XXX_DiscardUnknown()
- func (m *QuerySubaccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QuerySubaccountResponse) XXX_Merge(src proto.Message)
- func (m *QuerySubaccountResponse) XXX_Size() int
- func (m *QuerySubaccountResponse) XXX_Unmarshal(b []byte) error
- type SafetyHeapPositionSide
- type SettledUpdate
- type SortedSubaccountIds
- type StreamSubaccountUpdate
- func (*StreamSubaccountUpdate) Descriptor() ([]byte, []int)
- func (m *StreamSubaccountUpdate) GetSnapshot() bool
- func (m *StreamSubaccountUpdate) GetSubaccountId() *SubaccountId
- func (m *StreamSubaccountUpdate) GetUpdatedAssetPositions() []*SubaccountAssetPosition
- func (m *StreamSubaccountUpdate) GetUpdatedPerpetualPositions() []*SubaccountPerpetualPosition
- func (m *StreamSubaccountUpdate) Marshal() (dAtA []byte, err error)
- func (m *StreamSubaccountUpdate) MarshalTo(dAtA []byte) (int, error)
- func (m *StreamSubaccountUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*StreamSubaccountUpdate) ProtoMessage()
- func (m *StreamSubaccountUpdate) Reset()
- func (m *StreamSubaccountUpdate) Size() (n int)
- func (m *StreamSubaccountUpdate) String() string
- func (m *StreamSubaccountUpdate) Unmarshal(dAtA []byte) error
- func (m *StreamSubaccountUpdate) XXX_DiscardUnknown()
- func (m *StreamSubaccountUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *StreamSubaccountUpdate) XXX_Merge(src proto.Message)
- func (m *StreamSubaccountUpdate) XXX_Size() int
- func (m *StreamSubaccountUpdate) XXX_Unmarshal(b []byte) error
- type Subaccount
- func (m *Subaccount) DeepCopy() Subaccount
- func (*Subaccount) Descriptor() ([]byte, []int)
- func (m *Subaccount) GetAssetPositions() []*AssetPosition
- func (m *Subaccount) GetId() *SubaccountId
- func (m *Subaccount) GetMarginEnabled() bool
- func (m *Subaccount) GetPerpetualPositionForId(perpetualId uint32) (perpetualPosition *PerpetualPosition, exists bool)
- func (m *Subaccount) GetPerpetualPositions() []*PerpetualPosition
- func (m *Subaccount) GetUsdcPosition() *big.Int
- func (m *Subaccount) Marshal() (dAtA []byte, err error)
- func (m *Subaccount) MarshalTo(dAtA []byte) (int, error)
- func (m *Subaccount) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Subaccount) ProtoMessage()
- func (m *Subaccount) Reset()
- func (m *Subaccount) SetUsdcAssetPosition(newUsdcPosition *big.Int)
- func (m *Subaccount) Size() (n int)
- func (m *Subaccount) String() string
- func (m *Subaccount) Unmarshal(dAtA []byte) error
- func (m *Subaccount) XXX_DiscardUnknown()
- func (m *Subaccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Subaccount) XXX_Merge(src proto.Message)
- func (m *Subaccount) XXX_Size() int
- func (m *Subaccount) XXX_Unmarshal(b []byte) error
- type SubaccountAssetPosition
- func (*SubaccountAssetPosition) Descriptor() ([]byte, []int)
- func (m *SubaccountAssetPosition) GetAssetId() uint32
- func (m *SubaccountAssetPosition) GetQuantums() uint64
- func (m *SubaccountAssetPosition) Marshal() (dAtA []byte, err error)
- func (m *SubaccountAssetPosition) MarshalTo(dAtA []byte) (int, error)
- func (m *SubaccountAssetPosition) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*SubaccountAssetPosition) ProtoMessage()
- func (m *SubaccountAssetPosition) Reset()
- func (m *SubaccountAssetPosition) Size() (n int)
- func (m *SubaccountAssetPosition) String() string
- func (m *SubaccountAssetPosition) Unmarshal(dAtA []byte) error
- func (m *SubaccountAssetPosition) XXX_DiscardUnknown()
- func (m *SubaccountAssetPosition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SubaccountAssetPosition) XXX_Merge(src proto.Message)
- func (m *SubaccountAssetPosition) XXX_Size() int
- func (m *SubaccountAssetPosition) XXX_Unmarshal(b []byte) error
- type SubaccountId
- func (*SubaccountId) Descriptor() ([]byte, []int)
- func (m *SubaccountId) GetNumber() uint32
- func (m *SubaccountId) GetOwner() string
- func (m *SubaccountId) Marshal() (dAtA []byte, err error)
- func (m *SubaccountId) MarshalTo(dAtA []byte) (int, error)
- func (m *SubaccountId) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m *SubaccountId) MustGetAccAddress() sdk.AccAddress
- func (*SubaccountId) ProtoMessage()
- func (m *SubaccountId) Reset()
- func (m *SubaccountId) Size() (n int)
- func (m *SubaccountId) String() string
- func (id *SubaccountId) ToStateKey() []byte
- func (m *SubaccountId) Unmarshal(dAtA []byte) error
- func (m *SubaccountId) Validate() error
- func (m *SubaccountId) XXX_DiscardUnknown()
- func (m *SubaccountId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SubaccountId) XXX_Merge(src proto.Message)
- func (m *SubaccountId) XXX_Size() int
- func (m *SubaccountId) XXX_Unmarshal(b []byte) error
- type SubaccountPerpetualPosition
- func (*SubaccountPerpetualPosition) Descriptor() ([]byte, []int)
- func (m *SubaccountPerpetualPosition) GetPerpetualId() uint32
- func (m *SubaccountPerpetualPosition) GetQuantums() int64
- func (m *SubaccountPerpetualPosition) Marshal() (dAtA []byte, err error)
- func (m *SubaccountPerpetualPosition) MarshalTo(dAtA []byte) (int, error)
- func (m *SubaccountPerpetualPosition) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*SubaccountPerpetualPosition) ProtoMessage()
- func (m *SubaccountPerpetualPosition) Reset()
- func (m *SubaccountPerpetualPosition) Size() (n int)
- func (m *SubaccountPerpetualPosition) String() string
- func (m *SubaccountPerpetualPosition) Unmarshal(dAtA []byte) error
- func (m *SubaccountPerpetualPosition) XXX_DiscardUnknown()
- func (m *SubaccountPerpetualPosition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SubaccountPerpetualPosition) XXX_Merge(src proto.Message)
- func (m *SubaccountPerpetualPosition) XXX_Size() int
- func (m *SubaccountPerpetualPosition) XXX_Unmarshal(b []byte) error
- type SubaccountsKeeper
- type UnimplementedQueryServer
- func (*UnimplementedQueryServer) CollateralPoolAddress(ctx context.Context, req *QueryCollateralPoolAddressRequest) (*QueryCollateralPoolAddressResponse, error)
- func (*UnimplementedQueryServer) GetWithdrawalAndTransfersBlockedInfo(ctx context.Context, req *QueryGetWithdrawalAndTransfersBlockedInfoRequest) (*QueryGetWithdrawalAndTransfersBlockedInfoResponse, error)
- func (*UnimplementedQueryServer) Subaccount(ctx context.Context, req *QueryGetSubaccountRequest) (*QuerySubaccountResponse, error)
- func (*UnimplementedQueryServer) SubaccountAll(ctx context.Context, req *QueryAllSubaccountRequest) (*QuerySubaccountAllResponse, error)
- type Update
- type UpdateResult
- type UpdateType
Constants ¶
const ( ErrMatchUpdatesMustHaveTwoUpdates = "internalCanUpdateSubaccounts: MATCH subaccount updates must consist of " + "exactly 2 updates, got settledUpdates: %+v" ErrMatchUpdatesMustUpdateOnePerp = "internalCanUpdateSubaccounts: MATCH subaccount updates must each have " + "exactly 1 PerpetualUpdate, got settledUpdates: %+v" ErrMatchUpdatesMustBeSamePerpId = "internalCanUpdateSubaccounts: MATCH subaccount updates must consists of two " + "updates on same perpetual Id, got settledUpdates: %+v" ErrMatchUpdatesInvalidSize = "internalCanUpdateSubaccounts: MATCH subaccount updates must consists of two " + "updates of equal absolute base quantums and opposite sign: %+v" )
Panic strings
const ( EventTypeSettledFunding = "settled_funding" AttributeKeySubaccount = "subaccount" AttributeKeySubaccountNumber = "subaccount_number" AttributeKeyPerpetualId = "perpetual_id" AttributeKeyFundingPaid = "funding_paid_quote_quantums" )
Subaccounts module event types.
const ( // ModuleName defines the module name ModuleName = "subaccounts" // StoreKey defines the primary module store key StoreKey = ModuleName )
Module name and store keys
const ( // SubaccountKeyPrefix is the prefix to retrieve all Subaccounts SubaccountKeyPrefix = "SA:" // NegativeTncSubaccountForCollateralPoolSeenAtBlockKeyPrefix is the prefix for the store key that // stores the last block a negative TNC subaccount was seen in state for a specific collateral pool. NegativeTncSubaccountForCollateralPoolSeenAtBlockKeyPrefix = "NegSA:" // Suffix for the store key to the last block a negative TNC subaccount was seen in state for the // cross collateral pool. CrossCollateralSuffix = "cross" // Safety Heap SafetyHeapStorePrefix = "SH" SafetyHeapSubaccountIdsPrefix = "Heap/" SafetyHeapSubaccountToIndexPrefix = "Idx/" SafetyHeapLengthPrefix = "Len/" )
State
const (
MaxSubaccountIdNumber = 128_000 // 0 ... 128,000 are valid numbers.
)
const WITHDRAWAL_AND_TRANSFERS_BLOCKED_AFTER_CHAIN_OUTAGE_DURATION = 5 * time.Minute
const WITHDRAWAL_AND_TRANSFERS_BLOCKED_AFTER_NEGATIVE_TNC_SUBACCOUNT_SEEN_BLOCKS = 50
WITHDRAWAL_AND_TRANSFER_DELAY_AFTER_NEGATIVE_TNC_SUBACCOUNT_SEEN_BLOCKS defines the number of blocks withdrawals and transfers will be blocked if a negative TNC subaccount is seen in state, starting from the last block a negative TNC subaccount was seen.
Variables ¶
var ( ErrInvalidLengthAssetPosition = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowAssetPosition = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupAssetPosition = fmt.Errorf("proto: unexpected end of group") )
var ( Amino = codec.NewLegacyAmino() ModuleCdc = codec.NewProtoCodec(module.InterfaceRegistry) )
var ( // 0 - 99: generic. ErrIntegerOverflow = errorsmod.Register(ModuleName, 0, "integer overflow") // 100 - 199: update related. ErrNonUniqueUpdatesSubaccount = errorsmod.Register( ModuleName, 101, "multiple updates were specified for the same subaccountId") ErrFailedToUpdateSubaccounts = errorsmod.Register(ModuleName, 102, "failed to apply subaccount updates") ErrProductPositionNotUpdatable = errorsmod.Register(ModuleName, 103, "product position is not updatable") // 200 - 299: subaccount id related. ErrInvalidSubaccountIdNumber = errorsmod.Register( ModuleName, 200, "subaccount id number cannot exceed "+lib.IntToString(MaxSubaccountIdNumber), ) ErrInvalidSubaccountIdOwner = errorsmod.Register(ModuleName, 201, "subaccount id owner is an invalid address") ErrDuplicateSubaccountIds = errorsmod.Register(ModuleName, 202, "duplicate subaccount id found in genesis") // 300 - 399: asset position related. ErrAssetPositionsOutOfOrder = errorsmod.Register(ModuleName, 300, "asset positions are out of order") ErrAssetPositionZeroQuantum = errorsmod.Register(ModuleName, 301, "asset position's quantum cannot be zero") ErrAssetPositionNotSupported = errorsmod.Register(ModuleName, 302, "asset position is not supported") ErrMultAssetPositionsNotSupported = errorsmod.Register( ModuleName, 303, "having multiple asset positions is not supported") // 400 - 499: perpetual position related. ErrPerpPositionsOutOfOrder = errorsmod.Register(ModuleName, 400, "perpetual positions are out of order") ErrPerpPositionZeroQuantum = errorsmod.Register( ModuleName, 401, "perpetual position's quantum cannot be zero", ) ErrCannotModifyPerpOpenInterestForOIMF = errorsmod.Register( ModuleName, 402, "cannot modify perpetual open interest for OIMF calculation", ) ErrCannotRevertPerpOpenInterestForOIMF = errorsmod.Register( ModuleName, 403, "cannot revert perpetual open interest for OIMF calculation", ) // 500 - 599: transfer related. ErrAssetTransferQuantumsNotPositive = errorsmod.Register( ModuleName, 500, "asset transfer quantums is not positive") ErrAssetTransferThroughBankNotImplemented = errorsmod.Register( ModuleName, 501, "asset transfer (other than USDC) through the bank module is not implemented") // 600 - 699: safety heap related. ErrSafetyHeapEmpty = errorsmod.Register(ModuleName, 600, "safety heap is empty") ErrSafetyHeapSubaccountNotFoundAtIndex = errorsmod.Register( ModuleName, 601, "subaccount not found at index in safety heap", ) ErrSafetyHeapSubaccountIndexNotFound = errorsmod.Register(ModuleName, 602, "subaccount index not found") )
x/subaccounts module sentinel errors
var ( ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthPerpetualPosition = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowPerpetualPosition = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupPerpetualPosition = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthStreaming = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowStreaming = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupStreaming = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthSubaccount = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowSubaccount = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupSubaccount = fmt.Errorf("proto: unexpected end of group") )
var (
ModuleAddress = authtypes.NewModuleAddress(ModuleName)
)
Functions ¶
func GetErrorFromUpdateResults ¶
func GetErrorFromUpdateResults( success bool, successPerUpdate []UpdateResult, updates []Update, ) error
GetErrorFromUpdateResults generates a helpful error when UpdateSubaccounts or CanUpdateSubaccounts returns one or more failed updates.
func NewCreateSettledFundingEvent ¶
func NewCreateSettledFundingEvent( subaccount SubaccountId, perpetualId uint32, fundingPaid *big.Int, ) sdk.Event
NewCreateSettledFundingEvent constructs a new funding sdk.Event. Note that `fundingPaid` is positive if the subaccount paid funding, negative if the subaccount received funding. TODO(CT-245): Add tests that this event is emitted.
func RegisterCodec ¶
func RegisterCodec(cdc *codec.LegacyAmino)
func RegisterInterfaces ¶
func RegisterInterfaces(registry cdctypes.InterfaceRegistry)
func RegisterQueryHandler ¶
RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterQueryHandlerClient ¶
func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error
RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.
func RegisterQueryHandlerFromEndpoint ¶
func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterQueryHandlerServer ¶
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error
RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
func RegisterQueryServer ¶
func RegisterQueryServer(s grpc1.Server, srv QueryServer)
Types ¶
type AssetPosition ¶
type AssetPosition struct {
// The `Id` of the `Asset`.
AssetId uint32 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"`
// The absolute size of the position in base quantums.
Quantums github_com_dydxprotocol_v4_chain_protocol_dtypes.SerializableInt `` /* 135-byte string literal not displayed */
// The `Index` (either `LongIndex` or `ShortIndex`) of the `Asset` the last
// time this position was settled
// TODO(DEC-582): pending margin trading being added.
Index uint64 `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"`
}
AssetPositions define an account’s positions of an `Asset`. Therefore they hold any information needed to trade on Spot and Margin.
func (*AssetPosition) DeepCopy ¶
func (p *AssetPosition) DeepCopy() AssetPosition
DeepCopy returns a deep copy of the asset position.
func (*AssetPosition) Descriptor ¶
func (*AssetPosition) Descriptor() ([]byte, []int)
func (*AssetPosition) GetAssetId ¶
func (m *AssetPosition) GetAssetId() uint32
func (*AssetPosition) GetBigQuantums ¶
func (m *AssetPosition) GetBigQuantums() *big.Int
Get the asset position quantum size in big.Int.
func (*AssetPosition) GetId ¶
func (m *AssetPosition) GetId() uint32
func (*AssetPosition) GetIndex ¶
func (m *AssetPosition) GetIndex() uint64
func (*AssetPosition) GetIsLong ¶
func (m *AssetPosition) GetIsLong() bool
func (*AssetPosition) Marshal ¶
func (m *AssetPosition) Marshal() (dAtA []byte, err error)
func (*AssetPosition) MarshalToSizedBuffer ¶
func (m *AssetPosition) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*AssetPosition) ProtoMessage ¶
func (*AssetPosition) ProtoMessage()
func (*AssetPosition) Reset ¶
func (m *AssetPosition) Reset()
func (*AssetPosition) Size ¶
func (m *AssetPosition) Size() (n int)
func (*AssetPosition) String ¶
func (m *AssetPosition) String() string
func (*AssetPosition) Unmarshal ¶
func (m *AssetPosition) Unmarshal(dAtA []byte) error
func (*AssetPosition) XXX_DiscardUnknown ¶
func (m *AssetPosition) XXX_DiscardUnknown()
func (*AssetPosition) XXX_Marshal ¶
func (m *AssetPosition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*AssetPosition) XXX_Merge ¶
func (m *AssetPosition) XXX_Merge(src proto.Message)
func (*AssetPosition) XXX_Size ¶
func (m *AssetPosition) XXX_Size() int
func (*AssetPosition) XXX_Unmarshal ¶
func (m *AssetPosition) XXX_Unmarshal(b []byte) error
type AssetUpdate ¶
type AssetUpdate struct {
// The `Id` of the `Asset` for which the `AssetPosition` is for.
AssetId uint32
// The signed change in the Size of the `AssetPosition`.
BigQuantumsDelta *big.Int
}
func (*AssetUpdate) DeepCopy ¶
func (u *AssetUpdate) DeepCopy() AssetUpdate
func (AssetUpdate) GetBigQuantums ¶
func (au AssetUpdate) GetBigQuantums() *big.Int
func (AssetUpdate) GetId ¶
func (au AssetUpdate) GetId() uint32
func (AssetUpdate) GetIsLong ¶
func (au AssetUpdate) GetIsLong() bool
type AssetsKeeper ¶
type AssetsKeeper interface {
IsPositionUpdatable(
ctx sdk.Context,
id uint32,
) (
updatable bool,
err error,
)
ConvertAssetToCoin(
ctx sdk.Context,
assetId uint32,
quantums *big.Int,
) (
convertedQuantums *big.Int,
coin sdk.Coin,
err error,
)
GetAsset(
ctx sdk.Context,
id uint32,
) (
val assettypes.Asset,
exists bool,
)
}
type BankKeeper ¶
type BankKeeper interface {
SendCoinsFromAccountToModule(
ctx context.Context,
senderAddr sdk.AccAddress,
recipientModule string,
amt sdk.Coins,
) error
SendCoinsFromModuleToAccount(ctx context.Context,
senderModule string,
recipientAddr sdk.AccAddress,
amt sdk.Coins,
) error
SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt sdk.Coins) error
SendCoins(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error
GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin
}
BankKeeper defines the expected interface needed to retrieve account balances.
type BaseQuantums ¶
type BaseQuantums uint64
BaseQuantums is used to represent an amount in base quantums.
func (BaseQuantums) ToBigInt ¶
func (bq BaseQuantums) ToBigInt() *big.Int
Get the BaseQuantum value in *big.Int.
func (BaseQuantums) ToUint64 ¶
func (bq BaseQuantums) ToUint64() uint64
Get the BaseQuantum value in uint64.
type BlocktimeKeeper ¶
type BlocktimeKeeper interface {
GetDowntimeInfoFor(ctx sdk.Context, duration time.Duration) blocktimetypes.AllDowntimeInfo_DowntimeInfo
}
type GenesisState ¶
type GenesisState struct {
Subaccounts []Subaccount `protobuf:"bytes,1,rep,name=subaccounts,proto3" json:"subaccounts"`
}
GenesisState defines the subaccounts module's genesis state.
func DefaultGenesis ¶
func DefaultGenesis() *GenesisState
DefaultGenesis returns the default Capability genesis state
func (*GenesisState) Descriptor ¶
func (*GenesisState) Descriptor() ([]byte, []int)
func (*GenesisState) GetSubaccounts ¶
func (m *GenesisState) GetSubaccounts() []Subaccount
func (*GenesisState) Marshal ¶
func (m *GenesisState) Marshal() (dAtA []byte, err error)
func (*GenesisState) MarshalToSizedBuffer ¶
func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GenesisState) ProtoMessage ¶
func (*GenesisState) ProtoMessage()
func (*GenesisState) Reset ¶
func (m *GenesisState) Reset()
func (*GenesisState) Size ¶
func (m *GenesisState) Size() (n int)
func (*GenesisState) String ¶
func (m *GenesisState) String() string
func (*GenesisState) Unmarshal ¶
func (m *GenesisState) Unmarshal(dAtA []byte) error
func (GenesisState) Validate ¶
func (gs GenesisState) Validate() error
Validate performs basic genesis state validation returning an error upon any failure.
func (*GenesisState) XXX_DiscardUnknown ¶
func (m *GenesisState) XXX_DiscardUnknown()
func (*GenesisState) XXX_Marshal ¶
func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GenesisState) XXX_Merge ¶
func (m *GenesisState) XXX_Merge(src proto.Message)
func (*GenesisState) XXX_Size ¶
func (m *GenesisState) XXX_Size() int
func (*GenesisState) XXX_Unmarshal ¶
func (m *GenesisState) XXX_Unmarshal(b []byte) error
type IsolatedPerpetualPositionStateTransition ¶
type IsolatedPerpetualPositionStateTransition struct {
SubaccountId *SubaccountId
PerpetualId uint32
// TODO(DEC-715): Support non-USDC assets.
// Quote quantums of collateral to transfer as a result of the state transition.
QuoteQuantums *big.Int
// The state transition that occurred for the isolated perpetual positions.
Transition PositionStateTransition
}
Represents a state transition for an isolated perpetual position in a subaccount.
type PerpetualPosition ¶
type PerpetualPosition struct {
// The `Id` of the `Perpetual`.
PerpetualId uint32 `protobuf:"varint,1,opt,name=perpetual_id,json=perpetualId,proto3" json:"perpetual_id,omitempty"`
// The size of the position in base quantums.
Quantums github_com_dydxprotocol_v4_chain_protocol_dtypes.SerializableInt `` /* 135-byte string literal not displayed */
// The funding_index of the `Perpetual` the last time this position was
// settled.
FundingIndex github_com_dydxprotocol_v4_chain_protocol_dtypes.SerializableInt `` /* 163-byte string literal not displayed */
// The quote_balance of the `Perpetual`.
QuoteBalance github_com_dydxprotocol_v4_chain_protocol_dtypes.SerializableInt `` /* 163-byte string literal not displayed */
}
PerpetualPositions are an account’s positions of a `Perpetual`. Therefore they hold any information needed to trade perpetuals.
func (*PerpetualPosition) DeepCopy ¶
func (p *PerpetualPosition) DeepCopy() PerpetualPosition
DeepCopy returns a deep copy of the perpetual position.
func (*PerpetualPosition) Descriptor ¶
func (*PerpetualPosition) Descriptor() ([]byte, []int)
func (*PerpetualPosition) GetBigQuantums ¶
func (m *PerpetualPosition) GetBigQuantums() *big.Int
Get the perpetual position quantum size in big.Int.
func (*PerpetualPosition) GetId ¶
func (m *PerpetualPosition) GetId() uint32
func (*PerpetualPosition) GetIsLong ¶
func (m *PerpetualPosition) GetIsLong() bool
func (*PerpetualPosition) GetPerpetualId ¶
func (m *PerpetualPosition) GetPerpetualId() uint32
func (*PerpetualPosition) GetQuoteBalance ¶
func (m *PerpetualPosition) GetQuoteBalance() *big.Int
Get the perpetual position quote balance in big.Int.
func (*PerpetualPosition) Marshal ¶
func (m *PerpetualPosition) Marshal() (dAtA []byte, err error)
func (*PerpetualPosition) MarshalTo ¶
func (m *PerpetualPosition) MarshalTo(dAtA []byte) (int, error)
func (*PerpetualPosition) MarshalToSizedBuffer ¶
func (m *PerpetualPosition) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*PerpetualPosition) ProtoMessage ¶
func (*PerpetualPosition) ProtoMessage()
func (*PerpetualPosition) Reset ¶
func (m *PerpetualPosition) Reset()
func (*PerpetualPosition) SetQuantums ¶
func (m *PerpetualPosition) SetQuantums(sizeQuantums int64)
func (*PerpetualPosition) Size ¶
func (m *PerpetualPosition) Size() (n int)
func (*PerpetualPosition) String ¶
func (m *PerpetualPosition) String() string
func (*PerpetualPosition) Unmarshal ¶
func (m *PerpetualPosition) Unmarshal(dAtA []byte) error
func (*PerpetualPosition) XXX_DiscardUnknown ¶
func (m *PerpetualPosition) XXX_DiscardUnknown()
func (*PerpetualPosition) XXX_Marshal ¶
func (m *PerpetualPosition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PerpetualPosition) XXX_Merge ¶
func (m *PerpetualPosition) XXX_Merge(src proto.Message)
func (*PerpetualPosition) XXX_Size ¶
func (m *PerpetualPosition) XXX_Size() int
func (*PerpetualPosition) XXX_Unmarshal ¶
func (m *PerpetualPosition) XXX_Unmarshal(b []byte) error
type PerpetualUpdate ¶
type PerpetualUpdate struct {
// The `Id` of the `Perpetual` for which the `PerpetualPosition` is for.
PerpetualId uint32
// The signed change in the `Quantums` of the `PerpetualPosition`
// represented in base quantums.
BigQuantumsDelta *big.Int
// The signed change in the `QuoteBalance` of the `PerpetualPosition`.
BigQuoteBalanceDelta *big.Int
}
func (*PerpetualUpdate) DeepCopy ¶
func (u *PerpetualUpdate) DeepCopy() PerpetualUpdate
func (PerpetualUpdate) GetBigQuantums ¶
func (pu PerpetualUpdate) GetBigQuantums() *big.Int
func (PerpetualUpdate) GetBigQuoteBalance ¶
func (pu PerpetualUpdate) GetBigQuoteBalance() *big.Int
func (PerpetualUpdate) GetId ¶
func (pu PerpetualUpdate) GetId() uint32
func (PerpetualUpdate) GetIsLong ¶
func (pu PerpetualUpdate) GetIsLong() bool
type PerpetualsKeeper ¶
type PerpetualsKeeper interface {
IsPositionUpdatable(
ctx sdk.Context,
id uint32,
) (
updatable bool,
err error,
)
GetPerpetual(
ctx sdk.Context,
perpetualId uint32,
) (
perpetual perptypes.Perpetual,
err error,
)
GetPerpetualAndMarketPrice(
ctx sdk.Context,
perpetualId uint32,
) (
perptypes.Perpetual,
pricestypes.MarketPrice,
error,
)
GetPerpetualAndMarketPriceAndLiquidityTier(
ctx sdk.Context,
perpetualId uint32,
) (
perptypes.Perpetual,
pricestypes.MarketPrice,
perptypes.LiquidityTier,
error,
)
GetLiquidityTier(
ctx sdk.Context,
id uint32,
) (
perptypes.LiquidityTier,
error,
)
GetAllPerpetuals(ctx sdk.Context) []perptypes.Perpetual
GetInsuranceFundName(ctx sdk.Context, perpetualId uint32) (string, error)
GetInsuranceFundModuleAddress(ctx sdk.Context, perpetualId uint32) (sdk.AccAddress, error)
IsIsolatedPerpetual(ctx sdk.Context, perpetualId uint32) (bool, error)
ModifyOpenInterest(ctx sdk.Context, perpetualId uint32, bigQuantums *big.Int) error
}
type PositionSize ¶
type PositionSize interface {
// Returns true if and only if the position size is positive.
GetIsLong() bool
// Returns the signed position size in big.Int.
GetBigQuantums() *big.Int
GetId() uint32
}
PositionSize is an interface for expressing the size of a position
type PositionStateTransition ¶
type PositionStateTransition uint
const ( Opened PositionStateTransition = iota Closed )
func (PositionStateTransition) String ¶
func (t PositionStateTransition) String() string
type PositionUpdate ¶
func NewPositionUpdate ¶
func NewPositionUpdate(id uint32) PositionUpdate
func (PositionUpdate) GetBigQuantums ¶
func (pu PositionUpdate) GetBigQuantums() *big.Int
func (PositionUpdate) GetId ¶
func (pu PositionUpdate) GetId() uint32
func (PositionUpdate) GetIsLong ¶
func (pu PositionUpdate) GetIsLong() bool
func (PositionUpdate) SetBigQuantums ¶
func (pu PositionUpdate) SetBigQuantums(bigQuantums *big.Int)
type QueryAllSubaccountRequest ¶
type QueryAllSubaccountRequest struct {
Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
}
QueryAllSubaccountRequest is request type for the Query RPC method.
func (*QueryAllSubaccountRequest) Descriptor ¶
func (*QueryAllSubaccountRequest) Descriptor() ([]byte, []int)
func (*QueryAllSubaccountRequest) GetPagination ¶
func (m *QueryAllSubaccountRequest) GetPagination() *query.PageRequest
func (*QueryAllSubaccountRequest) Marshal ¶
func (m *QueryAllSubaccountRequest) Marshal() (dAtA []byte, err error)
func (*QueryAllSubaccountRequest) MarshalTo ¶
func (m *QueryAllSubaccountRequest) MarshalTo(dAtA []byte) (int, error)
func (*QueryAllSubaccountRequest) MarshalToSizedBuffer ¶
func (m *QueryAllSubaccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryAllSubaccountRequest) ProtoMessage ¶
func (*QueryAllSubaccountRequest) ProtoMessage()
func (*QueryAllSubaccountRequest) Reset ¶
func (m *QueryAllSubaccountRequest) Reset()
func (*QueryAllSubaccountRequest) Size ¶
func (m *QueryAllSubaccountRequest) Size() (n int)
func (*QueryAllSubaccountRequest) String ¶
func (m *QueryAllSubaccountRequest) String() string
func (*QueryAllSubaccountRequest) Unmarshal ¶
func (m *QueryAllSubaccountRequest) Unmarshal(dAtA []byte) error
func (*QueryAllSubaccountRequest) XXX_DiscardUnknown ¶
func (m *QueryAllSubaccountRequest) XXX_DiscardUnknown()
func (*QueryAllSubaccountRequest) XXX_Marshal ¶
func (m *QueryAllSubaccountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryAllSubaccountRequest) XXX_Merge ¶
func (m *QueryAllSubaccountRequest) XXX_Merge(src proto.Message)
func (*QueryAllSubaccountRequest) XXX_Size ¶
func (m *QueryAllSubaccountRequest) XXX_Size() int
func (*QueryAllSubaccountRequest) XXX_Unmarshal ¶
func (m *QueryAllSubaccountRequest) XXX_Unmarshal(b []byte) error
type QueryClient ¶
type QueryClient interface {
// Queries a Subaccount by id
Subaccount(ctx context.Context, in *QueryGetSubaccountRequest, opts ...grpc.CallOption) (*QuerySubaccountResponse, error)
// Queries a list of Subaccount items.
SubaccountAll(ctx context.Context, in *QueryAllSubaccountRequest, opts ...grpc.CallOption) (*QuerySubaccountAllResponse, error)
// Queries information about whether withdrawal and transfers are blocked, and
// if so which block they are re-enabled on.
GetWithdrawalAndTransfersBlockedInfo(ctx context.Context, in *QueryGetWithdrawalAndTransfersBlockedInfoRequest, opts ...grpc.CallOption) (*QueryGetWithdrawalAndTransfersBlockedInfoResponse, error)
// Queries the collateral pool account address for a perpetual id.
CollateralPoolAddress(ctx context.Context, in *QueryCollateralPoolAddressRequest, opts ...grpc.CallOption) (*QueryCollateralPoolAddressResponse, error)
}
QueryClient is the client API for Query service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewQueryClient ¶
func NewQueryClient(cc grpc1.ClientConn) QueryClient
type QueryCollateralPoolAddressRequest ¶
type QueryCollateralPoolAddressRequest struct {
PerpetualId uint32 `protobuf:"varint,1,opt,name=perpetual_id,json=perpetualId,proto3" json:"perpetual_id,omitempty"`
}
QueryCollateralPoolAddressRequest is the request type for fetching the account address of the collateral pool associated with the passed in perpetual id.
func (*QueryCollateralPoolAddressRequest) Descriptor ¶
func (*QueryCollateralPoolAddressRequest) Descriptor() ([]byte, []int)
func (*QueryCollateralPoolAddressRequest) GetPerpetualId ¶
func (m *QueryCollateralPoolAddressRequest) GetPerpetualId() uint32
func (*QueryCollateralPoolAddressRequest) Marshal ¶
func (m *QueryCollateralPoolAddressRequest) Marshal() (dAtA []byte, err error)
func (*QueryCollateralPoolAddressRequest) MarshalTo ¶
func (m *QueryCollateralPoolAddressRequest) MarshalTo(dAtA []byte) (int, error)
func (*QueryCollateralPoolAddressRequest) MarshalToSizedBuffer ¶
func (m *QueryCollateralPoolAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryCollateralPoolAddressRequest) ProtoMessage ¶
func (*QueryCollateralPoolAddressRequest) ProtoMessage()
func (*QueryCollateralPoolAddressRequest) Reset ¶
func (m *QueryCollateralPoolAddressRequest) Reset()
func (*QueryCollateralPoolAddressRequest) Size ¶
func (m *QueryCollateralPoolAddressRequest) Size() (n int)
func (*QueryCollateralPoolAddressRequest) String ¶
func (m *QueryCollateralPoolAddressRequest) String() string
func (*QueryCollateralPoolAddressRequest) Unmarshal ¶
func (m *QueryCollateralPoolAddressRequest) Unmarshal(dAtA []byte) error
func (*QueryCollateralPoolAddressRequest) XXX_DiscardUnknown ¶
func (m *QueryCollateralPoolAddressRequest) XXX_DiscardUnknown()
func (*QueryCollateralPoolAddressRequest) XXX_Marshal ¶
func (m *QueryCollateralPoolAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryCollateralPoolAddressRequest) XXX_Merge ¶
func (m *QueryCollateralPoolAddressRequest) XXX_Merge(src proto.Message)
func (*QueryCollateralPoolAddressRequest) XXX_Size ¶
func (m *QueryCollateralPoolAddressRequest) XXX_Size() int
func (*QueryCollateralPoolAddressRequest) XXX_Unmarshal ¶
func (m *QueryCollateralPoolAddressRequest) XXX_Unmarshal(b []byte) error
type QueryCollateralPoolAddressResponse ¶
type QueryCollateralPoolAddressResponse struct {
CollateralPoolAddress string `` /* 126-byte string literal not displayed */
}
QueryCollateralPoolAddressResponse is a response type for fetching the account address of the collateral pool associated with the passed in perpetual id.
func (*QueryCollateralPoolAddressResponse) Descriptor ¶
func (*QueryCollateralPoolAddressResponse) Descriptor() ([]byte, []int)
func (*QueryCollateralPoolAddressResponse) GetCollateralPoolAddress ¶
func (m *QueryCollateralPoolAddressResponse) GetCollateralPoolAddress() string
func (*QueryCollateralPoolAddressResponse) Marshal ¶
func (m *QueryCollateralPoolAddressResponse) Marshal() (dAtA []byte, err error)
func (*QueryCollateralPoolAddressResponse) MarshalTo ¶
func (m *QueryCollateralPoolAddressResponse) MarshalTo(dAtA []byte) (int, error)
func (*QueryCollateralPoolAddressResponse) MarshalToSizedBuffer ¶
func (m *QueryCollateralPoolAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryCollateralPoolAddressResponse) ProtoMessage ¶
func (*QueryCollateralPoolAddressResponse) ProtoMessage()
func (*QueryCollateralPoolAddressResponse) Reset ¶
func (m *QueryCollateralPoolAddressResponse) Reset()
func (*QueryCollateralPoolAddressResponse) Size ¶
func (m *QueryCollateralPoolAddressResponse) Size() (n int)
func (*QueryCollateralPoolAddressResponse) String ¶
func (m *QueryCollateralPoolAddressResponse) String() string
func (*QueryCollateralPoolAddressResponse) Unmarshal ¶
func (m *QueryCollateralPoolAddressResponse) Unmarshal(dAtA []byte) error
func (*QueryCollateralPoolAddressResponse) XXX_DiscardUnknown ¶
func (m *QueryCollateralPoolAddressResponse) XXX_DiscardUnknown()
func (*QueryCollateralPoolAddressResponse) XXX_Marshal ¶
func (m *QueryCollateralPoolAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryCollateralPoolAddressResponse) XXX_Merge ¶
func (m *QueryCollateralPoolAddressResponse) XXX_Merge(src proto.Message)
func (*QueryCollateralPoolAddressResponse) XXX_Size ¶
func (m *QueryCollateralPoolAddressResponse) XXX_Size() int
func (*QueryCollateralPoolAddressResponse) XXX_Unmarshal ¶
func (m *QueryCollateralPoolAddressResponse) XXX_Unmarshal(b []byte) error
type QueryGetSubaccountRequest ¶
type QueryGetSubaccountRequest struct {
Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`
Number uint32 `protobuf:"varint,2,opt,name=number,proto3" json:"number,omitempty"`
}
QueryGetSubaccountRequest is request type for the Query RPC method.
func (*QueryGetSubaccountRequest) Descriptor ¶
func (*QueryGetSubaccountRequest) Descriptor() ([]byte, []int)
func (*QueryGetSubaccountRequest) GetNumber ¶
func (m *QueryGetSubaccountRequest) GetNumber() uint32
func (*QueryGetSubaccountRequest) GetOwner ¶
func (m *QueryGetSubaccountRequest) GetOwner() string
func (*QueryGetSubaccountRequest) Marshal ¶
func (m *QueryGetSubaccountRequest) Marshal() (dAtA []byte, err error)
func (*QueryGetSubaccountRequest) MarshalTo ¶
func (m *QueryGetSubaccountRequest) MarshalTo(dAtA []byte) (int, error)
func (*QueryGetSubaccountRequest) MarshalToSizedBuffer ¶
func (m *QueryGetSubaccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryGetSubaccountRequest) ProtoMessage ¶
func (*QueryGetSubaccountRequest) ProtoMessage()
func (*QueryGetSubaccountRequest) Reset ¶
func (m *QueryGetSubaccountRequest) Reset()
func (*QueryGetSubaccountRequest) Size ¶
func (m *QueryGetSubaccountRequest) Size() (n int)
func (*QueryGetSubaccountRequest) String ¶
func (m *QueryGetSubaccountRequest) String() string
func (*QueryGetSubaccountRequest) Unmarshal ¶
func (m *QueryGetSubaccountRequest) Unmarshal(dAtA []byte) error
func (*QueryGetSubaccountRequest) XXX_DiscardUnknown ¶
func (m *QueryGetSubaccountRequest) XXX_DiscardUnknown()
func (*QueryGetSubaccountRequest) XXX_Marshal ¶
func (m *QueryGetSubaccountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryGetSubaccountRequest) XXX_Merge ¶
func (m *QueryGetSubaccountRequest) XXX_Merge(src proto.Message)
func (*QueryGetSubaccountRequest) XXX_Size ¶
func (m *QueryGetSubaccountRequest) XXX_Size() int
func (*QueryGetSubaccountRequest) XXX_Unmarshal ¶
func (m *QueryGetSubaccountRequest) XXX_Unmarshal(b []byte) error
type QueryGetWithdrawalAndTransfersBlockedInfoRequest ¶
type QueryGetWithdrawalAndTransfersBlockedInfoRequest struct {
PerpetualId uint32 `protobuf:"varint,1,opt,name=perpetual_id,json=perpetualId,proto3" json:"perpetual_id,omitempty"`
}
QueryGetWithdrawalAndTransfersBlockedInfoRequest is a request type for fetching information about whether withdrawals and transfers are blocked for a collateral pool associated with the passed in perpetual id.
func (*QueryGetWithdrawalAndTransfersBlockedInfoRequest) Descriptor ¶
func (*QueryGetWithdrawalAndTransfersBlockedInfoRequest) Descriptor() ([]byte, []int)
func (*QueryGetWithdrawalAndTransfersBlockedInfoRequest) GetPerpetualId ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) GetPerpetualId() uint32
func (*QueryGetWithdrawalAndTransfersBlockedInfoRequest) Marshal ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) Marshal() (dAtA []byte, err error)
func (*QueryGetWithdrawalAndTransfersBlockedInfoRequest) MarshalTo ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) MarshalTo(dAtA []byte) (int, error)
func (*QueryGetWithdrawalAndTransfersBlockedInfoRequest) MarshalToSizedBuffer ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryGetWithdrawalAndTransfersBlockedInfoRequest) ProtoMessage ¶
func (*QueryGetWithdrawalAndTransfersBlockedInfoRequest) ProtoMessage()
func (*QueryGetWithdrawalAndTransfersBlockedInfoRequest) Reset ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) Reset()
func (*QueryGetWithdrawalAndTransfersBlockedInfoRequest) Size ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) Size() (n int)
func (*QueryGetWithdrawalAndTransfersBlockedInfoRequest) String ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) String() string
func (*QueryGetWithdrawalAndTransfersBlockedInfoRequest) Unmarshal ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) Unmarshal(dAtA []byte) error
func (*QueryGetWithdrawalAndTransfersBlockedInfoRequest) XXX_DiscardUnknown ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) XXX_DiscardUnknown()
func (*QueryGetWithdrawalAndTransfersBlockedInfoRequest) XXX_Marshal ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryGetWithdrawalAndTransfersBlockedInfoRequest) XXX_Merge ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) XXX_Merge(src proto.Message)
func (*QueryGetWithdrawalAndTransfersBlockedInfoRequest) XXX_Size ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) XXX_Size() int
func (*QueryGetWithdrawalAndTransfersBlockedInfoRequest) XXX_Unmarshal ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoRequest) XXX_Unmarshal(b []byte) error
type QueryGetWithdrawalAndTransfersBlockedInfoResponse ¶
type QueryGetWithdrawalAndTransfersBlockedInfoResponse struct {
NegativeTncSubaccountSeenAtBlock uint32 `` /* 166-byte string literal not displayed */
ChainOutageSeenAtBlock uint32 `` /* 134-byte string literal not displayed */
WithdrawalsAndTransfersUnblockedAtBlock uint32 `` /* 187-byte string literal not displayed */
}
QueryGetWithdrawalAndTransfersBlockedInfoRequest is a response type for fetching information about whether withdrawals and transfers are blocked.
func (*QueryGetWithdrawalAndTransfersBlockedInfoResponse) Descriptor ¶
func (*QueryGetWithdrawalAndTransfersBlockedInfoResponse) Descriptor() ([]byte, []int)
func (*QueryGetWithdrawalAndTransfersBlockedInfoResponse) GetChainOutageSeenAtBlock ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) GetChainOutageSeenAtBlock() uint32
func (*QueryGetWithdrawalAndTransfersBlockedInfoResponse) GetNegativeTncSubaccountSeenAtBlock ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) GetNegativeTncSubaccountSeenAtBlock() uint32
func (*QueryGetWithdrawalAndTransfersBlockedInfoResponse) GetWithdrawalsAndTransfersUnblockedAtBlock ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) GetWithdrawalsAndTransfersUnblockedAtBlock() uint32
func (*QueryGetWithdrawalAndTransfersBlockedInfoResponse) Marshal ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) Marshal() (dAtA []byte, err error)
func (*QueryGetWithdrawalAndTransfersBlockedInfoResponse) MarshalTo ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) MarshalTo(dAtA []byte) (int, error)
func (*QueryGetWithdrawalAndTransfersBlockedInfoResponse) MarshalToSizedBuffer ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryGetWithdrawalAndTransfersBlockedInfoResponse) ProtoMessage ¶
func (*QueryGetWithdrawalAndTransfersBlockedInfoResponse) ProtoMessage()
func (*QueryGetWithdrawalAndTransfersBlockedInfoResponse) Reset ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) Reset()
func (*QueryGetWithdrawalAndTransfersBlockedInfoResponse) Size ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) Size() (n int)
func (*QueryGetWithdrawalAndTransfersBlockedInfoResponse) String ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) String() string
func (*QueryGetWithdrawalAndTransfersBlockedInfoResponse) Unmarshal ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) Unmarshal(dAtA []byte) error
func (*QueryGetWithdrawalAndTransfersBlockedInfoResponse) XXX_DiscardUnknown ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) XXX_DiscardUnknown()
func (*QueryGetWithdrawalAndTransfersBlockedInfoResponse) XXX_Marshal ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryGetWithdrawalAndTransfersBlockedInfoResponse) XXX_Merge ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) XXX_Merge(src proto.Message)
func (*QueryGetWithdrawalAndTransfersBlockedInfoResponse) XXX_Size ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) XXX_Size() int
func (*QueryGetWithdrawalAndTransfersBlockedInfoResponse) XXX_Unmarshal ¶
func (m *QueryGetWithdrawalAndTransfersBlockedInfoResponse) XXX_Unmarshal(b []byte) error
type QueryServer ¶
type QueryServer interface {
// Queries a Subaccount by id
Subaccount(context.Context, *QueryGetSubaccountRequest) (*QuerySubaccountResponse, error)
// Queries a list of Subaccount items.
SubaccountAll(context.Context, *QueryAllSubaccountRequest) (*QuerySubaccountAllResponse, error)
// Queries information about whether withdrawal and transfers are blocked, and
// if so which block they are re-enabled on.
GetWithdrawalAndTransfersBlockedInfo(context.Context, *QueryGetWithdrawalAndTransfersBlockedInfoRequest) (*QueryGetWithdrawalAndTransfersBlockedInfoResponse, error)
// Queries the collateral pool account address for a perpetual id.
CollateralPoolAddress(context.Context, *QueryCollateralPoolAddressRequest) (*QueryCollateralPoolAddressResponse, error)
}
QueryServer is the server API for Query service.
type QuerySubaccountAllResponse ¶
type QuerySubaccountAllResponse struct {
Subaccount []Subaccount `protobuf:"bytes,1,rep,name=subaccount,proto3" json:"subaccount"`
Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}
QuerySubaccountAllResponse is response type for the Query RPC method.
func (*QuerySubaccountAllResponse) Descriptor ¶
func (*QuerySubaccountAllResponse) Descriptor() ([]byte, []int)
func (*QuerySubaccountAllResponse) GetPagination ¶
func (m *QuerySubaccountAllResponse) GetPagination() *query.PageResponse
func (*QuerySubaccountAllResponse) GetSubaccount ¶
func (m *QuerySubaccountAllResponse) GetSubaccount() []Subaccount
func (*QuerySubaccountAllResponse) Marshal ¶
func (m *QuerySubaccountAllResponse) Marshal() (dAtA []byte, err error)
func (*QuerySubaccountAllResponse) MarshalTo ¶
func (m *QuerySubaccountAllResponse) MarshalTo(dAtA []byte) (int, error)
func (*QuerySubaccountAllResponse) MarshalToSizedBuffer ¶
func (m *QuerySubaccountAllResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QuerySubaccountAllResponse) ProtoMessage ¶
func (*QuerySubaccountAllResponse) ProtoMessage()
func (*QuerySubaccountAllResponse) Reset ¶
func (m *QuerySubaccountAllResponse) Reset()
func (*QuerySubaccountAllResponse) Size ¶
func (m *QuerySubaccountAllResponse) Size() (n int)
func (*QuerySubaccountAllResponse) String ¶
func (m *QuerySubaccountAllResponse) String() string
func (*QuerySubaccountAllResponse) Unmarshal ¶
func (m *QuerySubaccountAllResponse) Unmarshal(dAtA []byte) error
func (*QuerySubaccountAllResponse) XXX_DiscardUnknown ¶
func (m *QuerySubaccountAllResponse) XXX_DiscardUnknown()
func (*QuerySubaccountAllResponse) XXX_Marshal ¶
func (m *QuerySubaccountAllResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QuerySubaccountAllResponse) XXX_Merge ¶
func (m *QuerySubaccountAllResponse) XXX_Merge(src proto.Message)
func (*QuerySubaccountAllResponse) XXX_Size ¶
func (m *QuerySubaccountAllResponse) XXX_Size() int
func (*QuerySubaccountAllResponse) XXX_Unmarshal ¶
func (m *QuerySubaccountAllResponse) XXX_Unmarshal(b []byte) error
type QuerySubaccountResponse ¶
type QuerySubaccountResponse struct {
Subaccount Subaccount `protobuf:"bytes,1,opt,name=subaccount,proto3" json:"subaccount"`
}
QuerySubaccountResponse is response type for the Query RPC method.
func (*QuerySubaccountResponse) Descriptor ¶
func (*QuerySubaccountResponse) Descriptor() ([]byte, []int)
func (*QuerySubaccountResponse) GetSubaccount ¶
func (m *QuerySubaccountResponse) GetSubaccount() Subaccount
func (*QuerySubaccountResponse) Marshal ¶
func (m *QuerySubaccountResponse) Marshal() (dAtA []byte, err error)
func (*QuerySubaccountResponse) MarshalTo ¶
func (m *QuerySubaccountResponse) MarshalTo(dAtA []byte) (int, error)
func (*QuerySubaccountResponse) MarshalToSizedBuffer ¶
func (m *QuerySubaccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QuerySubaccountResponse) ProtoMessage ¶
func (*QuerySubaccountResponse) ProtoMessage()
func (*QuerySubaccountResponse) Reset ¶
func (m *QuerySubaccountResponse) Reset()
func (*QuerySubaccountResponse) Size ¶
func (m *QuerySubaccountResponse) Size() (n int)
func (*QuerySubaccountResponse) String ¶
func (m *QuerySubaccountResponse) String() string
func (*QuerySubaccountResponse) Unmarshal ¶
func (m *QuerySubaccountResponse) Unmarshal(dAtA []byte) error
func (*QuerySubaccountResponse) XXX_DiscardUnknown ¶
func (m *QuerySubaccountResponse) XXX_DiscardUnknown()
func (*QuerySubaccountResponse) XXX_Marshal ¶
func (m *QuerySubaccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QuerySubaccountResponse) XXX_Merge ¶
func (m *QuerySubaccountResponse) XXX_Merge(src proto.Message)
func (*QuerySubaccountResponse) XXX_Size ¶
func (m *QuerySubaccountResponse) XXX_Size() int
func (*QuerySubaccountResponse) XXX_Unmarshal ¶
func (m *QuerySubaccountResponse) XXX_Unmarshal(b []byte) error
type SafetyHeapPositionSide ¶
type SafetyHeapPositionSide uint
const ( Long SafetyHeapPositionSide = iota Short )
type SettledUpdate ¶
type SettledUpdate struct {
// The `Subaccount` for which this update applies to, in its settled form.
SettledSubaccount Subaccount
// A list of changes to make to any `AssetPositions` in the `Subaccount`.
AssetUpdates []AssetUpdate
// A list of changes to make to any `PerpetualPositions` in the `Subaccount`.
PerpetualUpdates []PerpetualUpdate
}
SettledUpdate is used internally in the subaccounts keeper to to specify changes to one or more `Subaccounts` (for example the result of a trade, transfer, etc). The subaccount is always in its settled state.
func (*SettledUpdate) GetAssetUpdates ¶
func (u *SettledUpdate) GetAssetUpdates() map[uint32]AssetUpdate
func (*SettledUpdate) GetPerpetualUpdates ¶
func (u *SettledUpdate) GetPerpetualUpdates() map[uint32]PerpetualUpdate
type SortedSubaccountIds ¶
type SortedSubaccountIds []SubaccountId
SortedSubaccountIds is type alias for `[]SubaccountId` which supports deterministic sorting. SubaccountIds are first ordered by string comparison of their `Owner`, followed by integer comparison of their `Number`. If two `SubaccountId` have equal Owners, and Numbers, they are assumed to be equal, and their sorted order is not deterministic.
func (SortedSubaccountIds) Len ¶
func (s SortedSubaccountIds) Len() int
func (SortedSubaccountIds) Less ¶
func (s SortedSubaccountIds) Less(i, j int) bool
func (SortedSubaccountIds) Swap ¶
func (s SortedSubaccountIds) Swap(i, j int)
type StreamSubaccountUpdate ¶
type StreamSubaccountUpdate struct {
SubaccountId *SubaccountId `protobuf:"bytes,1,opt,name=subaccount_id,json=subaccountId,proto3" json:"subaccount_id,omitempty"`
// updated_perpetual_positions will each be for unique perpetuals.
UpdatedPerpetualPositions []*SubaccountPerpetualPosition `` /* 138-byte string literal not displayed */
// updated_asset_positions will each be for unique assets.
UpdatedAssetPositions []*SubaccountAssetPosition `` /* 126-byte string literal not displayed */
// Snapshot indicates if the response is from a snapshot of the subaccount.
// All updates should be ignored until snapshot is received.
// If the snapshot is true, then all previous entries should be
// discarded and the subaccount should be resynced.
// For a snapshot subaccount update, the `updated_perpetual_positions` and
// `updated_asset_positions` fields will contain the full state of the
// subaccount.
Snapshot bool `protobuf:"varint,4,opt,name=snapshot,proto3" json:"snapshot,omitempty"`
}
StreamSubaccountUpdate provides information on a subaccount update. Used in the full node GRPC stream.
func (*StreamSubaccountUpdate) Descriptor ¶
func (*StreamSubaccountUpdate) Descriptor() ([]byte, []int)
func (*StreamSubaccountUpdate) GetSnapshot ¶
func (m *StreamSubaccountUpdate) GetSnapshot() bool
func (*StreamSubaccountUpdate) GetSubaccountId ¶
func (m *StreamSubaccountUpdate) GetSubaccountId() *SubaccountId
func (*StreamSubaccountUpdate) GetUpdatedAssetPositions ¶
func (m *StreamSubaccountUpdate) GetUpdatedAssetPositions() []*SubaccountAssetPosition
func (*StreamSubaccountUpdate) GetUpdatedPerpetualPositions ¶
func (m *StreamSubaccountUpdate) GetUpdatedPerpetualPositions() []*SubaccountPerpetualPosition
func (*StreamSubaccountUpdate) Marshal ¶
func (m *StreamSubaccountUpdate) Marshal() (dAtA []byte, err error)
func (*StreamSubaccountUpdate) MarshalTo ¶
func (m *StreamSubaccountUpdate) MarshalTo(dAtA []byte) (int, error)
func (*StreamSubaccountUpdate) MarshalToSizedBuffer ¶
func (m *StreamSubaccountUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*StreamSubaccountUpdate) ProtoMessage ¶
func (*StreamSubaccountUpdate) ProtoMessage()
func (*StreamSubaccountUpdate) Reset ¶
func (m *StreamSubaccountUpdate) Reset()
func (*StreamSubaccountUpdate) Size ¶
func (m *StreamSubaccountUpdate) Size() (n int)
func (*StreamSubaccountUpdate) String ¶
func (m *StreamSubaccountUpdate) String() string
func (*StreamSubaccountUpdate) Unmarshal ¶
func (m *StreamSubaccountUpdate) Unmarshal(dAtA []byte) error
func (*StreamSubaccountUpdate) XXX_DiscardUnknown ¶
func (m *StreamSubaccountUpdate) XXX_DiscardUnknown()
func (*StreamSubaccountUpdate) XXX_Marshal ¶
func (m *StreamSubaccountUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*StreamSubaccountUpdate) XXX_Merge ¶
func (m *StreamSubaccountUpdate) XXX_Merge(src proto.Message)
func (*StreamSubaccountUpdate) XXX_Size ¶
func (m *StreamSubaccountUpdate) XXX_Size() int
func (*StreamSubaccountUpdate) XXX_Unmarshal ¶
func (m *StreamSubaccountUpdate) XXX_Unmarshal(b []byte) error
type Subaccount ¶
type Subaccount struct {
// The Id of the Subaccount
Id *SubaccountId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// All `AssetPosition`s associated with this subaccount.
// Always sorted ascending by `asset_id`.
AssetPositions []*AssetPosition `protobuf:"bytes,2,rep,name=asset_positions,json=assetPositions,proto3" json:"asset_positions,omitempty"`
// All `PerpetualPosition`s associated with this subaccount.
// Always sorted ascending by `perpetual_id.
PerpetualPositions []*PerpetualPosition `protobuf:"bytes,3,rep,name=perpetual_positions,json=perpetualPositions,proto3" json:"perpetual_positions,omitempty"`
// Set by the owner. If true, then margin trades can be made in this
// subaccount.
MarginEnabled bool `protobuf:"varint,4,opt,name=margin_enabled,json=marginEnabled,proto3" json:"margin_enabled,omitempty"`
}
Subaccount defines a single sub-account for a given address. Subaccounts are uniquely indexed by a subaccountNumber/owner pair.
func (*Subaccount) DeepCopy ¶
func (m *Subaccount) DeepCopy() Subaccount
func (*Subaccount) Descriptor ¶
func (*Subaccount) Descriptor() ([]byte, []int)
func (*Subaccount) GetAssetPositions ¶
func (m *Subaccount) GetAssetPositions() []*AssetPosition
func (*Subaccount) GetId ¶
func (m *Subaccount) GetId() *SubaccountId
func (*Subaccount) GetMarginEnabled ¶
func (m *Subaccount) GetMarginEnabled() bool
func (*Subaccount) GetPerpetualPositionForId ¶
func (m *Subaccount) GetPerpetualPositionForId( perpetualId uint32, ) ( perpetualPosition *PerpetualPosition, exists bool, )
GetPerpetualPositionForId returns the perpetual position with the given perpetual id. Returns nil if subaccount does not have an open position for the perpetual.
func (*Subaccount) GetPerpetualPositions ¶
func (m *Subaccount) GetPerpetualPositions() []*PerpetualPosition
func (*Subaccount) GetUsdcPosition ¶
func (m *Subaccount) GetUsdcPosition() *big.Int
GetUsdcPosition returns the balance of the USDC asset position.
func (*Subaccount) Marshal ¶
func (m *Subaccount) Marshal() (dAtA []byte, err error)
func (*Subaccount) MarshalToSizedBuffer ¶
func (m *Subaccount) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*Subaccount) ProtoMessage ¶
func (*Subaccount) ProtoMessage()
func (*Subaccount) Reset ¶
func (m *Subaccount) Reset()
func (*Subaccount) SetUsdcAssetPosition ¶
func (m *Subaccount) SetUsdcAssetPosition(newUsdcPosition *big.Int)
SetUsdcAssetPosition sets the balance of the USDC asset position to `newUsdcPosition`.
func (*Subaccount) Size ¶
func (m *Subaccount) Size() (n int)
func (*Subaccount) String ¶
func (m *Subaccount) String() string
func (*Subaccount) Unmarshal ¶
func (m *Subaccount) Unmarshal(dAtA []byte) error
func (*Subaccount) XXX_DiscardUnknown ¶
func (m *Subaccount) XXX_DiscardUnknown()
func (*Subaccount) XXX_Marshal ¶
func (m *Subaccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Subaccount) XXX_Merge ¶
func (m *Subaccount) XXX_Merge(src proto.Message)
func (*Subaccount) XXX_Size ¶
func (m *Subaccount) XXX_Size() int
func (*Subaccount) XXX_Unmarshal ¶
func (m *Subaccount) XXX_Unmarshal(b []byte) error
type SubaccountAssetPosition ¶
type SubaccountAssetPosition struct {
// The `Id` of the `Asset`.
AssetId uint32 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"`
// The absolute size of the position in base quantums.
Quantums uint64 `protobuf:"varint,2,opt,name=quantums,proto3" json:"quantums,omitempty"`
}
SubaccountAssetPosition provides information on a subaccount's updated asset positions.
func (*SubaccountAssetPosition) Descriptor ¶
func (*SubaccountAssetPosition) Descriptor() ([]byte, []int)
func (*SubaccountAssetPosition) GetAssetId ¶
func (m *SubaccountAssetPosition) GetAssetId() uint32
func (*SubaccountAssetPosition) GetQuantums ¶
func (m *SubaccountAssetPosition) GetQuantums() uint64
func (*SubaccountAssetPosition) Marshal ¶
func (m *SubaccountAssetPosition) Marshal() (dAtA []byte, err error)
func (*SubaccountAssetPosition) MarshalTo ¶
func (m *SubaccountAssetPosition) MarshalTo(dAtA []byte) (int, error)
func (*SubaccountAssetPosition) MarshalToSizedBuffer ¶
func (m *SubaccountAssetPosition) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*SubaccountAssetPosition) ProtoMessage ¶
func (*SubaccountAssetPosition) ProtoMessage()
func (*SubaccountAssetPosition) Reset ¶
func (m *SubaccountAssetPosition) Reset()
func (*SubaccountAssetPosition) Size ¶
func (m *SubaccountAssetPosition) Size() (n int)
func (*SubaccountAssetPosition) String ¶
func (m *SubaccountAssetPosition) String() string
func (*SubaccountAssetPosition) Unmarshal ¶
func (m *SubaccountAssetPosition) Unmarshal(dAtA []byte) error
func (*SubaccountAssetPosition) XXX_DiscardUnknown ¶
func (m *SubaccountAssetPosition) XXX_DiscardUnknown()
func (*SubaccountAssetPosition) XXX_Marshal ¶
func (m *SubaccountAssetPosition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SubaccountAssetPosition) XXX_Merge ¶
func (m *SubaccountAssetPosition) XXX_Merge(src proto.Message)
func (*SubaccountAssetPosition) XXX_Size ¶
func (m *SubaccountAssetPosition) XXX_Size() int
func (*SubaccountAssetPosition) XXX_Unmarshal ¶
func (m *SubaccountAssetPosition) XXX_Unmarshal(b []byte) error
type SubaccountId ¶
type SubaccountId struct {
// The address of the wallet that owns this subaccount.
Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`
// The unique number of this subaccount for the owner.
// Currently limited to 128*1000 subaccounts per owner.
Number uint32 `protobuf:"varint,2,opt,name=number,proto3" json:"number,omitempty"`
}
SubaccountId defines a unique identifier for a Subaccount.
func (*SubaccountId) Descriptor ¶
func (*SubaccountId) Descriptor() ([]byte, []int)
func (*SubaccountId) GetNumber ¶
func (m *SubaccountId) GetNumber() uint32
func (*SubaccountId) GetOwner ¶
func (m *SubaccountId) GetOwner() string
func (*SubaccountId) Marshal ¶
func (m *SubaccountId) Marshal() (dAtA []byte, err error)
func (*SubaccountId) MarshalToSizedBuffer ¶
func (m *SubaccountId) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*SubaccountId) MustGetAccAddress ¶
func (m *SubaccountId) MustGetAccAddress() sdk.AccAddress
func (*SubaccountId) ProtoMessage ¶
func (*SubaccountId) ProtoMessage()
func (*SubaccountId) Reset ¶
func (m *SubaccountId) Reset()
func (*SubaccountId) Size ¶
func (m *SubaccountId) Size() (n int)
func (*SubaccountId) String ¶
func (m *SubaccountId) String() string
func (*SubaccountId) ToStateKey ¶
func (id *SubaccountId) ToStateKey() []byte
ToStateKey returns a bytes representation of a SubaccountId for use as a state key. The key uses the proto marshaling of the object such that it can be unmarshalled in the same way if it needs to be.
func (*SubaccountId) Unmarshal ¶
func (m *SubaccountId) Unmarshal(dAtA []byte) error
func (*SubaccountId) Validate ¶
func (m *SubaccountId) Validate() error
func (*SubaccountId) XXX_DiscardUnknown ¶
func (m *SubaccountId) XXX_DiscardUnknown()
func (*SubaccountId) XXX_Marshal ¶
func (m *SubaccountId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SubaccountId) XXX_Merge ¶
func (m *SubaccountId) XXX_Merge(src proto.Message)
func (*SubaccountId) XXX_Size ¶
func (m *SubaccountId) XXX_Size() int
func (*SubaccountId) XXX_Unmarshal ¶
func (m *SubaccountId) XXX_Unmarshal(b []byte) error
type SubaccountPerpetualPosition ¶
type SubaccountPerpetualPosition struct {
// The `Id` of the `Perpetual`.
PerpetualId uint32 `protobuf:"varint,1,opt,name=perpetual_id,json=perpetualId,proto3" json:"perpetual_id,omitempty"`
// The size of the position in base quantums. Negative means short.
Quantums int64 `protobuf:"varint,2,opt,name=quantums,proto3" json:"quantums,omitempty"`
}
SubaccountPerpetualPosition provides information on a subaccount's updated perpetual positions.
func (*SubaccountPerpetualPosition) Descriptor ¶
func (*SubaccountPerpetualPosition) Descriptor() ([]byte, []int)
func (*SubaccountPerpetualPosition) GetPerpetualId ¶
func (m *SubaccountPerpetualPosition) GetPerpetualId() uint32
func (*SubaccountPerpetualPosition) GetQuantums ¶
func (m *SubaccountPerpetualPosition) GetQuantums() int64
func (*SubaccountPerpetualPosition) Marshal ¶
func (m *SubaccountPerpetualPosition) Marshal() (dAtA []byte, err error)
func (*SubaccountPerpetualPosition) MarshalTo ¶
func (m *SubaccountPerpetualPosition) MarshalTo(dAtA []byte) (int, error)
func (*SubaccountPerpetualPosition) MarshalToSizedBuffer ¶
func (m *SubaccountPerpetualPosition) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*SubaccountPerpetualPosition) ProtoMessage ¶
func (*SubaccountPerpetualPosition) ProtoMessage()
func (*SubaccountPerpetualPosition) Reset ¶
func (m *SubaccountPerpetualPosition) Reset()
func (*SubaccountPerpetualPosition) Size ¶
func (m *SubaccountPerpetualPosition) Size() (n int)
func (*SubaccountPerpetualPosition) String ¶
func (m *SubaccountPerpetualPosition) String() string
func (*SubaccountPerpetualPosition) Unmarshal ¶
func (m *SubaccountPerpetualPosition) Unmarshal(dAtA []byte) error
func (*SubaccountPerpetualPosition) XXX_DiscardUnknown ¶
func (m *SubaccountPerpetualPosition) XXX_DiscardUnknown()
func (*SubaccountPerpetualPosition) XXX_Marshal ¶
func (m *SubaccountPerpetualPosition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SubaccountPerpetualPosition) XXX_Merge ¶
func (m *SubaccountPerpetualPosition) XXX_Merge(src proto.Message)
func (*SubaccountPerpetualPosition) XXX_Size ¶
func (m *SubaccountPerpetualPosition) XXX_Size() int
func (*SubaccountPerpetualPosition) XXX_Unmarshal ¶
func (m *SubaccountPerpetualPosition) XXX_Unmarshal(b []byte) error
type SubaccountsKeeper ¶
type SubaccountsKeeper interface {
GetAllSubaccount(ctx sdk.Context) (list []Subaccount)
GetRandomSubaccount(ctx sdk.Context, rand *rand.Rand) (Subaccount, error)
GetNetCollateralAndMarginRequirements(
ctx sdk.Context,
update Update,
) (
risk margin.Risk,
err error,
)
CanUpdateSubaccounts(
ctx sdk.Context,
updates []Update,
updateType UpdateType,
) (
success bool,
successPerUpdate []UpdateResult,
err error,
)
UpdateSubaccounts(
ctx sdk.Context,
updates []Update,
updateType UpdateType,
) (
success bool,
successPerUpdate []UpdateResult,
err error,
)
DepositFundsFromAccountToSubaccount(
ctx sdk.Context,
fromAccount sdk.AccAddress,
toSubaccountId SubaccountId,
assetId uint32,
amount *big.Int,
) (err error)
WithdrawFundsFromSubaccountToAccount(
ctx sdk.Context,
fromSubaccountId SubaccountId,
toAccount sdk.AccAddress,
assetId uint32,
amount *big.Int,
) (err error)
TransferFundsFromSubaccountToSubaccount(
ctx sdk.Context,
senderSubaccountId SubaccountId,
recipientSubaccountId SubaccountId,
assetId uint32,
quantums *big.Int,
) (err error)
SetSubaccount(ctx sdk.Context, subaccount Subaccount)
GetSubaccount(
ctx sdk.Context,
id SubaccountId,
) (val Subaccount)
GetStreamSubaccountUpdate(
ctx sdk.Context,
id SubaccountId,
snapshot bool,
) (val StreamSubaccountUpdate)
LegacyGetNegativeTncSubaccountSeenAtBlock(ctx sdk.Context) (uint32, bool)
GetNegativeTncSubaccountSeenAtBlock(
ctx sdk.Context,
perpetualId uint32,
) (uint32, bool, error)
SetNegativeTncSubaccountSeenAtBlock(
ctx sdk.Context,
perpetualId uint32,
blockHeight uint32,
) error
}
type UnimplementedQueryServer ¶
type UnimplementedQueryServer struct {
}
UnimplementedQueryServer can be embedded to have forward compatible implementations.
func (*UnimplementedQueryServer) CollateralPoolAddress ¶
func (*UnimplementedQueryServer) CollateralPoolAddress(ctx context.Context, req *QueryCollateralPoolAddressRequest) (*QueryCollateralPoolAddressResponse, error)
func (*UnimplementedQueryServer) GetWithdrawalAndTransfersBlockedInfo ¶
func (*UnimplementedQueryServer) GetWithdrawalAndTransfersBlockedInfo(ctx context.Context, req *QueryGetWithdrawalAndTransfersBlockedInfoRequest) (*QueryGetWithdrawalAndTransfersBlockedInfoResponse, error)
func (*UnimplementedQueryServer) Subaccount ¶
func (*UnimplementedQueryServer) Subaccount(ctx context.Context, req *QueryGetSubaccountRequest) (*QuerySubaccountResponse, error)
func (*UnimplementedQueryServer) SubaccountAll ¶
func (*UnimplementedQueryServer) SubaccountAll(ctx context.Context, req *QueryAllSubaccountRequest) (*QuerySubaccountAllResponse, error)
type Update ¶
type Update struct {
// The `Id` of the `Subaccount` for which this update applies.
SubaccountId SubaccountId
// A list of changes to make to any `AssetPositions` in the `Subaccount`.
AssetUpdates []AssetUpdate
// A list of changes to make to any `PerpetualPositions` in the `Subaccount`.
PerpetualUpdates []PerpetualUpdate
}
Update is used by the subaccounts keeper to allow other modules to specify changes to one or more `Subaccounts` (for example the result of a trade, transfer, etc)
type UpdateResult ¶
type UpdateResult uint
const ( Success UpdateResult = iota NewlyUndercollateralized StillUndercollateralized WithdrawalsAndTransfersBlocked UpdateCausedError ViolatesIsolatedSubaccountConstraints )
func (UpdateResult) IsIsolatedSubaccountError ¶
func (u UpdateResult) IsIsolatedSubaccountError() bool
func (UpdateResult) IsSuccess ¶
func (u UpdateResult) IsSuccess() bool
IsSuccess returns true if the `UpdateResult` value is `Success`.
func (UpdateResult) String ¶
func (u UpdateResult) String() string
type UpdateType ¶
type UpdateType uint
const ( UpdateTypeUnspecified UpdateType = iota Withdrawal Transfer Deposit Match CollatCheck )
func (UpdateType) String ¶
func (u UpdateType) String() string
Source Files
¶
- addresses.go
- asset_position.go
- asset_position.pb.go
- codec.go
- errors.go
- events.go
- expected_keepers.go
- genesis.go
- genesis.pb.go
- isolated_perpetual_position_state_transition.go
- keys.go
- perpetual_position.go
- perpetual_position.pb.go
- position_size.go
- query.pb.go
- query.pb.gw.go
- settled_update.go
- streaming.pb.go
- subaccount.go
- subaccount.pb.go
- subaccount_id.go
- types.go
- update.go