OpenAPI Specs & Tooling
ProvLabs provides comprehensive OpenAPI specifications and developer tools to make integration easier. This guide covers our OpenAPI specs, code generation tools, and testing utilities.
OpenAPI Specifications
We provide complete OpenAPI 3.0 specifications for all our APIs:
Core APIs: /api/provenance.openapi.yaml - Accounts, Assets, Vault, Trading
Node RPC: /api/noderpc.openapi.yaml - Blockchain query and transaction APIs
WebSocket APIs: Real-time data streaming specifications
Code Generation
Generate client libraries from our OpenAPI specs:
OpenAPI Generator
# Install OpenAPI Generator
npm install -g @openapitools/openapi-generator-cli
# Generate JavaScript client
openapi-generator-cli generate \
-i https://api.provlabs.com/provenance.openapi.yaml \
-g javascript \
-o ./provlabs-client
# Generate Python client
openapi-generator-cli generate \
-i https://api.provlabs.com/provenance.openapi.yaml \
-g python \
-o ./provlabs-client-py
Using Generated Clients
// Generated JavaScript client
import { ProvlabsApi } from "./provlabs-client";
const api = new ProvlabsApi({
basePath: "https://api.provlabs.com",
accessToken: "your-access-token",
});
// Get accounts
const accounts = await api.getAccounts();
Testing Tools
Postman Collection
Import our Postman collection for easy API testing:
# Download Postman collection
curl -o provlabs-api.postman_collection.json \
https://api.provlabs.com/postman/collection.json
Insomnia Workspace
# Download Insomnia workspace
curl -o provlabs-api.insomnia.json \
https://api.provlabs.com/insomnia/workspace.json
Interactive Documentation
Swagger UI
Explore our APIs interactively:
Core APIs: https://api.provlabs.com/docs
Node RPC: https://api.provlabs.com/node/docs
Redoc
Beautiful, responsive API documentation:
Core APIs: https://api.provlabs.com/redoc
Node RPC: https://api.provlabs.com/node/redoc
Schema Validation
JSON Schema
Validate your requests and responses:
# Install ajv-cli
npm install -g ajv-cli
# Validate request against schema
ajv validate -s provenance.openapi.yaml -d request.json
TypeScript Types
Generate TypeScript types from OpenAPI specs:
# Install openapi-typescript
npm install -g openapi-typescript
# Generate types
openapi-typescript https://api.provlabs.com/provenance.openapi.yaml \
-o types/provlabs-api.ts
Glossary (quick orientation)
Before diving into the APIs, familiarize yourself with these key concepts:
Markers (Fungible Tokens)
Markers are fungible tokens on Provenance Blockchain, representing interchangeable units of value (e.g., stablecoins, utility tokens).
Types:
- MARKER_TYPE_COIN: Standard fungible tokens with unrestricted transfers.
- MARKER_TYPE_RESTRICTED: Permissioned tokens requiring attributes or permissions for transfers.
Scopes (Non-Fungible Assets)
Scopes are structured containers for unique assets and their on-chain records. Components:
- Scope Specification: Defines the structure and purpose of a scope.
- Value Owner: The address registered as the owner of the scope's value.
nhash
Provenance's base/fee token used to pay network fees.
Denom
A Denom is atToken identifier (e.g., nhash).
Fee-grant
Sponsor-pays model: granter gives grantee an allowance to pay fees.
Plus endpoints
Curated, UI-ready aggregates for balances, metadata, transfers, NAV, holders, etc.
- Base URL: /v1/...
Net Asset Value (NAV)
NAV represents the value of an asset, used for investor reporting and dashboards.
Data access
Addresses allowed to access off-chain data linked to a scope.
Value owner
Address registered as the scope's value owner; can be updated/transferred.
Next Steps
Now that you have the tools you need:
Choose a workflow that matches your use case
Explore our API reference for detailed documentation
Check out our solutions for common patterns
Ready to pick your workflow? Let's explore our next steps!