Twetch Developer

Twetch Developer

    ›Protocol

    Protocol

    • Introduction
    • Posting
    • Likes
    • Follows
    • Votes
    • Purchases
    • Feature requests
    • Authentication
    • Twetch API

    twetch-js

    • Overview
    • Library
    • Storage
    • Wallet
    • CLI

    Twetch Pay

    • Overview

    Encryption

    • Overview
    • Create a conversation
    • Send a message
    • Read messages

    Feature Requests

    Twetch features can be funded by broadcasting a Bitcoin transaction adhering to the ABI schema for the particular feature.

    Feature requests implement a custom Bitcom prefix address 1buiLdpfsqaXFwzEyks8vVKV8UynbRWCR

    To get the address to fund, use the payees endpoint detailed here.

    Feature request IDs

    To get the feature request IDs, use the graphql endpoint and following query to return a list of open features.

    HTTP POST request:

    URL: https://api.twetch.app/v1/graphql

    Headers: {
        Authorization: ‘Bearer <twetch_authorization_token>’
    }
    Body: {
        query: {
            allFeatureRequests(filter: {completedAt: {isNull: true}}) {
                nodes {
                id
                description
                }
            }
        }
    }
    

    Response:

    {
      "data": {
        "allFeatureRequests": {
          "nodes": [
            {
              "id": "5aeae879-e0d9-4a68-b18b-af7ac07c8280",
              "description": "No more character restrictions for a single Twetch post "
            },
            {
              "id": "8680d994-c22f-484d-910d-02189471a762",
              "description": "Native video and audio call experience with pricing per minute in Twetch"
            },
            {
              "id": "9f0da5cf-9657-42d7-b7c1-83d2d41d7c7f",
              "description": "Twetch mobile app for ios and android"
            },
            {
              "id": "d7174637-f17d-4798-8be3-d358f5557d3a",
              "description": "Tool for sending a private DM to each of your Twitter followers. You will earn 10¢ for each person who joins Twetch with your Twetch invite link and every conversion will get their first Twetch free.\n\n"
            }
          ]
        }
      }
    }
    

    Populate the id value of the feature being funded in field 3 below.

    Funding features

    Action: twetch/feature-request@0.0.1

    PositionExample valueDescriptionNotes
    00OP_FALSE opcode
    1OP_RETURNOP_RETURN opcode
    21buiLdpfsqaXFwzEyks8vVKV8UynbRWCRFeature request purchase protocol prefix
    36d1a5252-c67a-4b9f-9ac4-7ec0272f2e25Feature request ID
    40.1Funding amount
    5twetchDefault twetch
    67e36303e-5d3a-4b79-a3d1-6c049d721a3fInvoice
    7Pipe characterProtocol boundary
    815PciHG22SNLQJXMoSUaWVi7WSqc7hCfvaAIP protocol prefix
    9BITCOIN_ECDSABITCOIN_ECDSA
    101EdS2Tnm4tRrb7ugJDQYRHA5w8WnAanmJXSigning address
    11H9q75W67qbqwHVmNArxWhC0MBOOO+KUrZjE92wblAJB0G1U5ei2r1G/QYkHDuUrw2zr/3y+NIv2y+LCcUIYWkUs=Signature of hash of a Buffer of an array of fields 2-6**

    Example Feature request funding transaction:

    https://bitcoinfiles.org/tx/0c81e0916782df804b79e4f791a5240d8aa611444edceb14769a1194b83ef41c

    ← PurchasesAuthentication →