GraphQL API

  • Query String
  • Query Variables
  • HTTP Headers

HTTP Request and Response

Request

  • URL
    • For development: https://test.fstk.io/api
    • For production: https://engine.fstk.io/api
  • Method: POST
  • Headers
    • accept: application/json
    • content-type: application/json
    • authorization: Bearer [JWT Web-to-Server access token]
      • (for example)
  • Body

    The value of query in the body is a String.

Response

This API responses a ABI-Encoded transaction for creating the basic token campaign, and the end-user (the sender, the requester) has to sign the transaction object in the response via ETH Key lib JS, then send the signed transaction and the submitToken to SubmitSignedTransaction API.

Parameters

Request

  • id <ID!>
    • ID of the Smart Voucher to sell. ID is a global identifier.
  • name <String!>
    • Campaigm name.
  • description <String!>
    • Campaign description.
  • stages (Currently only support one stage in stages.) <[CampaignStageInput]!>
    • name <String!>
      • The campaign stage name.
    • startTime <String!>
      • The campaign stage start time. The format is Unix Timestamp in millisecond resolution.
    • endTime <String!>
      • The campaign stage end time. The format is Unix Timestamp in millisecond resolution.
    • priceMultiplier <Fraction!>
      • The multiplier to the price for this campaign stage. Must be less than or equal to 1. Must be greater than 0. (For example, assume the original Smart Voucher price is 1 YourVoucher = 100 YourToken, if you have created a 20% discount stage, the priceMultiplier you get is: {numerator: 80, denominator: 100}. So the token price is allowed to be 1 YourVoucher = 80 YourToken.)
      • numerator <String!>
        • The numerator of this fraction.
      • denominator <String!>
        • The denominator of this fraction.
    • cap <String!>
      • Total amount of token for sale during this campaign stage. The format is Decimaled Number.
    • isPrivate <Boolean!>
      • The campaign stage is private or not.
    • description <String!>
      • The campaign stage description.
  • por <PORMode>
    • ENABLE or DISABLE <enum>
    • Default is DISABLE.

Response

  • createCampaign <CreateCampaignPayload>
    • transaction <JSON>
      • UNSIGNED raw transaction format in Ethereum.
    • submitToken <String>
    • pendingTransactions <String>
      • Amount of your transactions which are still pending.
    • hash <String>
      • PORMode ENABLE: Hash of the abi encode.
      • PORMode DISABLE: Hash of the RLP encode.