From e71c30eaaeab83b8a06f8f102ee2bc9f8354acde Mon Sep 17 00:00:00 2001 From: Tian Qin Date: Tue, 13 Aug 2024 16:49:51 -0400 Subject: [PATCH] add protos --- .../src/codegen/dydxprotocol/vault/genesis.ts | 24 +- .../src/codegen/dydxprotocol/vault/params.ts | 74 +++++ .../src/codegen/dydxprotocol/vault/query.ts | 16 +- .../src/codegen/dydxprotocol/vault/vault.ts | 75 +++++ proto/dydxprotocol/vault/genesis.proto | 6 +- proto/dydxprotocol/vault/params.proto | 9 + proto/dydxprotocol/vault/query.proto | 2 +- proto/dydxprotocol/vault/vault.proto | 15 + protocol/x/vault/types/genesis.pb.go | 80 ++--- protocol/x/vault/types/params.pb.go | 277 ++++++++++++++++-- protocol/x/vault/types/query.pb.go | 132 ++++----- protocol/x/vault/types/vault.pb.go | 54 +++- 12 files changed, 600 insertions(+), 164 deletions(-) diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/genesis.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/genesis.ts index 9264ce2266a..ad090e2073e 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/genesis.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/genesis.ts @@ -1,4 +1,4 @@ -import { QuotingParams, QuotingParamsSDKType } from "./params"; +import { QuotingParams, QuotingParamsSDKType, VaultParams, VaultParamsSDKType } from "./params"; import { VaultId, VaultIdSDKType } from "./vault"; import { NumShares, NumSharesSDKType, OwnerShare, OwnerShareSDKType } from "./share"; import * as _m0 from "protobufjs/minimal"; @@ -21,7 +21,7 @@ export interface GenesisStateSDKType { default_quoting_params?: QuotingParamsSDKType; } -/** Vault defines the total shares and owner shares of a vault. */ +/** Vault defines the state of a vault. */ export interface Vault { /** The ID of the vault. */ @@ -32,14 +32,14 @@ export interface Vault { /** The shares of each owner in the vault. */ ownerShares: OwnerShare[]; - /** The quoting parameters of the vault. */ + /** The parameters of the vault. */ - quotingParams?: QuotingParams; + vaultParams?: VaultParams; /** The client IDs of the most recently placed orders of the vault. */ mostRecentClientIds: number[]; } -/** Vault defines the total shares and owner shares of a vault. */ +/** Vault defines the state of a vault. */ export interface VaultSDKType { /** The ID of the vault. */ @@ -50,9 +50,9 @@ export interface VaultSDKType { /** The shares of each owner in the vault. */ owner_shares: OwnerShareSDKType[]; - /** The quoting parameters of the vault. */ + /** The parameters of the vault. */ - quoting_params?: QuotingParamsSDKType; + vault_params?: VaultParamsSDKType; /** The client IDs of the most recently placed orders of the vault. */ most_recent_client_ids: number[]; @@ -118,7 +118,7 @@ function createBaseVault(): Vault { vaultId: undefined, totalShares: undefined, ownerShares: [], - quotingParams: undefined, + vaultParams: undefined, mostRecentClientIds: [] }; } @@ -137,8 +137,8 @@ export const Vault = { OwnerShare.encode(v!, writer.uint32(26).fork()).ldelim(); } - if (message.quotingParams !== undefined) { - QuotingParams.encode(message.quotingParams, writer.uint32(34).fork()).ldelim(); + if (message.vaultParams !== undefined) { + VaultParams.encode(message.vaultParams, writer.uint32(34).fork()).ldelim(); } writer.uint32(42).fork(); @@ -173,7 +173,7 @@ export const Vault = { break; case 4: - message.quotingParams = QuotingParams.decode(reader, reader.uint32()); + message.vaultParams = VaultParams.decode(reader, reader.uint32()); break; case 5: @@ -203,7 +203,7 @@ export const Vault = { message.vaultId = object.vaultId !== undefined && object.vaultId !== null ? VaultId.fromPartial(object.vaultId) : undefined; message.totalShares = object.totalShares !== undefined && object.totalShares !== null ? NumShares.fromPartial(object.totalShares) : undefined; message.ownerShares = object.ownerShares?.map(e => OwnerShare.fromPartial(e)) || []; - message.quotingParams = object.quotingParams !== undefined && object.quotingParams !== null ? QuotingParams.fromPartial(object.quotingParams) : undefined; + message.vaultParams = object.vaultParams !== undefined && object.vaultParams !== null ? VaultParams.fromPartial(object.vaultParams) : undefined; message.mostRecentClientIds = object.mostRecentClientIds?.map(e => e) || []; return message; } diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/params.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/params.ts index 0ad91e5a208..0dd3919cdab 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/params.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/params.ts @@ -1,3 +1,4 @@ +import { VaultStatus, VaultStatusSDKType } from "./vault"; import * as _m0 from "protobufjs/minimal"; import { DeepPartial } from "../../helpers"; /** QuotingParams stores vault quoting parameters. */ @@ -72,6 +73,24 @@ export interface QuotingParamsSDKType { activation_threshold_quote_quantums: Uint8Array; } +/** VaultParams stores vault parameters. */ + +export interface VaultParams { + /** Status of the vault. */ + status: VaultStatus; + /** Quoting parameters of the vault. */ + + quotingParams?: QuotingParams; +} +/** VaultParams stores vault parameters. */ + +export interface VaultParamsSDKType { + /** Status of the vault. */ + status: VaultStatusSDKType; + /** Quoting parameters of the vault. */ + + quoting_params?: QuotingParamsSDKType; +} /** * Deprecated: Params stores `x/vault` parameters. * Deprecated since v6.x as is replaced by QuotingParams. @@ -256,6 +275,61 @@ export const QuotingParams = { }; +function createBaseVaultParams(): VaultParams { + return { + status: 0, + quotingParams: undefined + }; +} + +export const VaultParams = { + encode(message: VaultParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.status !== 0) { + writer.uint32(8).int32(message.status); + } + + if (message.quotingParams !== undefined) { + QuotingParams.encode(message.quotingParams, writer.uint32(18).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): VaultParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVaultParams(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.status = (reader.int32() as any); + break; + + case 2: + message.quotingParams = QuotingParams.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): VaultParams { + const message = createBaseVaultParams(); + message.status = object.status ?? 0; + message.quotingParams = object.quotingParams !== undefined && object.quotingParams !== null ? QuotingParams.fromPartial(object.quotingParams) : undefined; + return message; + } + +}; + function createBaseParams(): Params { return { layers: 0, diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/query.ts index 7b58765fded..bf29a13e581 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/query.ts @@ -1,6 +1,6 @@ import { VaultType, VaultTypeSDKType, VaultId, VaultIdSDKType } from "./vault"; import { PageRequest, PageRequestSDKType, PageResponse, PageResponseSDKType } from "../../cosmos/base/query/v1beta1/pagination"; -import { Params, ParamsSDKType, QuotingParams, QuotingParamsSDKType } from "./params"; +import { Params, ParamsSDKType, QuotingParams, QuotingParamsSDKType, VaultParams, VaultParamsSDKType } from "./params"; import { SubaccountId, SubaccountIdSDKType } from "../subaccounts/subaccount"; import { NumShares, NumSharesSDKType, OwnerShare, OwnerShareSDKType } from "./share"; import * as _m0 from "protobufjs/minimal"; @@ -49,7 +49,7 @@ export interface QueryVaultResponse { equity: Uint8Array; inventory: Uint8Array; totalShares?: NumShares; - quotingParams?: QuotingParams; + vaultParams?: VaultParams; } /** QueryVaultResponse is a response type for the Vault RPC method. */ @@ -59,7 +59,7 @@ export interface QueryVaultResponseSDKType { equity: Uint8Array; inventory: Uint8Array; total_shares?: NumSharesSDKType; - quoting_params?: QuotingParamsSDKType; + vault_params?: VaultParamsSDKType; } /** QueryAllVaultsRequest is a request type for the AllVaults RPC method. */ @@ -261,7 +261,7 @@ function createBaseQueryVaultResponse(): QueryVaultResponse { equity: new Uint8Array(), inventory: new Uint8Array(), totalShares: undefined, - quotingParams: undefined + vaultParams: undefined }; } @@ -287,8 +287,8 @@ export const QueryVaultResponse = { NumShares.encode(message.totalShares, writer.uint32(42).fork()).ldelim(); } - if (message.quotingParams !== undefined) { - QuotingParams.encode(message.quotingParams, writer.uint32(50).fork()).ldelim(); + if (message.vaultParams !== undefined) { + VaultParams.encode(message.vaultParams, writer.uint32(50).fork()).ldelim(); } return writer; @@ -324,7 +324,7 @@ export const QueryVaultResponse = { break; case 6: - message.quotingParams = QuotingParams.decode(reader, reader.uint32()); + message.vaultParams = VaultParams.decode(reader, reader.uint32()); break; default: @@ -343,7 +343,7 @@ export const QueryVaultResponse = { message.equity = object.equity ?? new Uint8Array(); message.inventory = object.inventory ?? new Uint8Array(); message.totalShares = object.totalShares !== undefined && object.totalShares !== null ? NumShares.fromPartial(object.totalShares) : undefined; - message.quotingParams = object.quotingParams !== undefined && object.quotingParams !== null ? QuotingParams.fromPartial(object.quotingParams) : undefined; + message.vaultParams = object.vaultParams !== undefined && object.vaultParams !== null ? VaultParams.fromPartial(object.vaultParams) : undefined; return message; } diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/vault.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/vault.ts index 631151db13a..baf8aeab174 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/vault.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/vault.ts @@ -49,6 +49,81 @@ export function vaultTypeToJSON(object: VaultType): string { return "UNRECOGNIZED"; } } +/** VaultStatus represents the status of a vault. */ + +export enum VaultStatus { + /** DEACTIVATED - Don’t place orders. Does not count toward global vault balances. */ + DEACTIVATED = 0, + + /** STAND_BY - Don’t place orders. Does count towards global vault balances. */ + STAND_BY = 1, + + /** QUOTING - Places orders on both sides of the book. */ + QUOTING = 2, + + /** CLOSE_ONLY - Only place orders that close the position. */ + CLOSE_ONLY = 3, + UNRECOGNIZED = -1, +} +/** VaultStatus represents the status of a vault. */ + +export enum VaultStatusSDKType { + /** DEACTIVATED - Don’t place orders. Does not count toward global vault balances. */ + DEACTIVATED = 0, + + /** STAND_BY - Don’t place orders. Does count towards global vault balances. */ + STAND_BY = 1, + + /** QUOTING - Places orders on both sides of the book. */ + QUOTING = 2, + + /** CLOSE_ONLY - Only place orders that close the position. */ + CLOSE_ONLY = 3, + UNRECOGNIZED = -1, +} +export function vaultStatusFromJSON(object: any): VaultStatus { + switch (object) { + case 0: + case "DEACTIVATED": + return VaultStatus.DEACTIVATED; + + case 1: + case "STAND_BY": + return VaultStatus.STAND_BY; + + case 2: + case "QUOTING": + return VaultStatus.QUOTING; + + case 3: + case "CLOSE_ONLY": + return VaultStatus.CLOSE_ONLY; + + case -1: + case "UNRECOGNIZED": + default: + return VaultStatus.UNRECOGNIZED; + } +} +export function vaultStatusToJSON(object: VaultStatus): string { + switch (object) { + case VaultStatus.DEACTIVATED: + return "DEACTIVATED"; + + case VaultStatus.STAND_BY: + return "STAND_BY"; + + case VaultStatus.QUOTING: + return "QUOTING"; + + case VaultStatus.CLOSE_ONLY: + return "CLOSE_ONLY"; + + case VaultStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} /** VaultId uniquely identifies a vault by its type and number. */ export interface VaultId { diff --git a/proto/dydxprotocol/vault/genesis.proto b/proto/dydxprotocol/vault/genesis.proto index 750fd8b84cb..7b63c4f29c1 100644 --- a/proto/dydxprotocol/vault/genesis.proto +++ b/proto/dydxprotocol/vault/genesis.proto @@ -18,7 +18,7 @@ message GenesisState { QuotingParams default_quoting_params = 3 [ (gogoproto.nullable) = false ]; } -// Vault defines the total shares and owner shares of a vault. +// Vault defines the state of a vault. message Vault { // The ID of the vault. VaultId vault_id = 1; @@ -26,8 +26,8 @@ message Vault { NumShares total_shares = 2; // The shares of each owner in the vault. repeated OwnerShare owner_shares = 3; - // The quoting parameters of the vault. - QuotingParams quoting_params = 4; + // The parameters of the vault. + VaultParams vault_params = 4; // The client IDs of the most recently placed orders of the vault. repeated uint32 most_recent_client_ids = 5; } diff --git a/proto/dydxprotocol/vault/params.proto b/proto/dydxprotocol/vault/params.proto index 9a764868997..73f5c528800 100644 --- a/proto/dydxprotocol/vault/params.proto +++ b/proto/dydxprotocol/vault/params.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package dydxprotocol.vault; +import "dydxprotocol/vault/vault.proto"; import "gogoproto/gogo.proto"; option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/vault/types"; @@ -39,6 +40,14 @@ message QuotingParams { ]; } +// VaultParams stores vault parameters. +message VaultParams { + // Status of the vault. + VaultStatus status = 1; + // Quoting parameters of the vault. + QuotingParams quoting_params = 2; +} + // Deprecated: Params stores `x/vault` parameters. // Deprecated since v6.x as is replaced by QuotingParams. message Params { diff --git a/proto/dydxprotocol/vault/query.proto b/proto/dydxprotocol/vault/query.proto index 4006f826151..d2073ccb0f9 100644 --- a/proto/dydxprotocol/vault/query.proto +++ b/proto/dydxprotocol/vault/query.proto @@ -64,7 +64,7 @@ message QueryVaultResponse { (gogoproto.nullable) = false ]; NumShares total_shares = 5 [ (gogoproto.nullable) = false ]; - QuotingParams quoting_params = 6 [ (gogoproto.nullable) = false ]; + VaultParams vault_params = 6 [ (gogoproto.nullable) = false ]; } // QueryAllVaultsRequest is a request type for the AllVaults RPC method. diff --git a/proto/dydxprotocol/vault/vault.proto b/proto/dydxprotocol/vault/vault.proto index 527c4c49381..f38d7b4bdeb 100644 --- a/proto/dydxprotocol/vault/vault.proto +++ b/proto/dydxprotocol/vault/vault.proto @@ -20,3 +20,18 @@ message VaultId { // Unique ID of the vault within above type. uint32 number = 2; } + +// VaultStatus represents the status of a vault. +enum VaultStatus { + // Don’t place orders. Does not count toward global vault balances. + DEACTIVATED = 0; + + // Don’t place orders. Does count towards global vault balances. + STAND_BY = 1; + + // Places orders on both sides of the book. + QUOTING = 2; + + // Only place orders that close the position. + CLOSE_ONLY = 3; +} diff --git a/protocol/x/vault/types/genesis.pb.go b/protocol/x/vault/types/genesis.pb.go index c4333c6484c..fa1634b5d07 100644 --- a/protocol/x/vault/types/genesis.pb.go +++ b/protocol/x/vault/types/genesis.pb.go @@ -78,7 +78,7 @@ func (m *GenesisState) GetDefaultQuotingParams() QuotingParams { return QuotingParams{} } -// Vault defines the total shares and owner shares of a vault. +// Vault defines the state of a vault. type Vault struct { // The ID of the vault. VaultId *VaultId `protobuf:"bytes,1,opt,name=vault_id,json=vaultId,proto3" json:"vault_id,omitempty"` @@ -86,8 +86,8 @@ type Vault struct { TotalShares *NumShares `protobuf:"bytes,2,opt,name=total_shares,json=totalShares,proto3" json:"total_shares,omitempty"` // The shares of each owner in the vault. OwnerShares []*OwnerShare `protobuf:"bytes,3,rep,name=owner_shares,json=ownerShares,proto3" json:"owner_shares,omitempty"` - // The quoting parameters of the vault. - QuotingParams *QuotingParams `protobuf:"bytes,4,opt,name=quoting_params,json=quotingParams,proto3" json:"quoting_params,omitempty"` + // The parameters of the vault. + VaultParams *VaultParams `protobuf:"bytes,4,opt,name=vault_params,json=vaultParams,proto3" json:"vault_params,omitempty"` // The client IDs of the most recently placed orders of the vault. MostRecentClientIds []uint32 `protobuf:"varint,5,rep,packed,name=most_recent_client_ids,json=mostRecentClientIds,proto3" json:"most_recent_client_ids,omitempty"` } @@ -146,9 +146,9 @@ func (m *Vault) GetOwnerShares() []*OwnerShare { return nil } -func (m *Vault) GetQuotingParams() *QuotingParams { +func (m *Vault) GetVaultParams() *VaultParams { if m != nil { - return m.QuotingParams + return m.VaultParams } return nil } @@ -168,33 +168,33 @@ func init() { func init() { proto.RegisterFile("dydxprotocol/vault/genesis.proto", fileDescriptor_4be4a747b209e41c) } var fileDescriptor_4be4a747b209e41c = []byte{ - // 407 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x41, 0xaf, 0xd2, 0x40, - 0x10, 0xc7, 0x5b, 0xca, 0x7b, 0xbe, 0x6c, 0x79, 0xc6, 0xac, 0x2f, 0x2f, 0x15, 0xe3, 0x52, 0x39, - 0x71, 0xb1, 0x8d, 0x60, 0xf4, 0xaa, 0x78, 0x50, 0x3c, 0xa8, 0x2c, 0x89, 0x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a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0xc1, 0x8e, 0xd3, 0x30, + 0x14, 0x4c, 0x9a, 0xee, 0xb2, 0x72, 0x82, 0x84, 0xcc, 0x6a, 0x15, 0x8a, 0x70, 0xc3, 0x9e, 0x7a, + 0x21, 0x11, 0xbb, 0x08, 0xae, 0x50, 0x0e, 0xa8, 0x1c, 0x80, 0xba, 0x12, 0x07, 0x24, 0x14, 0xa5, + 0x89, 0x49, 0x23, 0x25, 0x71, 0x89, 0x9d, 0xd2, 0xfe, 0x05, 0x5f, 0xc1, 0x5f, 0x70, 0xef, 0xb1, + 0x47, 0x4e, 0x08, 0xb5, 0x3f, 0x82, 0xfc, 0x1c, 0x0a, 0x15, 0xe9, 0x5e, 0xec, 0xe7, 0x37, 0xf3, + 0xc6, 0xe3, 0x91, 0x91, 0x97, 0xac, 0x92, 0xe5, 0xbc, 0xe2, 0x92, 0xc7, 0x3c, 0x0f, 0x16, 0x51, + 0x9d, 0xcb, 0x20, 0x65, 0x25, 0x13, 0x99, 0xf0, 0xa1, 0x8d, 0xf1, 0xbf, 0x0c, 0x1f, 0x18, 0xbd, + 0xf3, 0x94, 0xa7, 0x1c, 0x7a, 0x81, 0xaa, 0x34, 0xb3, 0xd7, 0x6f, 0xd1, 0x9a, 0x47, 0x55, 0x54, + 0x34, 0x52, 0x3d, 0xd2, 0x42, 0x10, 0xb3, 0xa8, 0x62, 0x37, 0xe0, 0xb0, 0x6a, 0xfc, 0xf2, 0x9b, + 0x89, 0x9c, 0x57, 0xda, 0xdc, 0x44, 0x46, 0x92, 0xe1, 0xc7, 0xe8, 0x14, 0x70, 0xe1, 0x76, 0x3c, + 0x6b, 0x60, 0x5f, 0xdd, 0xf3, 0xff, 0x37, 0xeb, 0xbf, 0x57, 0x2b, 0x6d, 0x88, 0xf8, 0x23, 0xba, + 0x48, 0xd8, 0x27, 0x55, 0x87, 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x3e, 0x3c, 0x4b, 0x33, + 0x39, 0xab, 0xa7, 0x7e, 0xcc, 0x8b, 0xe0, 0xf0, 0xb7, 0x3c, 0x79, 0x14, 0xcf, 0xa2, 0xac, 0x0c, + 0xf6, 0x9d, 0x65, 0xf3, 0x83, 0xe4, 0x6a, 0xce, 0xc4, 0xf4, 0x14, 0xfa, 0xd7, 0xbf, 0x03, 0x00, + 0x00, 0xff, 0xff, 0xbb, 0x4a, 0x10, 0x2d, 0xf1, 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -282,9 +282,9 @@ func (m *Vault) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x2a } - if m.QuotingParams != nil { + if m.VaultParams != nil { { - size, err := m.QuotingParams.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.VaultParams.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -383,8 +383,8 @@ func (m *Vault) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } - if m.QuotingParams != nil { - l = m.QuotingParams.Size() + if m.VaultParams != nil { + l = m.VaultParams.Size() n += 1 + l + sovGenesis(uint64(l)) } if len(m.MostRecentClientIds) > 0 { @@ -657,7 +657,7 @@ func (m *Vault) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QuotingParams", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field VaultParams", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -684,10 +684,10 @@ func (m *Vault) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.QuotingParams == nil { - m.QuotingParams = &QuotingParams{} + if m.VaultParams == nil { + m.VaultParams = &VaultParams{} } - if err := m.QuotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.VaultParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/protocol/x/vault/types/params.pb.go b/protocol/x/vault/types/params.pb.go index 7ee3c8578ee..dbdb7865ac8 100644 --- a/protocol/x/vault/types/params.pb.go +++ b/protocol/x/vault/types/params.pb.go @@ -123,6 +123,61 @@ func (m *QuotingParams) GetOrderExpirationSeconds() uint32 { return 0 } +// VaultParams stores vault parameters. +type VaultParams struct { + // Status of the vault. + Status VaultStatus `protobuf:"varint,1,opt,name=status,proto3,enum=dydxprotocol.vault.VaultStatus" json:"status,omitempty"` + // Quoting parameters of the vault. + QuotingParams *QuotingParams `protobuf:"bytes,2,opt,name=quoting_params,json=quotingParams,proto3" json:"quoting_params,omitempty"` +} + +func (m *VaultParams) Reset() { *m = VaultParams{} } +func (m *VaultParams) String() string { return proto.CompactTextString(m) } +func (*VaultParams) ProtoMessage() {} +func (*VaultParams) Descriptor() ([]byte, []int) { + return fileDescriptor_6043e0b8bfdbca9f, []int{1} +} +func (m *VaultParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VaultParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VaultParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *VaultParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_VaultParams.Merge(m, src) +} +func (m *VaultParams) XXX_Size() int { + return m.Size() +} +func (m *VaultParams) XXX_DiscardUnknown() { + xxx_messageInfo_VaultParams.DiscardUnknown(m) +} + +var xxx_messageInfo_VaultParams proto.InternalMessageInfo + +func (m *VaultParams) GetStatus() VaultStatus { + if m != nil { + return m.Status + } + return VaultStatus_DEACTIVATED +} + +func (m *VaultParams) GetQuotingParams() *QuotingParams { + if m != nil { + return m.QuotingParams + } + return nil +} + // Deprecated: Params stores `x/vault` parameters. // Deprecated since v6.x as is replaced by QuotingParams. type Params struct { @@ -152,7 +207,7 @@ func (m *Params) Reset() { *m = Params{} } func (m *Params) String() string { return proto.CompactTextString(m) } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_6043e0b8bfdbca9f, []int{1} + return fileDescriptor_6043e0b8bfdbca9f, []int{2} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -225,39 +280,44 @@ func (m *Params) GetOrderExpirationSeconds() uint32 { func init() { proto.RegisterType((*QuotingParams)(nil), "dydxprotocol.vault.QuotingParams") + proto.RegisterType((*VaultParams)(nil), "dydxprotocol.vault.VaultParams") proto.RegisterType((*Params)(nil), "dydxprotocol.vault.Params") } func init() { proto.RegisterFile("dydxprotocol/vault/params.proto", fileDescriptor_6043e0b8bfdbca9f) } var fileDescriptor_6043e0b8bfdbca9f = []byte{ - // 407 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x93, 0xb1, 0x8e, 0xd3, 0x30, - 0x1c, 0xc6, 0x13, 0x0a, 0x41, 0xb2, 0xae, 0x9c, 0x88, 0xd0, 0x29, 0x62, 0x48, 0xab, 0x03, 0xa1, - 0x13, 0x88, 0x64, 0x00, 0x09, 0x46, 0x54, 0x09, 0x04, 0x03, 0x52, 0x7b, 0x65, 0x62, 0xb1, 0x1c, - 0xc7, 0x4d, 0x2c, 0x12, 0xdb, 0xb5, 0x9d, 0xd2, 0xf6, 0x29, 0xd8, 0x18, 0xd8, 0x78, 0x9a, 0x8e, - 0x1d, 0x11, 0x43, 0x85, 0xda, 0x17, 0x41, 0xf9, 0x3b, 0x14, 0xd8, 0x18, 0x19, 0x6e, 0x4b, 0x7e, - 0xdf, 0xcf, 0xfe, 0x22, 0x7d, 0x0a, 0x1a, 0xe4, 0xab, 0x7c, 0xa9, 0xb4, 0xb4, 0x92, 0xca, 0x2a, - 0x5d, 0x90, 0xa6, 0xb2, 0xa9, 0x22, 0x9a, 0xd4, 0x26, 0x01, 0x1a, 0x86, 0x7f, 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xe8, 0xf5, 0x66, 0x37, 0xf0, 0xbe, 0xef, 0x06, 0x2f, 0x0a, 0x6e, 0xcb, - 0x26, 0x4b, 0xa8, 0xac, 0xd3, 0xbf, 0x67, 0x79, 0xfa, 0x98, 0x96, 0x84, 0x8b, 0xf4, 0x48, 0x72, - 0xbb, 0x52, 0xcc, 0x24, 0x53, 0xa6, 0x39, 0xa9, 0xf8, 0x9a, 0x64, 0x15, 0x7b, 0x23, 0xec, 0xe5, - 0xf0, 0x77, 0xe9, 0xbb, 0x5f, 0x9d, 0xed, 0x24, 0x6c, 0xd2, 0x35, 0x9e, 0x7f, 0xe9, 0xa1, 0xe0, - 0x6a, 0x9d, 0xff, 0x74, 0x9d, 0xd1, 0x64, 0xb3, 0x8f, 0xfd, 0xed, 0x3e, 0xf6, 0x7f, 0xec, 0x63, - 0xff, 0xd3, 0x21, 0xf6, 0xb6, 0x87, 0xd8, 0xfb, 0x76, 0x88, 0xbd, 0xf7, 0xcf, 0xfe, 0xbd, 0x7d, - 0xd9, 0xfd, 0xc6, 0xf0, 0x11, 0x59, 0x00, 0xfc, 0xc9, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x64, - 0x6d, 0x5c, 0xb4, 0xe9, 0x03, 0x00, 0x00, + // 475 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x94, 0x4f, 0x6b, 0x13, 0x41, + 0x18, 0xc6, 0xb3, 0x46, 0x57, 0x98, 0x36, 0x29, 0x2e, 0x52, 0x96, 0x1e, 0x36, 0x31, 0x8a, 0x14, + 0xc5, 0x5d, 0xa8, 0x42, 0x3d, 0x4a, 0x40, 0xa9, 0x07, 0x21, 0x7f, 0xc4, 0x83, 0x97, 0x61, 0xb2, + 0x3b, 0x49, 0x06, 0x77, 0x77, 0x66, 0x67, 0xde, 0xad, 0x49, 0x3e, 0x45, 0x6f, 0x1e, 0xbc, 0xf9, + 0x69,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39, 0x5b, 0x07, + 0xce, 0xcf, 0x75, 0xe0, 0x9c, 0x6c, 0x82, 0xc6, 0xd9, 0x26, 0x68, 0x7c, 0xdf, 0x04, 0x8d, 0x8f, + 0x87, 0xff, 0xbe, 0x7d, 0x51, 0x7f, 0x44, 0xf0, 0x4f, 0x4c, 0x5c, 0xd4, 0x9f, 0xff, 0x0a, 0x00, + 0x00, 0xff, 0xff, 0x9a, 0x4f, 0xa0, 0xd4, 0x9c, 0x04, 0x00, 0x00, } func (m *QuotingParams) Marshal() (dAtA []byte, err error) { @@ -323,6 +383,46 @@ func (m *QuotingParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *VaultParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VaultParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VaultParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.QuotingParams != nil { + { + size, err := m.QuotingParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Status != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *Params) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -426,6 +526,22 @@ func (m *QuotingParams) Size() (n int) { return n } +func (m *VaultParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != 0 { + n += 1 + sovParams(uint64(m.Status)) + } + if m.QuotingParams != nil { + l = m.QuotingParams.Size() + n += 1 + l + sovParams(uint64(l)) + } + return n +} + func (m *Params) Size() (n int) { if m == nil { return 0 @@ -658,6 +774,111 @@ func (m *QuotingParams) Unmarshal(dAtA []byte) error { } return nil } +func (m *VaultParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VaultParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VaultParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= VaultStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QuotingParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.QuotingParams == nil { + m.QuotingParams = &QuotingParams{} + } + if err := m.QuotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *Params) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/protocol/x/vault/types/query.pb.go b/protocol/x/vault/types/query.pb.go index 5ac16cf096b..525eb7191ca 100644 --- a/protocol/x/vault/types/query.pb.go +++ b/protocol/x/vault/types/query.pb.go @@ -179,12 +179,12 @@ func (m *QueryVaultRequest) GetNumber() uint32 { // QueryVaultResponse is a response type for the Vault RPC method. type QueryVaultResponse struct { - VaultId VaultId `protobuf:"bytes,1,opt,name=vault_id,json=vaultId,proto3" json:"vault_id"` - SubaccountId types.SubaccountId `protobuf:"bytes,2,opt,name=subaccount_id,json=subaccountId,proto3" json:"subaccount_id"` - Equity github_com_dydxprotocol_v4_chain_protocol_dtypes.SerializableInt `protobuf:"bytes,3,opt,name=equity,proto3,customtype=github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt" json:"equity"` - Inventory github_com_dydxprotocol_v4_chain_protocol_dtypes.SerializableInt `protobuf:"bytes,4,opt,name=inventory,proto3,customtype=github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt" json:"inventory"` - TotalShares NumShares `protobuf:"bytes,5,opt,name=total_shares,json=totalShares,proto3" json:"total_shares"` - QuotingParams QuotingParams `protobuf:"bytes,6,opt,name=quoting_params,json=quotingParams,proto3" json:"quoting_params"` + VaultId VaultId `protobuf:"bytes,1,opt,name=vault_id,json=vaultId,proto3" json:"vault_id"` + SubaccountId types.SubaccountId `protobuf:"bytes,2,opt,name=subaccount_id,json=subaccountId,proto3" json:"subaccount_id"` + Equity github_com_dydxprotocol_v4_chain_protocol_dtypes.SerializableInt `protobuf:"bytes,3,opt,name=equity,proto3,customtype=github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt" json:"equity"` + Inventory github_com_dydxprotocol_v4_chain_protocol_dtypes.SerializableInt `protobuf:"bytes,4,opt,name=inventory,proto3,customtype=github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt" json:"inventory"` + TotalShares NumShares `protobuf:"bytes,5,opt,name=total_shares,json=totalShares,proto3" json:"total_shares"` + VaultParams VaultParams `protobuf:"bytes,6,opt,name=vault_params,json=vaultParams,proto3" json:"vault_params"` } func (m *QueryVaultResponse) Reset() { *m = QueryVaultResponse{} } @@ -241,11 +241,11 @@ func (m *QueryVaultResponse) GetTotalShares() NumShares { return NumShares{} } -func (m *QueryVaultResponse) GetQuotingParams() QuotingParams { +func (m *QueryVaultResponse) GetVaultParams() VaultParams { if m != nil { - return m.QuotingParams + return m.VaultParams } - return QuotingParams{} + return VaultParams{} } // QueryAllVaultsRequest is a request type for the AllVaults RPC method. @@ -474,59 +474,59 @@ func init() { func init() { proto.RegisterFile("dydxprotocol/vault/query.proto", fileDescriptor_478fb8dc0ff21ea6) } var fileDescriptor_478fb8dc0ff21ea6 = []byte{ - // 819 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4f, 0x4f, 0x13, 0x41, - 0x1c, 0xed, 0x42, 0x59, 0x65, 0x5a, 0x48, 0x1c, 0x11, 0x6b, 0xc1, 0x05, 0x36, 0x91, 0xbf, 0xba, - 0x6b, 0xab, 0x89, 0xc6, 0x18, 0x23, 0x1c, 0x50, 0x2e, 0x48, 0x17, 0xe3, 0xc1, 0x44, 0xeb, 0xb4, - 0x1d, 0x96, 0x4d, 0xb6, 0x3b, 0xed, 0xee, 0x6c, 0xa5, 0x12, 0x2e, 0x26, 0xc6, 0x78, 0x33, 0xf1, - 0x13, 0xe8, 0xc1, 0x93, 0x07, 0xbf, 0x81, 0x57, 0x8e, 0x24, 0x5e, 0x8c, 0x07, 0x62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 0xff, 0xff, 0x99, 0xba, 0x4d, 0xc2, 0x4d, - 0x09, 0x00, 0x00, + // 828 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4f, 0x6f, 0xd3, 0x48, + 0x1c, 0x8d, 0xdb, 0xd4, 0xbb, 0x9d, 0xa4, 0x2b, 0xed, 0x6c, 0xb7, 0x9b, 0x4d, 0x8b, 0xd3, 0x5a, + 0xa2, 0x7f, 0xc1, 0x26, 0x01, 0x09, 0x84, 0x10, 0xa2, 0x3d, 0x94, 0xf6, 0x02, 0x8d, 0x8b, 0x38, + 0x20, 0x41, 0x98, 0x24, 0x53, 0xd7, 0x92, 0xe3, 0x49, 0xec, 0x71, 0x68, 0xa8, 0x7a, 0x00, 0x89, + 0x03, 0x37, 0x24, 0x3e, 0x01, 0x1c, 0x38, 0x71, 0xe0, 0x1b, 0x70, 0xed, 0xb1, 0x12, 0x17, 0xc4, + 0xa1, 0x42, 0x2d, 0x1f, 0x04, 0x79, 0x66, 0x92, 0xd8, 0x49, 0x4c, 0x23, 0xd4, 0x4b, 0xe4, 0xfc, + 0xe6, 0x37, 0xef, 0x3d, 0xbf, 0x79, 0xbf, 0x31, 0x50, 0xaa, 0xad, 0xea, 0x5e, 0xdd, 0x25, 0x94, + 0x54, 0x88, 0xad, 0x37, 0x91, 0x6f, 0x53, 0xbd, 0xe1, 0x63, 0xb7, 0xa5, 0xb1, 0x22, 0x84, 0xe1, + 0x75, 0x8d, 0xad, 0x67, 0x27, 0x4d, 0x62, 0x12, 0x56, 0xd3, 0x83, 0x27, 0xde, 0x99, 0x9d, 0x31, + 0x09, 0x31, 0x6d, 0xac, 0xa3, 0xba, 0xa5, 0x23, 0xc7, 0x21, 0x14, 0x51, 0x8b, 0x38, 0x9e, 0x58, + 0x5d, 0xae, 0x10, 0xaf, 0x46, 0x3c, 0xbd, 0x8c, 0x3c, 0xcc, 0x09, 0x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0, + 0x95, 0x04, 0xc6, 0x3b, 0xb3, 0x00, 0x97, 0x62, 0x89, 0x7a, 0x27, 0x32, 0xbb, 0x3c, 0x4c, 0xab, + 0xd0, 0x35, 0xc7, 0x74, 0x4d, 0xc3, 0xff, 0x63, 0x75, 0xc1, 0xf7, 0x12, 0x48, 0x85, 0x02, 0x04, + 0x57, 0x62, 0xe1, 0xfb, 0xa7, 0x22, 0x7b, 0x69, 0xb8, 0x66, 0xa1, 0xe6, 0x06, 0x53, 0x53, 0x80, + 0x57, 0x06, 0xa9, 0x09, 0xa7, 0xb5, 0xd7, 0xac, 0xb5, 0xe2, 0xe1, 0x89, 0x22, 0x1d, 0x9d, 0x28, + 0xd2, 0xf7, 0x13, 0x45, 0x7a, 0x73, 0xaa, 0x24, 0x8e, 0x4e, 0x95, 0xc4, 0xd7, 0x53, 0x25, 0xf1, + 0xe8, 0xfa, 0xf0, 0xf7, 0xf2, 0x9e, 0x60, 0x62, 0xd7, 0x73, 0x59, 0x66, 0xf5, 0xab, 0x3f, 0x03, + 0x00, 0x00, 0xff, 0xff, 0x34, 0xf0, 0x1e, 0x20, 0x47, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -845,7 +845,7 @@ func (m *QueryVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l { - size, err := m.QuotingParams.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.VaultParams.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1149,7 +1149,7 @@ func (m *QueryVaultResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) l = m.TotalShares.Size() n += 1 + l + sovQuery(uint64(l)) - l = m.QuotingParams.Size() + l = m.VaultParams.Size() n += 1 + l + sovQuery(uint64(l)) return n } @@ -1680,7 +1680,7 @@ func (m *QueryVaultResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QuotingParams", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field VaultParams", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1707,7 +1707,7 @@ func (m *QueryVaultResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.QuotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.VaultParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/protocol/x/vault/types/vault.pb.go b/protocol/x/vault/types/vault.pb.go index 99577b61fe1..89d1b6c7b1c 100644 --- a/protocol/x/vault/types/vault.pb.go +++ b/protocol/x/vault/types/vault.pb.go @@ -50,6 +50,42 @@ func (VaultType) EnumDescriptor() ([]byte, []int) { return fileDescriptor_32accb5830bb2860, []int{0} } +// VaultStatus represents the status of a vault. +type VaultStatus int32 + +const ( + // Don’t place orders. Does not count toward global vault balances. + VaultStatus_DEACTIVATED VaultStatus = 0 + // Don’t place orders. Does count towards global vault balances. + VaultStatus_STAND_BY VaultStatus = 1 + // Places orders on both sides of the book. + VaultStatus_QUOTING VaultStatus = 2 + // Only place orders that close the position. + VaultStatus_CLOSE_ONLY VaultStatus = 3 +) + +var VaultStatus_name = map[int32]string{ + 0: "DEACTIVATED", + 1: "STAND_BY", + 2: "QUOTING", + 3: "CLOSE_ONLY", +} + +var VaultStatus_value = map[string]int32{ + "DEACTIVATED": 0, + "STAND_BY": 1, + "QUOTING": 2, + "CLOSE_ONLY": 3, +} + +func (x VaultStatus) String() string { + return proto.EnumName(VaultStatus_name, int32(x)) +} + +func (VaultStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_32accb5830bb2860, []int{1} +} + // VaultId uniquely identifies a vault by its type and number. type VaultId struct { // Type of the vault. @@ -107,13 +143,14 @@ func (m *VaultId) GetNumber() uint32 { func init() { proto.RegisterEnum("dydxprotocol.vault.VaultType", VaultType_name, VaultType_value) + proto.RegisterEnum("dydxprotocol.vault.VaultStatus", VaultStatus_name, VaultStatus_value) proto.RegisterType((*VaultId)(nil), "dydxprotocol.vault.VaultId") } func init() { proto.RegisterFile("dydxprotocol/vault/vault.proto", fileDescriptor_32accb5830bb2860) } var fileDescriptor_32accb5830bb2860 = []byte{ - // 222 bytes of a gzipped FileDescriptorProto + // 291 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xa9, 0x4c, 0xa9, 0x28, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0xce, 0xcf, 0xd1, 0x2f, 0x4b, 0x2c, 0xcd, 0x29, 0x81, 0x90, 0x7a, 0x60, 0x41, 0x21, 0x21, 0x64, 0x79, 0x3d, 0xb0, 0x8c, 0x52, 0x08, 0x17, 0x7b, 0x18, 0x88, @@ -123,11 +160,16 @@ var fileDescriptor_32accb5830bb2860 = []byte{ 0x08, 0xca, 0xd3, 0xb2, 0xe1, 0xe2, 0x84, 0x2b, 0x15, 0x92, 0xe2, 0x12, 0x0b, 0x73, 0x0c, 0xf5, 0x09, 0x89, 0x0f, 0x89, 0x0c, 0x70, 0x8d, 0x0f, 0xf5, 0x0b, 0x0e, 0x70, 0x75, 0xf6, 0x74, 0xf3, 0x74, 0x75, 0x11, 0x60, 0x10, 0x12, 0xe6, 0xe2, 0x47, 0x92, 0x73, 0xf6, 0xf1, 0x77, 0x12, 0x60, - 0x74, 0x0a, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, - 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xf3, 0xf4, 0xcc, - 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x54, 0xcf, 0x9a, 0xe8, 0x26, 0x67, 0x24, - 0x66, 0xe6, 0xe9, 0xc3, 0x45, 0x2a, 0xa0, 0x01, 0x00, 0x72, 0x67, 0x71, 0x12, 0x1b, 0x58, 0xdc, - 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x6f, 0x06, 0x99, 0xfd, 0x23, 0x01, 0x00, 0x00, + 0xd4, 0xf2, 0xe4, 0xe2, 0x06, 0xeb, 0x0e, 0x2e, 0x49, 0x2c, 0x29, 0x2d, 0x16, 0xe2, 0xe7, 0xe2, + 0x76, 0x71, 0x75, 0x74, 0x0e, 0xf1, 0x0c, 0x73, 0x0c, 0x01, 0x6b, 0xe2, 0xe1, 0xe2, 0x08, 0x0e, + 0x71, 0xf4, 0x73, 0x89, 0x77, 0x8a, 0x14, 0x60, 0x14, 0xe2, 0xe6, 0x62, 0x0f, 0x0c, 0xf5, 0x0f, + 0xf1, 0xf4, 0x73, 0x17, 0x60, 0x12, 0xe2, 0xe3, 0xe2, 0x72, 0xf6, 0xf1, 0x0f, 0x76, 0x8d, 0xf7, + 0xf7, 0xf3, 0x89, 0x14, 0x60, 0x76, 0x0a, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, + 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, + 0x86, 0x28, 0xf3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0xd4, 0x70, + 0x33, 0xd1, 0x4d, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x87, 0x8b, 0x54, 0x40, 0xc3, 0x12, 0xe4, 0xe5, + 0xe2, 0x24, 0x36, 0xb0, 0xb8, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xc7, 0xad, 0x59, 0xba, 0x6e, + 0x01, 0x00, 0x00, } func (m *VaultId) Marshal() (dAtA []byte, err error) {