Documentation Index
Fetch the complete documentation index at: https://docs.spaceport.xyz/llms.txt
Use this file to discover all available pages before exploring further.
Product Creation
The SDK provides product management functionality to create products from signed agreement assets:
import { SpaceportSDK } from '@spaceport/sdk'
async function productManagementExamples() {
// Initialize SDK with a wallet and API key
const sdk = SpaceportSDK.createWithAccount(account, {
chain: 'devnet',
apiKey: process.env.SDK_API_KEY,
})
// Get current user
const currentUser = await sdk.users.getCurrentUser()
// Generate delegated attestation signatures for product creation
const delegatedAttestationParams = await sdk.products.generateDelegatedAttestationSignatures(2) // For 2 products
// Create products from agreement assets
const productResult = await sdk.products.create({
robloxAssetId: '123456789', // Roblox asset ID
agreementId: 'e5a654c3-a5c9-4651-9c93-d0e947154a1a', // Agreement ID from your database
productDetails: [
{
assetId: 'asset-uuid-1', // Asset ID from the agreement
title: 'My Awesome Product',
description: 'A product created from a signed agreement',
},
{
assetId: 'asset-uuid-2', // Another asset ID from the agreement
title: 'Another Great Product',
description: 'Second product from the same agreement',
},
],
delegatedAttestationParams, // Signatures generated above
})
console.log('Product creation result:', productResult)
if (productResult.success) {
console.log('🎉 Products created successfully!')
}
}
Product Management Methods
products.create(params): Creates products from agreement assets with on-chain verification
products.generateDelegatedAttestationSignatures(count): Generates the required signatures for product creation
Product Creation Workflow
- Sign an Agreement: First, use the agreement signing functionality to create a signed agreement
- Generate Signatures: Create delegated attestation signatures for the number of products you want to create
- Create Products: Call the product creation method with the agreement details and asset information
- On-Chain Processing: The system will automatically:
- Create products in the database
- Mint derivative digital assets on-chain
- Create attestations for verification
- Update product records with on-chain information