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 custom parsing logic for the Action component in the client package #12

Open
mois-ilya opened this issue Aug 19, 2024 · 0 comments
Open
Labels

Comments

@mois-ilya
Copy link
Collaborator

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.
@mois-ilya mois-ilya changed the title Add ucstom parsing logic for the Action component in the client package Add custom parsing logic for the Action component in the client package Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant