GithubHelp home page GithubHelp logo

tonapi-js's Introduction

TonAPI SDK

โš ๏ธ Note that the package is in public beta right now.

Learn more about the TonApi

This repository contains JavaScript SDK packages related to the TonApi

Note, that you need to set up an account to utilize TonApi.

@ton-api/client

This SDK, automatically generated, facilitates access to endpoints provided by tonapi.io

@ton-api/ton-adapter

This is adapter allows to utilize TonApi client with @ton/ton and @ton/core libraries

@ton-api/streaming

Subscribe to TON blockchain events in real time using this package

tonapi-js's People

Contributors

brainpicture avatar mdusafp avatar mois-ilya avatar siandreev avatar vlkmx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tonapi-js's Issues

Parse Unixtime fields as Date in the `client` package

Implement parsing for all fields with unixtime in the Swagger schema as Date objects in the client package. This will involve introducing either a custom field or a custom format for integers in the schema to represent unixtime fields. Additionally, a custom converter will need to be written to handle this type.

Requirements:

  • Add a custom field or agree on a custom format for integers in the Swagger schema to indicate unixtime fields.
  • Implement a custom converter in the client package that parses these fields as Date objects.

Acceptance Criteria:

  • Unit tests are written to verify the correct parsing of unixtime fields as Date objects.

Add custom parsing logic for the Action component in the `client` package

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.