diff --git a/ecosystem/rpc/toncenter/v3.yaml b/ecosystem/rpc/toncenter/v3.yaml index 773fe268..013aae19 100644 --- a/ecosystem/rpc/toncenter/v3.yaml +++ b/ecosystem/rpc/toncenter/v3.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: