BARK Whitepaper
  • Welcome
  • Executive Summary
  • Abstract
  • Disclaimer
  • About
    • The BARK Protocol
      • Business Model
        • Fee Structure
          • Benefits
      • The Vision of BARK
        • Foundation
  • Introduction
    • Transformative Technology
      • Benefits
  • Markets
    • Global Markets
      • Problem
      • Traditional Finance
        • The Role of Bots
        • Solution
        • Resources
  • Solutions
    • Verifiable Web
      • Features
        • Real-World Use Cases
          • Charitable Donation
          • Tokenized Assets
            • Real-World Asset Token
            • CNFT
              • Implementation
        • Asset Marketplace
          • Benefits
          • System Architecture
      • Advantages
    • Technology
      • Architecture
      • Benefits
  • Ecosystem
    • Strategic Planning
    • Introduction
      • BARK
      • Components
        • Governance
          • Voting
          • Participation
            • Getting Started
          • Treasury
            • Advantages
        • Underdogs
          • Development
            • Members Club´s
              • Mission Statement
                • Tiered Members
                • Responsibilities
                  • Services
              • BARKER
                • Membership
                  • Council
              • The Peaky Barkers
                • Mission
                • Brand
                  • Merchandise
              • Sparky Bros
                • Mission
                • Brand
                  • Merchandise
            • Benefits
            • Marketing
            • Participate
            • FAQ
    • Members Club´s
  • Technology
    • Architecture
      • Tokenization
        • Overview
        • BARK
          • Overview
            • Utility
            • Benefits
            • Advantages
        • BPT Token
        • BRWA: Tokenized Assets
        • BARK Protocol Token
          • Integration
    • Token Standard
      • SPL-404
      • Why Solana
  • Product
    • NFT Marketplace
      • Website
      • FAQ
    • Social Finance
      • Introduction
        • CNFT 404
      • Architecture
        • Components
      • Disbursement
        • Architecture
          • User Interface
            • Features
        • Introduction
          • Use Cases
            • Charity
            • Payments
            • Swap
          • Benefits
    • Crowdfunding Platform
      • About
      • Overview
        • Features
          • Components
            • Payments System
        • Benefits
        • Use Cases
        • Compliance
      • Development
        • Overview
          • Website
          • Application
            • Assets
          • Solana
            • Components
            • Programs
          • SUI
            • Components
          • References
        • Brand Guidelines
          • Assets
        • Roadmap
    • Blinks
      • Introduction
      • Components
    • BarkBOT
      • About
      • Features
        • API
          • Example
      • Reguirements
        • Integration
          • Blockchain
          • Programs
      • Architecture
        • Advantages
      • References
    • Commerce
      • Components
        • Backend
          • API
        • Storefront
        • Plugins
          • Payments
            • Payment Gateway
      • References
        • Tutorial
    • BarkSwap
      • Introduction
        • Architecture
        • Features
          • Benefits
    • Staking DApp
    • BARK AI Chatbot
      • Application
        • Development
          • Programs
          • NFT
            • Badges
        • FAQ
      • Architecture
        • Implementation
      • Demo
    • Token Sale Dashboard
      • Terminology
      • Benefits
  • Tokenomics
    • Tokenization
      • BARK
        • BARK (SPL20)
          • Use Cases
          • Distribution
          • Vesting & Locking Mechanism
        • BARK (Token-2022)
          • Specification
            • Important
          • Utility
            • Fees
              • Allocation
            • Staking
          • Distribution
          • Vesting
          • Emission Plan
            • Burning
              • Burning Process
        • CNFT
          • BARKER
            • Information
              • Community Token
            • Allocation
            • Swap
          • SPARKY
            • Token economy
            • Features
      • BPT
      • BRWA
  • Airdop
    • Acknowledgment
    • Overview
      • FAQ
  • Roadmap
    • Comprehensive Strategy
      • Recover & BARK Burning Plan
      • Strategic Transition to SPL-20 Token Standard
    • Milestones
      • Strategy Change
        • Airdrop One
        • Trading
          • Listing Process on DEXs
      • Exchanges
  • Community
    • Future Development
      • Treasury
        • Implementation
    • Overview
      • Governance
        • Specifications
          • Verification
        • Join BARK
      • Rewards
      • Engagement
        • Airdrops
    • FAQ
  • References
    • References
  • Developers
    • Applications
      • Blinks
        • Components
          • UI/UX Design
          • Server
            • Example
        • Actions
          • Frameworks
            • React Native
          • Referrals
          • Donate
          • Swap
          • Extensions
        • API Documentation
          • API
            • Use Cases
            • Features
            • Integration
      • Token Swap System
        • Architecture
          • Sample
          • BarkSwap API
      • BarkPaws Bot
        • Interface
          • Web3 DApp
          • Benefits
          • Improvement
      • Fundraising Platform
        • Introduction
          • Smart Contracts
            • Technical Overview
              • Contract
        • Components
          • Campaigns
            • Payments
              • Payment Processor
              • Stablecoin
                • Escrow Programs
                • Compliance
        • References
          • API
            • Documentation
    • BARK & Jupiter Swap API
      • API
    • Reward System
    • Product Owners
      • Grant Programs
  • Partnership
    • Collaboration
  • Annauncement
    • Newsletter
  • Documentation
    • Projects
      • Market Maker Bot
      • BARKER´s Club
      • Contributing
      • FairLauncher.fun
    • Investors Guide
      • Trading
  • Assets
    • Brand
      • Brand Guide
        • System Design
          • Colors Guide
        • Assets
Powered by GitBook
On this page
  1. Developers
  2. Applications
  3. Blinks
  4. API Documentation

API

API for interacting with the BARK protocol on the Solana blockchain. Includes endpoints for minting NFTs, and processing donations in SOL, USDC, BARK, and SPL tokens.

OpenAPI Sample:

openapi: 3.0.1
info:
  title: BARK Actions Server API
  description: API for interacting with the BARK protocol on the Solana blockchain. Includes endpoints for minting NFTs, processing donations in SOL, USDC, BARK and SPL tokens, charity donations, merchant payments, transaction preview, signing, and tracking.
  version: 1.1.0
  contact:
    name: BARK Protocol Support
    email: support@barkprotocol.net
servers:
  - url: https://api.actions.barkprotocol.net/v1
    description: Production server
  - url: http://localhost:3000/v1
    description: Development server

paths:
  /api/mint:
    post:
      summary: Mint a new BARK NFT
      operationId: mintNft
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MintNftRequest'
      responses:
        '200':
          description: NFT successfully minted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MintNftResponse'
        '400':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error during minting
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  /api/donate/sol:
    post:
      summary: Donate SOL to the specified treasury address
      operationId: donateSol
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DonateRequest'
      responses:
        '200':
          description: SOL donation processed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DonationResponse'
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error during donation processing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  /api/donate/usdc:
    post:
      summary: Donate USDC to the specified treasury address
      operationId: donateUsdc
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DonateRequest'
      responses:
        '200':
          description: USDC donation processed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DonationResponse'
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error during donation processing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  /api/donate/bark:
    post:
      summary: Donate BARK tokens to the specified treasury address
      operationId: donateBark
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DonateRequest'
      responses:
        '200':
          description: BARK token donation processed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DonationResponse'
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error during donation processing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  /api/charity/donate:
    post:
      summary: Make a donation to a charity using SOL, USDC, or BARK
      operationId: donateToCharity
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CharityDonationRequest'
      responses:
        '200':
          description: Charity donation processed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DonationResponse'
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error during charity donation processing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  /api/merchant/payment:
    post:
      summary: Facilitate payment to a merchant using SOL, USDC, or BARK
      operationId: merchantPayment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MerchantPaymentRequest'
      responses:
        '200':
          description: Merchant payment processed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentResponse'
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error during merchant payment processing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  /api/transaction/preview:
    post:
      summary: Preview a transaction before sending it to the Solana blockchain
      operationId: previewTransaction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionPreviewRequest'
      responses:
        '200':
          description: Transaction preview generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionPreviewResponse'
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error during transaction preview
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  /api/transaction/sign:
    post:
      summary: Sign a transaction before sending it to the Solana blockchain
      operationId: signTransaction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionSignRequest'
      responses:
        '200':
          description: Transaction signed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionSignResponse'
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error during transaction signing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  /api/transaction/track/{transactionId}:
    get:
      summary: Track a transaction on the Solana blockchain
      operationId: trackTransaction
      parameters:
        - in: path
          name: transactionId
          required: true
          schema:
            type: string
          description: The transaction ID to track
      responses:
        '200':
          description: Transaction tracking information retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionTrackingResponse'
        '400':
          description: Invalid transaction ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error during transaction tracking
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

components:
  schemas:
    MintNftRequest:
      type: object
      properties:
        name:
          type: string
          description: The name of the NFT
          example: "NFT Name"
        symbol:
          type: string
          description: The symbol for the NFT
          example: "NFTSYMBOL"
        uri:
          type: string
          description: The URI pointing to the NFT metadata
          example: "https://example.com/metadata.json"
      required:
        - name
        - symbol
        - uri

    MintNftResponse:
      type: object
      properties:
        message:
          type: string
          description: Success message
          example: "NFT minted successfully"
        transactionId:
          type: string
          description: The transaction ID of the mint operation
          example: "TransactionIDHere"

    DonateRequest:
      type: object
      properties:
        account:
          type: string
          description: The public key of the sender's Solana account
          example: "SolPublicKey"
        amount:
          type: string
          description: The amount of SOL, USDC, or BARK tokens to donate
          example: "10"
        priority:
          type: string
          description: The priority level of the transaction
          enum:
            - VeryHigh
            - High
            - Medium
            - Low
            - Min
          example: "High"
      required:
        - account
        - amount
        - priority

    CharityDonationRequest:
      type: object
      properties:
        charity:
          type: string
          description: The public key of the charity's Solana account
          example: "CharityPublicKey"
        amount:
          type: string
          description: The amount of SOL, USDC, or BARK tokens to donate
          example: "100"
        currency:
          type: string
          description: The type of currency for the donation (SOL, USDC, BARK)
          example: "USDC"
        useEscrow:
          type: boolean
          description: Whether to use escrow for the donation
          example: true
      required:
        - charity
        - amount
        - currency

    MerchantPaymentRequest:
      type: object
      properties:
        merchant:
          type: string
          description: The public key of the merchant's Solana account
          example: "MerchantPublicKey"
        amount:
          type: string
          description: The amount of SOL, USDC, or BARK tokens to pay
          example: "50"
        currency:
          type: string
          description: The type of currency for the payment (SOL, USDC, BARK)
          example: "SOL"
        useEscrow:
          type: boolean
          description: Whether to use escrow for the payment
          example: false
      required:
        - merchant
        - amount
        - currency

    TransactionPreviewRequest:
      type: object
      properties:
        account:
          type: string
          description: The public key of the sender's Solana account
          example: "SolPublicKey"
        transactionType:
          type: string
          description: The type of transaction (donation, payment, etc.)
          example: "donation"
        details:
          type: object
          additionalProperties: true
          description: Additional details specific to the transaction type
      required:
        - account
        - transactionType
        - details

    TransactionPreviewResponse:
      type: object
      properties:
        preview:
          type: string
          description: The preview of the transaction
          example: "Transaction preview data here"

    TransactionSignRequest:
      type: object
      properties:
        account:
          type: string
          description: The public key of the sender's Solana account
          example: "SolPublicKey"
        transactionType:
          type: string
          description: The type of transaction (donation, payment, etc.)
          example: "donation"
        details:
          type: object
          additionalProperties: true
          description: Additional details specific to the transaction type
        preview:
          type: string
          description: The transaction preview generated previously
          example: "Transaction preview data here"
      required:
        - account
        - transactionType
        - details
        - preview

    TransactionSignResponse:
      type: object
      properties:
        message:
          type: string
          description: Success message indicating the transaction was signed
          example: "Transaction signed successfully"
        transactionId:
          type: string
          description: The transaction ID of the signed transaction
          example: "TransactionIDHere"

    TransactionTrackingResponse:
      type: object
      properties:
        transactionId:
          type: string
          description: The transaction ID being tracked
          example: "TransactionIDHere"
        explorerUrl:
          type: string
          description: The URL to view the transaction on the Solana Explorer
          example: "https://explorer.solana.com/tx/TransactionIDHere"
        status:
          type: string
          description: The current status of the transaction
          example: "confirmed"

    DonationResponse:
      type: object
      properties:
        message:
          type: string
          description: Success message indicating the donation was processed
          example: "You sent 10 SOL!"
        transactionId:
          type: string
          description: The transaction ID of the donation
          example: "TransactionIDHere"

    PaymentResponse:
      type: object
      properties:
        message:
          type: string
          description: Success message indicating the payment was processed
          example: "Payment of 50 SOL sent!"
        transactionId:
          type: string
          description: The transaction ID of the payment
          example: "TransactionIDHere"

    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Error message indicating what went wrong
          example: "Invalid input: ensure account is a valid public key and amount is a number"

tags:
  - name: NFT
    description: Operations related to NFT minting
  - name: Donation
    description: Operations related to donations in SOL, USDC, BARK, and SPL tokens
  - name: Charity
    description: Operations related to charity donations
  - name: Merchant
    description: Operations related to merchant payments
  - name: Transaction
    description: Operations related to transaction preview, signing, and tracking

Reference


PreviousAPI DocumentationNextUse Cases

Last updated 8 months ago

Swagger API:

https://app.swaggerhub.com/apis/BARKProtocol-6c4/BARK_Actions_Server_API/0.1.0