Skip to content
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

add staking delegations v2 endpoint #96

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 45 additions & 76 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,12 +416,6 @@ const docTemplate = `{
"name": "pagination_key",
"in": "query"
},
{
"type": "string",
"description": "Search by moniker, finality provider PK",
"name": "search",
"in": "query"
},
{
"enum": [
"active",
Expand Down Expand Up @@ -449,47 +443,6 @@ const docTemplate = `{
}
}
},
"/v2/finality-providers/{pk}": {
"get": {
"description": "Fetches a specific finality provider by their public key",
"produces": [
"application/json"
],
"tags": [
"v2"
],
"summary": "Get Finality Provider by PK",
"parameters": [
{
"type": "string",
"description": "Finality provider public key",
"name": "pk",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Finality provider details",
"schema": {
"$ref": "#/definitions/v2service.FinalityProviderPublic"
}
},
"400": {
"description": "Error: Bad Request",
"schema": {
"$ref": "#/definitions/github_com_babylonlabs-io_staking-api-service_internal_shared_types.Error"
}
},
"404": {
"description": "Error: Not Found",
"schema": {
"$ref": "#/definitions/github_com_babylonlabs-io_staking-api-service_internal_shared_types.Error"
}
}
}
}
},
"/v2/global-params": {
"get": {
"description": "Fetches global parameters for babylon chain and BTC chain",
Expand Down Expand Up @@ -523,8 +476,8 @@ const docTemplate = `{
"parameters": [
{
"type": "string",
"description": "Staking transaction hash in hex format",
"name": "staking_tx_hash_hex",
"description": "Staker public key in hex format",
"name": "staker_pk_hex",
"in": "query",
"required": true
},
Expand Down Expand Up @@ -827,6 +780,27 @@ const docTemplate = `{
}
}
},
"indexertypes.DelegationState": {
"type": "string",
"enum": [
"PENDING",
"VERIFIED",
"ACTIVE",
"UNBONDING",
"WITHDRAWABLE",
"WITHDRAWN",
"SLASHED"
],
"x-enum-varnames": [
"StatePending",
"StateVerified",
"StateActive",
"StateUnbonding",
"StateWithdrawable",
"StateWithdrawn",
"StateSlashed"
]
},
"types.ErrorCode": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -868,7 +842,7 @@ const docTemplate = `{
}
}
},
"types.FinalityProviderState": {
"types.FinalityProviderQueryingState": {
"type": "string",
"enum": [
"active",
Expand All @@ -879,17 +853,6 @@ const docTemplate = `{
"FinalityProviderStateStandby"
]
},
"types.TransactionInfo": {
"type": "object",
"properties": {
"output_index": {
"type": "integer"
},
"tx_hex": {
"type": "string"
}
}
},
"v1handlers.DelegationCheckPublicResponse": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1139,7 +1102,7 @@ const docTemplate = `{
"$ref": "#/definitions/types.FinalityProviderDescription"
},
"state": {
"$ref": "#/definitions/types.FinalityProviderState"
"$ref": "#/definitions/types.FinalityProviderQueryingState"
},
"total_delegations": {
"type": "integer"
Expand Down Expand Up @@ -1198,35 +1161,41 @@ const docTemplate = `{
"v2service.StakerDelegationPublic": {
"type": "object",
"properties": {
"finality_provider_pk_hex": {
"end_height": {
"type": "integer"
},
"finality_provider_btc_pks_hex": {
"type": "array",
"items": {
"type": "string"
}
},
"params_version": {
"type": "string"
},
"staker_pk_hex": {
"staker_btc_pk_hex": {
"type": "string"
},
"staking_start_height": {
"type": "integer"
"staking_amount": {
"type": "string"
},
"staking_tx": {
"$ref": "#/definitions/types.TransactionInfo"
"staking_time": {
"type": "string"
},
"staking_tx_hash_hex": {
"type": "string"
},
"staking_value": {
"start_height": {
"type": "integer"
},
"state": {
"type": "string"
},
"timelock": {
"type": "integer"
"$ref": "#/definitions/indexertypes.DelegationState"
},
"unbonding_start_height": {
"type": "integer"
"unbonding_time": {
"type": "string"
},
"unbonding_tx": {
"$ref": "#/definitions/types.TransactionInfo"
"type": "string"
}
}
},
Expand Down
121 changes: 45 additions & 76 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -408,12 +408,6 @@
"name": "pagination_key",
"in": "query"
},
{
"type": "string",
"description": "Search by moniker, finality provider PK",
"name": "search",
"in": "query"
},
{
"enum": [
"active",
Expand Down Expand Up @@ -441,47 +435,6 @@
}
}
},
"/v2/finality-providers/{pk}": {
"get": {
"description": "Fetches a specific finality provider by their public key",
"produces": [
"application/json"
],
"tags": [
"v2"
],
"summary": "Get Finality Provider by PK",
"parameters": [
{
"type": "string",
"description": "Finality provider public key",
"name": "pk",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Finality provider details",
"schema": {
"$ref": "#/definitions/v2service.FinalityProviderPublic"
}
},
"400": {
"description": "Error: Bad Request",
"schema": {
"$ref": "#/definitions/github_com_babylonlabs-io_staking-api-service_internal_shared_types.Error"
}
},
"404": {
"description": "Error: Not Found",
"schema": {
"$ref": "#/definitions/github_com_babylonlabs-io_staking-api-service_internal_shared_types.Error"
}
}
}
}
},
"/v2/global-params": {
"get": {
"description": "Fetches global parameters for babylon chain and BTC chain",
Expand Down Expand Up @@ -515,8 +468,8 @@
"parameters": [
{
"type": "string",
"description": "Staking transaction hash in hex format",
"name": "staking_tx_hash_hex",
"description": "Staker public key in hex format",
"name": "staker_pk_hex",
"in": "query",
"required": true
},
Expand Down Expand Up @@ -819,6 +772,27 @@
}
}
},
"indexertypes.DelegationState": {
"type": "string",
"enum": [
"PENDING",
"VERIFIED",
"ACTIVE",
"UNBONDING",
"WITHDRAWABLE",
"WITHDRAWN",
"SLASHED"
],
"x-enum-varnames": [
"StatePending",
"StateVerified",
"StateActive",
"StateUnbonding",
"StateWithdrawable",
"StateWithdrawn",
"StateSlashed"
]
},
"types.ErrorCode": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -860,7 +834,7 @@
}
}
},
"types.FinalityProviderState": {
"types.FinalityProviderQueryingState": {
"type": "string",
"enum": [
"active",
Expand All @@ -871,17 +845,6 @@
"FinalityProviderStateStandby"
]
},
"types.TransactionInfo": {
"type": "object",
"properties": {
"output_index": {
"type": "integer"
},
"tx_hex": {
"type": "string"
}
}
},
"v1handlers.DelegationCheckPublicResponse": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1131,7 +1094,7 @@
"$ref": "#/definitions/types.FinalityProviderDescription"
},
"state": {
"$ref": "#/definitions/types.FinalityProviderState"
"$ref": "#/definitions/types.FinalityProviderQueryingState"
},
"total_delegations": {
"type": "integer"
Expand Down Expand Up @@ -1190,35 +1153,41 @@
"v2service.StakerDelegationPublic": {
"type": "object",
"properties": {
"finality_provider_pk_hex": {
"end_height": {
"type": "integer"
},
"finality_provider_btc_pks_hex": {
"type": "array",
"items": {
"type": "string"
}
},
"params_version": {
"type": "string"
},
"staker_pk_hex": {
"staker_btc_pk_hex": {
"type": "string"
},
"staking_start_height": {
"type": "integer"
"staking_amount": {
"type": "string"
},
"staking_tx": {
"$ref": "#/definitions/types.TransactionInfo"
"staking_time": {
"type": "string"
},
"staking_tx_hash_hex": {
"type": "string"
},
"staking_value": {
"start_height": {
"type": "integer"
},
"state": {
"type": "string"
},
"timelock": {
"type": "integer"
"$ref": "#/definitions/indexertypes.DelegationState"
},
"unbonding_start_height": {
"type": "integer"
"unbonding_time": {
"type": "string"
},
"unbonding_tx": {
"$ref": "#/definitions/types.TransactionInfo"
"type": "string"
}
}
},
Expand Down
Loading
Loading