Skip to content

Commit 7dafb0b

Browse files
Add api methods to request blockchain config
This PR adds two API methods: 1. "/v2/blockchain/blocks/{block_id}/config/raw" returns a config stored in a particular block 2. "/v2/blockchain/config/raw" returns the latest config
1 parent eb71a33 commit 7dafb0b

26 files changed

+1504
-89
lines changed

api/openapi.json

+66
Original file line numberDiff line numberDiff line change
@@ -2811,6 +2811,19 @@
28112811
],
28122812
"type": "object"
28132813
},
2814+
"RawBlockchainConfig": {
2815+
"properties": {
2816+
"config": {
2817+
"additionalProperties": true,
2818+
"example": {},
2819+
"type": "object"
2820+
}
2821+
},
2822+
"required": [
2823+
"config"
2824+
],
2825+
"type": "object"
2826+
},
28142827
"Refund": {
28152828
"properties": {
28162829
"origin": {
@@ -4672,6 +4685,35 @@
46724685
]
46734686
}
46744687
},
4688+
"/v2/blockchain/blocks/{block_id}/config/raw": {
4689+
"get": {
4690+
"description": "Get raw blockchain config from a specific block, if present.",
4691+
"operationId": "getRawBlockchainConfigFromBlock",
4692+
"parameters": [
4693+
{
4694+
"$ref": "#/components/parameters/blockchainBlockIDParameter"
4695+
}
4696+
],
4697+
"responses": {
4698+
"200": {
4699+
"content": {
4700+
"application/json": {
4701+
"schema": {
4702+
"$ref": "#/components/schemas/RawBlockchainConfig"
4703+
}
4704+
}
4705+
},
4706+
"description": "blockchain config"
4707+
},
4708+
"default": {
4709+
"$ref": "#/components/responses/Error"
4710+
}
4711+
},
4712+
"tags": [
4713+
"Blockchain"
4714+
]
4715+
}
4716+
},
46754717
"/v2/blockchain/blocks/{block_id}/transactions": {
46764718
"get": {
46774719
"description": "Get transactions from block",
@@ -4725,6 +4767,30 @@
47254767
]
47264768
}
47274769
},
4770+
"/v2/blockchain/config/raw": {
4771+
"get": {
4772+
"description": "Get raw blockchain config",
4773+
"operationId": "getRawBlockchainConfig",
4774+
"responses": {
4775+
"200": {
4776+
"content": {
4777+
"application/json": {
4778+
"schema": {
4779+
"$ref": "#/components/schemas/RawBlockchainConfig"
4780+
}
4781+
}
4782+
},
4783+
"description": "blockchain config"
4784+
},
4785+
"default": {
4786+
"$ref": "#/components/responses/Error"
4787+
}
4788+
},
4789+
"tags": [
4790+
"Blockchain"
4791+
]
4792+
}
4793+
},
47284794
"/v2/blockchain/masterchain-head": {
47294795
"get": {
47304796
"description": "Get last known masterchain block",

api/openapi.yml

+42
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,23 @@ paths:
4545
$ref: '#/components/schemas/Transactions'
4646
'default':
4747
$ref: '#/components/responses/Error'
48+
/v2/blockchain/blocks/{block_id}/config/raw:
49+
get:
50+
description: Get raw blockchain config from a specific block, if present.
51+
operationId: getRawBlockchainConfigFromBlock
52+
tags:
53+
- Blockchain
54+
parameters:
55+
- $ref: '#/components/parameters/blockchainBlockIDParameter'
56+
responses:
57+
'200':
58+
description: blockchain config
59+
content:
60+
application/json:
61+
schema:
62+
$ref: '#/components/schemas/RawBlockchainConfig'
63+
'default':
64+
$ref: '#/components/responses/Error'
4865
/v2/blockchain/transactions/{transaction_id}:
4966
get:
5067
description: Get transaction data
@@ -220,6 +237,21 @@ paths:
220237
$ref: '#/components/schemas/BlockchainConfig'
221238
'default':
222239
$ref: '#/components/responses/Error'
240+
/v2/blockchain/config/raw:
241+
get:
242+
description: Get raw blockchain config
243+
operationId: getRawBlockchainConfig
244+
tags:
245+
- Blockchain
246+
responses:
247+
'200':
248+
description: blockchain config
249+
content:
250+
application/json:
251+
schema:
252+
$ref: '#/components/schemas/RawBlockchainConfig'
253+
'default':
254+
$ref: '#/components/responses/Error'
223255
/v2/blockchain/accounts/{account_id}/inspect:
224256
get:
225257
description: Blockchain account inspect
@@ -3148,6 +3180,16 @@ components:
31483180
example: [ ]
31493181
items:
31503182
$ref: '#/components/schemas/TvmStackRecord'
3183+
RawBlockchainConfig:
3184+
type: object
3185+
required:
3186+
- config
3187+
properties:
3188+
config:
3189+
type: object
3190+
additionalProperties: true
3191+
example: { }
3192+
31513193
BlockchainConfig:
31523194
type: object
31533195
required:

client/oas_client_gen.go

+175
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)