client.SpaceportSDK

Table of contents

Accessors

Methods

Properties

Accessors

agreements

get agreements(): AgreementClient

Get the Agreements client instance

Returns

AgreementClient

assets

get assets(): AssetClient

Get the Assets client instance

Returns

AssetClient

listings

get listings(): ListingClient

Get the Listings client instance

Returns

ListingClient

smartLicenses

get smartLicenses(): SmartLicenseClient

Get the Smart Licenses client instance

Returns

SmartLicenseClient

bondToken

get bondToken(): BondTokenClient

Get the Bond Token client instance

Returns

BondTokenClient

users

get users(): UserClient

Get the Users client instance

Returns

UserClient

products

get products(): ProductClient

Get the Products client instance

Returns

ProductClient

royalties

get royalties(): RoyaltyClient

Get the Royalties client instance

Returns

RoyaltyClient

invoices

get invoices(): InvoiceClient

Get the Invoices client instance

Returns

InvoiceClient

query

get query(): QueryClient

Get the Query client instance for querying indexed blockchain data

Returns

QueryClient

utils

get utils(): SpaceportUtils

Get the Utils module instance

Returns

SpaceportUtils

constructor

new SpaceportSDK(config): SpaceportSDK

Parameters

NameType
configSpaceportConfig

Returns

SpaceportSDK

Methods

create

create(config?): SpaceportSDK

Create an instance of SpaceportClient

Parameters

NameTypeDescription
configSpaceportConfigOptional configuration options

Returns

SpaceportSDK

A new instance of SpaceportClient

createWithWallet

createWithWallet(ethereum, config?): SpaceportSDK

Create a new SDK instance with a wallet

Parameters

NameTypeDescription
ethereumEthereumProviderEthereum provider (e.g., window.ethereum)
configOmit<SpaceportConfig, "wallet">Additional SDK configuration

Returns

SpaceportSDK

createWithAccount

createWithAccount(account, config?): SpaceportSDK

Create a new SDK instance with a specific account

Parameters

NameTypeDescription
accountundefined | `0x${string}` | AccountEthereum account address or Viem Account object created with privateKeyToAccount()
configOmit<SpaceportConfig, "account">Additional SDK configuration

Returns

SpaceportSDK

Example

// With an address (limited signing capability)
const sdk = SpaceportSDK.createWithAccount('0x123...');

// With a private key (full signing capability)
import { privateKeyToAccount } from 'viem/accounts';
const account = privateKeyToAccount('0xYourPrivateKeyHere');
const sdk = SpaceportSDK.createWithAccount(account);

buildAuthHeaders

buildAuthHeaders(includeContentType?): Record<string, string>

Build authentication headers for API requests

Parameters

NameTypeDefault valueDescription
includeContentTypebooleantrueWhether to include Content-Type header (default: true)

Returns

Record<string, string>

generateSignatureParams

generateSignatureParams(signerAddress, dataToSign, primaryType, types): Promise<SignatureParams>

Generates EIP-712 signature parameters for contract interactions. NOTE: This is a simplified adaptation. Production use requires robust nonce handling and precise matching of types/domain with the target contract facet.

Parameters

NameTypeDescription
signerAddress`0x${string}`The address performing the signing.
dataToSignRecord<string, unknown>An object containing the data fields specific to the EIP-712 type.
primaryTypestringThe primary EIP-712 type name (e.g., “_verifyTokenURI”).
typesRecord<string, { name: string ; type: string }[]>The EIP-712 type definitions.

Returns

Promise<SignatureParams>

The generated SignatureParams.

generateDocSignature

generateDocSignature(docURI): Promise<SignatureParams>

Generates a document signature by signing the keccak256 hash of a document URI. This method follows the same approach used in listings for document verification.

Parameters

NameTypeDescription
docURIstringThe document URI to sign

Returns

Promise<SignatureParams>

The signature params formatted for contract consumption

Properties

config

Readonly config: SpaceportConfig

publicClient

Readonly publicClient: Object

walletClient

Optional Readonly walletClient: Object

cultura

Optional cultura: CulturaSDK