You are able to fetch your Smart Voucher Information via this API.
GraphQL API
- Query String
123456789101112131415161718192021222324252627282930313233343536373839query getSmartVoucherInfo {me {token {vouchers {edges {node {idtoken {id}contractAddresstransactionHashnamedescriptionsymboldecimalstotalSupplyproofOfContract {ipfs}liquidapproveCheckingprice {numeratordenominator}availableAmountvendibleexpiryconsumablecreatedTime}}}}}} - HTTP Headers
1234567{"accept": "application/json","content-type": "application/json","authorization": "bearer [JWT Web-to-Server access token]"}
HTTP Request and Response
Request
- URL
- For development:
https://test.fstk.io/api
- For production:
https://engine.fstk.io/api
- For development:
- Method:
POST
- Headers
- accept:
application/json
- content-type:
application/json
- authorization:
Bearer [JWT Web-to-Server access token]
- (for example)
123Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCIsImtpZCI6ImZzdGstZW5naW5lIn0.eyJ1aWQiOiLDr1xiw73Ch8KDSFx1MDAxMcOowo5awrvCqsOAXHUwMDAywrwmIiwiaWF0IjoxNTM4NzA5MDM2LCJleHAiOjE1Mzg3OTU0MzYsImF1ZCI6InVybjpmc3RrOmVuZ2luZSIsImlzcyI6InVybjpmc3RrOmVuZ2luZSIsInN1YiI6InVybjpmc3RrOmVuZ2luZTphY2Nlc3NfdG9rZW4ifQ.msJZ61FHIkKtjUpDs4sx1Kk1rb9vdhus3ntUDj6rHNmsygiHTgOEMQFJMtVqtWqkNgrtRgGpngq8Rf47xTT53g
- (for example)
- accept:
- Body
12345{"query":"{ me { token { vouchers { edges { node { id token { id } contractAddress transactionHash name description symbol decimals totalSupply proofOfContract { ipfs } liquid approveChecking price { numerator denominator } availableAmount vendible expiry consumable createdTime } } } } }}"}
The value ofquery
in the body is aString
.
Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
{ "data": { "me": { "token": { "vouchers": { "edges": [ { "node": { "id": "Vm91Y2hlcjrDq30Kw7Qaw7ERw6nCujvCh2sfw5NbNg==", "token": { "id": "VG9rZW46w4vDnGzCihouEcOpwro7w4drQ8KgIMOn" }, "contractAddress": "0xc9961776dc4cc72422a551dd616f5b53fd1bdd78", "transactionHash": "0xe0cf672420248b3af5ff34cfb80763c50689f82e50783ce7a186fd9dc73bd4d8", "name": "Love River", "description": "love love", "symbol": "HAN_LOVE", "decimals": "0", "totalSupply": "9487", "proofOfContract": { "ipfs": "zBurKC5xBDHi2TTEYyY51S9p5qqGV2DqcaC2eYmpmh57Kxi6brpz3QH2h3X97xjKcuPDBZasPBsAHjpjzGuBbNzWhNRCL/proofOfContract/default" }, "liquid": true, "approveChecking": false, "price": { "numerator": "75000000000000000000", "denominator": "1" }, "availableAmount": "9467", "vendible": true, "expiry": "1704038399000", "consumable": true, "createdTime": "1547796216000" } } ] } } } } } |
Parameters
Response
vouchers
<VoucherConnection>totalCount
<Int!>- Total amount of the vouchers.
pageInfo
<PageInfo>- Please refer to document of GraphQL
edges
<[VoucherEdge]>cursor
<String!>- Please refer to document of GraphQL
node
<Voucher>id
<ID!>- Smart Voucher ID. ID is a global identifier.
token
<Token>id
<ID!>- ID of the Smart Token which the Smart Voucher . ID is a global identifier.
contractAddress
<String!>- The Smart Voucher contract address.
transactionHash
<String!>- Transaction hash of the Smart Voucher publishment.
name
<String!>- Smart Voucher name.
description
<String!>- Description of the Smart Voucher.
symbol
<String!>- Smart Voucher symbol.
decimals
<String!>- Smart Voucher decimals
totalSupply
<String!>- Total supply of the Smart Voucher. The format is Decimaled Number.
proofOfContract
<File!>- The PDF file of the Smart Voucher contract.
ipfs
<String!>- Information of the contract’s ipfs link.
liquid
<Boolean!>- The Smart Voucher is liquid or not.
price
<Fraction!>- Smart Voucher price.
numerator
<String!>- The numerator of this fraction.
denominator
<String!>- The denominator of this fraction.
availableAmount
<String!>- Remaining amount of the Smart Voucher. The format is Decimaled Number.
vendible
<Boolean!>- The Smart Voucher is vendible or not.
expiry
<String>- Expiry date of the Smart Voucher. The format is Unix Timestamp in millisecond resolution.
consumable
<Boolean!>- The Smart Voucher is consumalbe or not.
createdTime
<String!>- The Smart Voucher created time. The format is Unix Timestamp in millisecond resolution.
Copyright © 2018-2019 FST Network Ltd., all rights reserved.