> ## Documentation Index
> Fetch the complete documentation index at: https://tokenlayer-2a53bba4.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create new token transaction

> 
    Creates a new token on-chain. This endpoint prepares and optionally executes the blockchain transaction
    to deploy a new token contract with specified parameters.

    Supports:
    - Token metadata (name, symbol, description)
    - Media assets (logo, banner, video)
    - Multiple chains (Base, Base Sepolia)
    - Optional hashtags/tags
    - Automatic token URI generation and IPFS storage

    Returns transaction data for client-side execution or confirmation of server-side execution.

    **USD Rewards Attribution:**
    - **Builder attribution**: Set custom builder fees (in basis points) to earn USD rewards on token creation
    - **Token referral**: Enable affiliate programs by specifying referral addresses for token trades
    - USD rewards are processed in real-time on-chain with no third parties involved
    - Token referrals have no additional cost to users - enabling affiliate programs onchain
  



## OpenAPI

````yaml post /create-token-transaction
openapi: 3.0.3
info:
  title: Thrust API
  version: 1.0.0
  description: |2-

          Thrust is a social trading platform where users can create, trade, and engage with tokens.

          This API provides comprehensive access to token operations, social features (posts, voting, clubs),
          blockchain transactions, and real-time interactions.

          ## Base URL
          All endpoints are accessed via: `${SUPABASE_URL}/functions/v1/{endpoint}`

          ## Authentication
          Most endpoints require authentication using an JWT token or API key passed as a Bearer token in the Authorization header.

          ## Rate Limiting
          API calls are rate limited per user. Please implement appropriate backoff strategies.
        
  contact:
    name: Thrust API Support
    url: https://onthrust.com
servers:
  - url: https://yppncslmsswqydhhgygz.supabase.co/functions/v1
    description: Production server
  - url: https://yppncslmsswqydhhgygz.supabase.co/functions/v1
    description: Staging server
security: []
tags:
  - name: Tokens
    description: Token creation, browsing, search, trading, and price operations
  - name: Posts
    description: Creating and retrieving posts and topics
  - name: Voting
    description: Voting on posts, polls, tokens, and livestreams
  - name: Notifications
    description: User notifications management
  - name: Clubs
    description: Club and group management
  - name: Feed
    description: Timeline and feed operations
  - name: Transactions
    description: Blockchain transactions (send, tip, ownership checks)
paths:
  /create-token-transaction:
    post:
      tags:
        - Transactions
        - Tokens
      summary: Create new token transaction
      description: |2-

            Creates a new token on-chain. This endpoint prepares and optionally executes the blockchain transaction
            to deploy a new token contract with specified parameters.

            Supports:
            - Token metadata (name, symbol, description)
            - Media assets (logo, banner, video)
            - Multiple chains (Base, Base Sepolia)
            - Optional hashtags/tags
            - Automatic token URI generation and IPFS storage

            Returns transaction data for client-side execution or confirmation of server-side execution.

            **USD Rewards Attribution:**
            - **Builder attribution**: Set custom builder fees (in basis points) to earn USD rewards on token creation
            - **Token referral**: Enable affiliate programs by specifying referral addresses for token trades
            - USD rewards are processed in real-time on-chain with no third parties involved
            - Token referrals have no additional cost to users - enabling affiliate programs onchain
          
      operationId: createTokenTransaction
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTokenTransactionRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTokenTransactionResponse'
        '400':
          description: Bad request - Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - Invalid or missing authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - BearerAuth: []
components:
  schemas:
    CreateTokenTransactionRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          description: Token name
          example: My Cool Token
        symbol:
          type: string
          minLength: 1
          maxLength: 10
          description: Token symbol (ticker)
          example: MCT
        description:
          type: string
          minLength: 1
          description: Token description
          example: A revolutionary new token
        image:
          type: string
          minLength: 1
          description: >-
            Token logo image - can be either a URL or base64-encoded image data
            (data:image/...)
          example: >-
            https://example.com/logo.png or
            data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==
        banner:
          type: string
          minLength: 1
          description: >-
            Banner image - can be either a URL or base64-encoded image data
            (data:image/...)
          example: >-
            https://example.com/banner.png or
            data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==
        video:
          type: string
          minLength: 1
          description: >-
            Promotional video - can be either a URL or base64-encoded video data
            (data:video/...)
          example: >-
            https://example.com/promo.mp4 or
            data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACKBtZGF0AAAC
        links:
          type: object
          properties:
            website:
              type: string
              format: uri
              description: Project website URL
              example: https://example.com
            twitter:
              type: string
              format: uri
              description: Twitter/X profile URL
              example: https://twitter.com/example
            youtube:
              type: string
              format: uri
              description: YouTube channel URL
              example: https://youtube.com/@example
            discord:
              type: string
              format: uri
              description: Discord server invite URL
              example: https://discord.gg/example
            telegram:
              type: string
              format: uri
              description: Telegram group/channel URL
              example: https://t.me/example
          description: Optional social media and website links
        chainSlug:
          $ref: '#/components/schemas/ChainSlug'
        destinationChains:
          type: array
          items:
            $ref: '#/components/schemas/ChainSlug'
          description: >-
            Optional array of destination chain slugs for cross-chain token
            deployment and migration endpoints. Defaults to [base-sepolia,
            bnb-testnet, solana-devnet]. The initial chain will be automatically
            excluded from migration endpoints.
          example:
            - base-sepolia
            - bnb-testnet
            - solana-devnet
        poolType:
          type: string
          enum:
            - meme
            - startup-preseed
          description: >-
            Type of token pool. Defaults to "meme". Maps to: meme=7,
            startup-preseed=8
          example: meme
        userAddress:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: >-
            User wallet address (optional - if not provided, will use user's
            Privy wallet from user_wallets table)
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
        builder:
          $ref: '#/components/schemas/Builder'
        token_referral:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: >-
            Token referral address for attribution (optional - defaults to zero
            address). Used to attribute referral fees to a specific address.
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
        tags:
          type: array
          items:
            type: string
          description: Optional hashtags/tags for the token
          example:
            - defi
            - meme
        type:
          type: string
          enum:
            - coin
          default: coin
          description: >-
            Transaction type (currently only "coin" is supported - placeholder
            for future integration)
          example: coin
      required:
        - name
        - symbol
        - description
        - image
        - chainSlug
    CreateTokenTransactionResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        executed:
          type: boolean
        transactionHash:
          type: string
        chainId:
          type: integer
          description: Numeric chain ID for the transaction
          example: 84532
        transaction:
          type: object
          properties:
            to:
              type: string
            data:
              type: string
            value:
              type: string
            gasLimit:
              type: string
          required:
            - to
            - data
            - value
            - gasLimit
        metadata:
          type: object
          properties:
            tokenUri:
              type: string
            tokenId:
              type: string
            name:
              type: string
            symbol:
              type: string
            slug:
              type: string
            token_layer_id:
              type: string
              nullable: true
              description: Token Layer ID (calculated hash)
              example: >-
                0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
            description:
              type: string
            hubUrl:
              type: string
              format: uri
              description: Direct URL to the token hub page
              example: https://onthrust.com/hub/my-cool-token
            addresses:
              type: object
              properties:
                evm:
                  type: string
                solana:
                  type: string
              required:
                - evm
                - solana
          required:
            - tokenUri
            - tokenId
            - name
            - symbol
            - slug
            - description
            - hubUrl
            - addresses
      required:
        - success
    Error:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: string
      required:
        - success
        - error
      description: Error response
    ChainSlug:
      type: string
      enum:
        - solana-devnet
        - base
        - base-sepolia
        - avalanche
        - bnb
        - bnb-testnet
        - unichain
        - unichain-testnet
        - abstract
        - polygon
        - zkSync
        - zkSync-testnet
      description: >-
        Blockchain identifier. Supported chains: solana-devnet, base,
        base-sepolia, avalanche, bnb, bnb-testnet, unichain, unichain-testnet,
        abstract, polygon, zkSync, zkSync-testnet
      example: base-sepolia
    Builder:
      type: object
      properties:
        code:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: Builder address for attribution
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
        fee:
          type: integer
          minimum: 0
          maximum: 10000
          description: Builder fee in basis points (bps). 1 bps = 0.01%. Max 10000 (100%).
          example: 50
      required:
        - code
        - fee
      description: >-
        Builder attribution information (optional). Includes address and fee in
        bps.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token or API key

````