Skip to main content

SDK Reference

A JavaScript/TypeScript SDK for licensing user-generated content. Streamlines digital asset licensing with smart license templates, automated agreement creation, and seamless royalty management.

Getting Started

To quickly get up and running with the Spaceport SDK, check out our Quick Start Guide.

Modules

Core

Class: SpaceportSDK

client.SpaceportSDK

Guides

API Authentication

API Authentication

The SDK supports API key authentication for backend services and server-side applications. When an API key is provided, it will be automatically included in all HTTP requests to v1 API endpoints.

Creating Assets and Listings

Creating Assets and Listings

Here’s a complete example of creating an asset and listing it for licensing:

Job Monitoring

Job Monitoring

The SDK provides utilities for monitoring asynchronous job operations with configurable timeouts and intervals:

Product Creation

Product Creation

The SDK provides product management functionality to create products from signed agreement assets:

Querying Data

Querying Data

The SDK provides a query module for accessing licensing information and agreement history. The query module automatically connects to the appropriate data source based on your network configuration:

Royalty Management

Royalty Management

The SDK provides invoice generation functionality to create mock invoice data for testing and development:

Signing License Agreements

Signing License Agreements

Here’s how to sign a license agreement:

User Management

User Management

The SDK provides user management functionality to create and retrieve users associated with wallet addresses:

Query

Class: Query

query/client.QueryClient Query Client for interacting with The Graph API This client provides methods for querying indexed blockchain data

Query/modules

Class: AgreementsQueryModule

query/modules/agreements.AgreementsQueryModule Module for querying agreement data from The Graph

Class: ListingsQueryModule

query/modules/listings.ListingsQueryModule Module for querying listing data from The Graph

Class: SmartLicensesQueryModule

query/modules/smartLicenses.SmartLicensesQueryModule Module for querying smart license data from The Graph

Resources

Class: Agreement

resources/agreements.AgreementClient The AgreementClient provides methods for interacting with licensing agreements on the Spaceport platform. Agreements represent the legally binding contract formed when a licensee accepts a licensor’s listing terms. This client handles actions like creating (signing), and accepting agreements, as well as querying agreement data.

Class: Asset

resources/assets.AssetClient The AssetClient is used to manage digital assets within the Spaceport ecosystem. Assets are the core digital items, such as 3D models, audio files, or other creative works, that can be licensed and monetized. This client handles creating and managing the metadata and files associated with these assets.

Class: BondToken

resources/bondToken.BondTokenClient The BondTokenClient provides an interface for interacting with the platform’s utility token, the Bond Token. This token is used for payments, staking, and other economic activities within the Spaceport and Cultura ecosystem. This client simplifies operations like checking balances, approving transfers, and minting new tokens.

Class: Invoice

resources/invoices.InvoiceClient The InvoiceClient handles operations related to invoices, which are records of sales or usage of licensed assets. Invoices are typically imported from external platforms (e.g., Roblox sales data) and are used as the basis for calculating and distributing royalties to rights holders. This client can import, fetch, and even generate mock invoice data for testing.

Class: Listing

resources/listings.ListingClient The ListingClient is used to manage listings on the Spaceport marketplace. A listing is an offer made by a licensor to license one or more assets under specific terms, such as price, duration, and royalties. This client handles creating and querying these listings.

Class: Product

resources/products.ProductClient The ProductClient manages the lifecycle of products, which represent the instantiation of a licensed asset on an external platform (e.g., a specific t-shirt on Roblox created from a licensed design). Products link the Spaceport asset and agreement to its real-world counterpart, enabling tracking and royalty calculations.

Class: Royalty

resources/royalties.RoyaltyClient The RoyaltyClient handles the complex process of royalty management. Royalties are the payments due to licensors based on the revenue generated by licensed products. This client provides methods to register sales data (via invoices), calculate royalties, and manage their payment and acceptance both on-chain and off-chain.

Class: SmartLicense

resources/smartLicenses.SmartLicenseClient The SmartLicenseClient is used to manage Smart License templates on the blockchain. A Smart License is a reusable, on-chain template that defines the terms and conditions of a license, such as required licensee information or specific usage rights. These templates are then attached to listings to standardize and automate the licensing process.

Class: User

resources/users.UserClient The UserClient manages user profiles within the Spaceport ecosystem. A user account is typically associated with a wallet address and holds information about the user’s identity and activities on the platform. This client handles user creation and retrieval.