From b094265f9d46eb25f274ca4648ce22a9a59b7a63 Mon Sep 17 00:00:00 2001 From: laviniat1996 Date: Mon, 13 Oct 2025 06:18:29 +0300 Subject: [PATCH 1/2] add decoder endpoint and decoded fields across schemas --- ecosystem/rpc/ton-center-http-api-v-3.yaml | 120 ++++++++++++++++++++- 1 file changed, 118 insertions(+), 2 deletions(-) diff --git a/ecosystem/rpc/ton-center-http-api-v-3.yaml b/ecosystem/rpc/ton-center-http-api-v-3.yaml index 773fe268..c63e6c91 100644 --- a/ecosystem/rpc/ton-center-http-api-v-3.yaml +++ b/ecosystem/rpc/ton-center-http-api-v-3.yaml @@ -447,6 +447,72 @@ paths: application/json: schema: $ref: '#/components/schemas/RequestError' + /api/v3/decode: + get: + tags: + - Utils + summary: Decode opcodes and bodies + description: Decode opcodes (hex or decimal) and message bodies (base64 or hex). + parameters: + - in: query + name: opcodes + description: List of opcodes to decode (hex or decimal). + required: false + schema: + type: array + items: + type: string + style: form + explode: true + - in: query + name: bodies + description: List of message bodies to decode (base64 or hex). + required: false + schema: + type: array + items: + type: string + style: form + explode: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DecodeResponse' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/RequestError' + post: + tags: + - Utils + summary: Decode opcodes and bodies + description: > + Decode opcodes (hex or decimal) and message bodies (base64 or hex). + Use POST for long parameter lists that could be truncated in GET. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DecodeRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DecodeResponse' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/RequestError' /api/v3/estimateFee: post: description: Estimate fees required for query processing. Fields body, init-code @@ -2288,11 +2354,53 @@ components: $ref: '#/components/schemas/DNSRecord' DecodedContent: type: object + nullable: true + additionalProperties: true properties: - comment: - type: string type: type: string + comment: + type: string + data: + type: object + additionalProperties: true + DecodeRequest: + type: object + properties: + opcodes: + type: array + items: + type: string + description: Opcodes in hex (with or without 0x) or decimal format. + bodies: + type: array + items: + type: string + description: Message bodies in base64 or hex format. + DecodeResponse: + type: object + properties: + opcodes: + type: array + items: + type: string + description: Decoded opcode names or identifiers. + bodies: + type: array + items: + type: object + additionalProperties: true + description: Decoded message bodies as structured objects (scheme-dependent). + example: + opcodes: + - "jetton_transfer" + bodies: + - type: "jetton_transfer" + data: + amount: "1000000000" + destination: "0:abcd..." + response_destination: null + custom_payload: null JettonBurn: type: object properties: @@ -2321,6 +2429,8 @@ components: example: '0' transaction_now: type: integer + decoded_custom_payload: + $ref: '#/components/schemas/DecodedContent' JettonBurnsResponse: type: object properties: @@ -2400,6 +2510,10 @@ components: example: '0' transaction_now: type: integer + decoded_custom_payload: + $ref: '#/components/schemas/DecodedContent' + decoded_forward_payload: + $ref: '#/components/schemas/DecodedContent' JettonTransfersResponse: type: object properties: @@ -2650,6 +2764,8 @@ components: example: '0' transaction_now: type: integer + decoded_forward_payload: + $ref: '#/components/schemas/DecodedContent' NFTTransfersResponse: type: object properties: From f9c8a29580827ba6069a6ea9d59ef8f3b56c3451 Mon Sep 17 00:00:00 2001 From: Novus Nota <68142933+novusnota@users.noreply.github.com> Date: Mon, 20 Oct 2025 13:03:08 +0200 Subject: [PATCH 2/2] fmt --- ecosystem/rpc/toncenter/v3.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ecosystem/rpc/toncenter/v3.yaml b/ecosystem/rpc/toncenter/v3.yaml index c63e6c91..013aae19 100644 --- a/ecosystem/rpc/toncenter/v3.yaml +++ b/ecosystem/rpc/toncenter/v3.yaml @@ -449,7 +449,7 @@ paths: $ref: '#/components/schemas/RequestError' /api/v3/decode: get: - tags: + tags: - Utils summary: Decode opcodes and bodies description: Decode opcodes (hex or decimal) and message bodies (base64 or hex). @@ -488,7 +488,7 @@ paths: schema: $ref: '#/components/schemas/RequestError' post: - tags: + tags: - Utils summary: Decode opcodes and bodies description: >