Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Commit

Permalink
feat: Add protos to support margin level pagination with cursor (#432)
Browse files Browse the repository at this point in the history
  • Loading branch information
guoguojin committed May 19, 2022
1 parent 41cc796 commit fdaf8ba
Show file tree
Hide file tree
Showing 7 changed files with 960 additions and 257 deletions.
838 changes: 581 additions & 257 deletions data-node/api/v2/trading_data.pb.go

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions data-node/api/v2/trading_data_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions generated/json/data-node/api/v2/GetMarginLevelsRequest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/GetMarginLevelsRequest",
"definitions": {
"GetMarginLevelsRequest": {
"properties": {
"party_id": {
"type": "string"
},
"market_id": {
"type": "string"
},
"pagination": {
"$ref": "#/definitions/datanode.api.v2.Pagination",
"additionalProperties": true
}
},
"additionalProperties": true,
"type": "object",
"title": "Get Margin Levels Request"
},
"datanode.api.v2.Pagination": {
"properties": {
"first": {
"type": "integer"
},
"after": {
"type": "string"
},
"last": {
"type": "integer"
},
"before": {
"type": "string"
}
},
"additionalProperties": true,
"type": "object",
"title": "Pagination",
"description": "Cursor information for cursor based pagination requests"
}
}
}
111 changes: 111 additions & 0 deletions generated/json/data-node/api/v2/GetMarginLevelsResponse.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/GetMarginLevelsResponse",
"definitions": {
"GetMarginLevelsResponse": {
"properties": {
"margin_levels": {
"$ref": "#/definitions/datanode.api.v2.MarginConnection",
"additionalProperties": true
}
},
"additionalProperties": true,
"type": "object",
"title": "Get Margin Levels Response"
},
"datanode.api.v2.MarginConnection": {
"properties": {
"total_count": {
"type": "string"
},
"edges": {
"items": {
"$ref": "#/definitions/datanode.api.v2.MarginEdge"
},
"type": "array"
},
"page_info": {
"$ref": "#/definitions/datanode.api.v2.PageInfo",
"additionalProperties": true
}
},
"additionalProperties": true,
"type": "object",
"title": "Margin Connection"
},
"datanode.api.v2.MarginEdge": {
"properties": {
"node": {
"$ref": "#/definitions/vega.MarginLevels",
"additionalProperties": true
},
"cursor": {
"type": "string"
}
},
"additionalProperties": true,
"type": "object",
"title": "Margin Edge"
},
"datanode.api.v2.PageInfo": {
"properties": {
"has_next_page": {
"type": "boolean"
},
"has_previous_page": {
"type": "boolean"
},
"start_cursor": {
"type": "string"
},
"end_cursor": {
"type": "string"
}
},
"additionalProperties": true,
"type": "object",
"title": "Page Info",
"description": "Page information for cursor based pagination"
},
"vega.MarginLevels": {
"properties": {
"maintenance_margin": {
"type": "string",
"description": "Maintenance margin value"
},
"search_level": {
"type": "string",
"description": "Search level value"
},
"initial_margin": {
"type": "string",
"description": "Initial margin value"
},
"collateral_release_level": {
"type": "string",
"description": "Collateral release level value"
},
"party_id": {
"type": "string",
"description": "Party identifier"
},
"market_id": {
"type": "string",
"description": "Market identifier"
},
"asset": {
"type": "string",
"description": "Asset identifier"
},
"timestamp": {
"type": "string",
"description": "Timestamp for the time the ledger entry was created, in nanoseconds since the epoch - See [`VegaTimeResponse`](#api.VegaTimeResponse).`timestamp`"
}
},
"additionalProperties": true,
"type": "object",
"title": "Margin Levels",
"description": "Represents the margin levels for a party on a market at a given time"
}
}
}
100 changes: 100 additions & 0 deletions generated/json/data-node/api/v2/MarginConnection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/MarginConnection",
"definitions": {
"MarginConnection": {
"properties": {
"total_count": {
"type": "string"
},
"edges": {
"items": {
"$ref": "#/definitions/datanode.api.v2.MarginEdge"
},
"type": "array"
},
"page_info": {
"$ref": "#/definitions/datanode.api.v2.PageInfo",
"additionalProperties": true
}
},
"additionalProperties": true,
"type": "object",
"title": "Margin Connection"
},
"datanode.api.v2.MarginEdge": {
"properties": {
"node": {
"$ref": "#/definitions/vega.MarginLevels",
"additionalProperties": true
},
"cursor": {
"type": "string"
}
},
"additionalProperties": true,
"type": "object",
"title": "Margin Edge"
},
"datanode.api.v2.PageInfo": {
"properties": {
"has_next_page": {
"type": "boolean"
},
"has_previous_page": {
"type": "boolean"
},
"start_cursor": {
"type": "string"
},
"end_cursor": {
"type": "string"
}
},
"additionalProperties": true,
"type": "object",
"title": "Page Info",
"description": "Page information for cursor based pagination"
},
"vega.MarginLevels": {
"properties": {
"maintenance_margin": {
"type": "string",
"description": "Maintenance margin value"
},
"search_level": {
"type": "string",
"description": "Search level value"
},
"initial_margin": {
"type": "string",
"description": "Initial margin value"
},
"collateral_release_level": {
"type": "string",
"description": "Collateral release level value"
},
"party_id": {
"type": "string",
"description": "Party identifier"
},
"market_id": {
"type": "string",
"description": "Market identifier"
},
"asset": {
"type": "string",
"description": "Asset identifier"
},
"timestamp": {
"type": "string",
"description": "Timestamp for the time the ledger entry was created, in nanoseconds since the epoch - See [`VegaTimeResponse`](#api.VegaTimeResponse).`timestamp`"
}
},
"additionalProperties": true,
"type": "object",
"title": "Margin Levels",
"description": "Represents the margin levels for a party on a market at a given time"
}
}
}
Loading

0 comments on commit fdaf8ba

Please sign in to comment.