-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TRA-572] Add upsert vault event. #2250
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bb9c1f9
[TRA-572] Add upsert vault event.
vincentwschau 1d70d7a
Fix formatting.
vincentwschau cdb830e
Merge branch 'main' into vincentc/tra-572-add-upsert-vault-event
vincentwschau 545ae92
Address comment.
vincentwschau d3baeb7
Add indexer code gen.
vincentwschau 1499cd8
Merge branch 'main' into vincentc/tra-572-add-upsert-vault-event
vincentwschau ff6e2bd
Merge branch 'main' into vincentc/tra-572-add-upsert-vault-event
vincentwschau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
410 changes: 206 additions & 204 deletions
410
indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/protocol/v1/vault.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/** VaultStatus represents the status of a vault. */ | ||
export enum VaultStatus { | ||
/** VAULT_STATUS_UNSPECIFIED - Default value, invalid and unused. */ | ||
VAULT_STATUS_UNSPECIFIED = 0, | ||
|
||
/** VAULT_STATUS_DEACTIVATED - Don’t place orders. Does not count toward global vault balances. */ | ||
VAULT_STATUS_DEACTIVATED = 1, | ||
|
||
/** VAULT_STATUS_STAND_BY - Don’t place orders. Does count towards global vault balances. */ | ||
VAULT_STATUS_STAND_BY = 2, | ||
|
||
/** VAULT_STATUS_QUOTING - Places orders on both sides of the book. */ | ||
VAULT_STATUS_QUOTING = 3, | ||
|
||
/** VAULT_STATUS_CLOSE_ONLY - Only place orders that close the position. */ | ||
VAULT_STATUS_CLOSE_ONLY = 4, | ||
UNRECOGNIZED = -1, | ||
} | ||
/** VaultStatus represents the status of a vault. */ | ||
|
||
export enum VaultStatusSDKType { | ||
/** VAULT_STATUS_UNSPECIFIED - Default value, invalid and unused. */ | ||
VAULT_STATUS_UNSPECIFIED = 0, | ||
|
||
/** VAULT_STATUS_DEACTIVATED - Don’t place orders. Does not count toward global vault balances. */ | ||
VAULT_STATUS_DEACTIVATED = 1, | ||
|
||
/** VAULT_STATUS_STAND_BY - Don’t place orders. Does count towards global vault balances. */ | ||
VAULT_STATUS_STAND_BY = 2, | ||
|
||
/** VAULT_STATUS_QUOTING - Places orders on both sides of the book. */ | ||
VAULT_STATUS_QUOTING = 3, | ||
|
||
/** VAULT_STATUS_CLOSE_ONLY - Only place orders that close the position. */ | ||
VAULT_STATUS_CLOSE_ONLY = 4, | ||
UNRECOGNIZED = -1, | ||
} | ||
export function vaultStatusFromJSON(object: any): VaultStatus { | ||
switch (object) { | ||
case 0: | ||
case "VAULT_STATUS_UNSPECIFIED": | ||
return VaultStatus.VAULT_STATUS_UNSPECIFIED; | ||
|
||
case 1: | ||
case "VAULT_STATUS_DEACTIVATED": | ||
return VaultStatus.VAULT_STATUS_DEACTIVATED; | ||
|
||
case 2: | ||
case "VAULT_STATUS_STAND_BY": | ||
return VaultStatus.VAULT_STATUS_STAND_BY; | ||
|
||
case 3: | ||
case "VAULT_STATUS_QUOTING": | ||
return VaultStatus.VAULT_STATUS_QUOTING; | ||
|
||
case 4: | ||
case "VAULT_STATUS_CLOSE_ONLY": | ||
return VaultStatus.VAULT_STATUS_CLOSE_ONLY; | ||
|
||
case -1: | ||
case "UNRECOGNIZED": | ||
default: | ||
return VaultStatus.UNRECOGNIZED; | ||
} | ||
} | ||
export function vaultStatusToJSON(object: VaultStatus): string { | ||
switch (object) { | ||
case VaultStatus.VAULT_STATUS_UNSPECIFIED: | ||
return "VAULT_STATUS_UNSPECIFIED"; | ||
|
||
case VaultStatus.VAULT_STATUS_DEACTIVATED: | ||
return "VAULT_STATUS_DEACTIVATED"; | ||
|
||
case VaultStatus.VAULT_STATUS_STAND_BY: | ||
return "VAULT_STATUS_STAND_BY"; | ||
|
||
case VaultStatus.VAULT_STATUS_QUOTING: | ||
return "VAULT_STATUS_QUOTING"; | ||
|
||
case VaultStatus.VAULT_STATUS_CLOSE_ONLY: | ||
return "VAULT_STATUS_CLOSE_ONLY"; | ||
|
||
case VaultStatus.UNRECOGNIZED: | ||
default: | ||
return "UNRECOGNIZED"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import * as _126 from "./gogo"; | ||
export const gogoproto = { ..._126 | ||
import * as _127 from "./gogo"; | ||
export const gogoproto = { ..._127 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import * as _127 from "./api/annotations"; | ||
import * as _128 from "./api/http"; | ||
import * as _129 from "./protobuf/descriptor"; | ||
import * as _130 from "./protobuf/duration"; | ||
import * as _131 from "./protobuf/timestamp"; | ||
import * as _132 from "./protobuf/any"; | ||
import * as _128 from "./api/annotations"; | ||
import * as _129 from "./api/http"; | ||
import * as _130 from "./protobuf/descriptor"; | ||
import * as _131 from "./protobuf/duration"; | ||
import * as _132 from "./protobuf/timestamp"; | ||
import * as _133 from "./protobuf/any"; | ||
export namespace google { | ||
export const api = { ..._127, | ||
..._128 | ||
export const api = { ..._128, | ||
..._129 | ||
}; | ||
export const protobuf = { ..._129, | ||
..._130, | ||
export const protobuf = { ..._130, | ||
..._131, | ||
..._132 | ||
..._132, | ||
..._133 | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
syntax = "proto3"; | ||
package dydxprotocol.indexer.protocol.v1; | ||
|
||
option go_package = "github.com/dydxprotocol/v4-chain/protocol/indexer/protocol/v1/types"; | ||
|
||
// Initial copy of protos from dYdX chain application state protos for the | ||
// vault module for use to send Indexer specific messages. Do not make any | ||
// breaking changes to these protos, a new version should be created if a | ||
// breaking change is needed. | ||
|
||
// VaultStatus represents the status of a vault. | ||
enum VaultStatus { | ||
// Default value, invalid and unused. | ||
VAULT_STATUS_UNSPECIFIED = 0; | ||
|
||
// Don’t place orders. Does not count toward global vault balances. | ||
VAULT_STATUS_DEACTIVATED = 1; | ||
|
||
// Don’t place orders. Does count towards global vault balances. | ||
VAULT_STATUS_STAND_BY = 2; | ||
|
||
// Places orders on both sides of the book. | ||
VAULT_STATUS_QUOTING = 3; | ||
|
||
// Only place orders that close the position. | ||
VAULT_STATUS_CLOSE_ONLY = 4; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the package directory to match the package name.
The static analysis tool buf has flagged an issue with the package directory not matching the package name. To fix this, move the file to the directory
dydxprotocol/indexer/protocol/v1
relative to the root of the repository.Apply this fix to resolve the buf issue:
dydxprotocol/indexer/protocol/v1
relative to the root of the repository if it doesn't exist.proto/dydxprotocol/indexer/protocol/v1/vault.proto
to the new directorydydxprotocol/indexer/protocol/v1/vault.proto
.Tools
buf