Custom parsing logic needs to be added for the Action component from the Swagger schema. The Action component should be transformed into a structure that corresponds to the following schema:
Expected Structure (Example):
Action:
type: object
required:
- type
- status
- simple_preview
- base_transactions
properties:
type:
type: string
enum:
- TonTransfer
- JettonTransfer
- JettonBurn
- JettonMint
- NftItemTransfer
- ContractDeploy
- Subscribe
- UnSubscribe
- AuctionBid
- NftPurchase
- DepositStake
- WithdrawStake
- WithdrawStakeRequest
- JettonSwap
- SmartContractExec
- ElectionsRecoverStake
- ElectionsDepositStake
- DomainRenew
- InscriptionTransfer
- InscriptionMint
- Unknown
status:
type: string
enum: ["ok", "failed"]
simple_preview:
$ref: "#/components/schemas/ActionSimplePreview"
base_transactions:
type: array
items:
type: string
action:
type: object
oneOf:
- $ref: "#/components/schemas/TonTransferAction"
- $ref: "#/components/schemas/ContractDeployAction"
- $ref: "#/components/schemas/JettonTransferAction"
- $ref: "#/components/schemas/JettonBurnAction"
- $ref: "#/components/schemas/JettonMintAction"
- $ref: "#/components/schemas/NftItemTransferAction"
- $ref: "#/components/schemas/SubscriptionAction"
- $ref: "#/components/schemas/UnSubscriptionAction"
- $ref: "#/components/schemas/AuctionBidAction"
- $ref: "#/components/schemas/NftPurchaseAction"
- $ref: "#/components/schemas/DepositStakeAction"
- $ref: "#/components/schemas/WithdrawStakeAction"
- $ref: "#/components/schemas/WithdrawStakeRequestAction"
- $ref: "#/components/schemas/ElectionsDepositStakeAction"
- $ref: "#/components/schemas/ElectionsRecoverStakeAction"
- $ref: "#/components/schemas/JettonSwapAction"
- $ref: "#/components/schemas/SmartContractAction"
- $ref: "#/components/schemas/DomainRenewAction"
- $ref: "#/components/schemas/InscriptionTransferAction"
- $ref: "#/components/schemas/InscriptionMintAction"
Requirements:
- Implement custom logic for parsing the
Action component so that it is transformed according to the specified schema.
- Support the handling of new values for
action that may be added in the future. These can be identified by the first capital letter in the field name.
Acceptance Criteria:
- Unit tests are written to verify the correctness of the custom parsing logic and the handling of new values.
Custom parsing logic needs to be added for the
Actioncomponent from the Swagger schema. TheActioncomponent should be transformed into a structure that corresponds to the following schema:Expected Structure (Example):
Requirements:
Actioncomponent so that it is transformed according to the specified schema.actionthat may be added in the future. These can be identified by the first capital letter in the field name.Acceptance Criteria: