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
Last updated