API

GET claim-links/:link_id

Fetches claim links params by link ID. Link ID is derived from the Link Key. 
  Params:
    - link_id - ID of link
  Return:
    - success: boolean, indicating whether the operation was successful
    - data: 
      - creator_address - address of the user created the campaign
      - sponsored - did creator sponsor campaign (boolean)
      - chain_id - chain id
      - campaign_number - a sequential number for each proxy contract generated by client. For every user starts from 1 and sequentially updated (like a counter) for each new user campaign.  
      - token_address - contract address of the token
      - token_standard - token standard type (erc-721, etc.)
      - symbol - token symbol
      - wallet - default wallet application for claim (metamask, etc.)
      - claim_pattern - the way token will be transfered to user (mint or transfer)
      - token_id - token id for the link (always null for ERC20 campaigns)
      - token_amount - amount of tokens for the link (always null for ERC721 campaigns) 
      - sender_signature - signature obtained by signing link id with the signer key (null if the link is not active)
      - proxy_contract_version - proxy contract version    
      - wei_amount - amount of native tokens attached to the link (0 by default)
      - expiration_time - UNIX timestamp corresponding to the latest datetime to claim the link
      - active - boolean, if link can be claimed. 

GET claim-links/:link_id/status

Gets link's data: status, recipient address, claim transaction hash and when it was claimed.
  Params:
    - link_id - ID of the link
  Return:
    - success: boolean, indicating whether the operation was successful
    - data: 
      - link_id - ID of the link
      - status - claim status of the link, can be one of the following: "CREATED", "PENDING", "CLAIMED", "FAILED", "DEACTIVATED", "EXPIRED" // #TODO add  "CAMPAIGN_PAUSED", "CAMPAIGN_STOPPED"
      - recipient - address of the recipient, present only if status is CLAIMED, PENDING, or FAILED
      - tx_hash - claim transaction hash, present only if status is CLAIMED, PENDING, or FAILED
      - claimed_at_block - block number, when the link was claimed, present only if status is CLAIMED
      - created_at - UNIX timestamp, when the link was created

POST claim-links/:link_id/claim

Initiates claim transaction on behalf of a receiver.
  Params:
    - link_id - ID of the link
  Body:
    - receiver_address - Ethereum address to redeem the tokens to
    - receiver_signature - ECDSA signature, obtained by reciever by signing the receiver address with the link key. 
  Return:
    - success: boolean, indicating whether the operation was successful
    - data: 
      - tx_hash - claim transaction hash

Errors:
   - If claim link is deactivated, the request returns success: false (422 http code error) - "The claim link is deactivated"
   - If claim link is not sponsored, the request returns success: false (422 http code error) - "The claim link is not sponsored"

Last updated