> ## 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.

# Class: SpaceportSDK

[client](../modules/client).SpaceportSDK

## Table of contents

### Accessors

* [agreements](#agreements)
* [assets](#assets)
* [listings](#listings)
* [smartLicenses](#smartlicenses)
* [bondToken](#bondtoken)
* [users](#users)
* [products](#products)
* [royalties](#royalties)
* [invoices](#invoices)
* [query](#query)
* [utils](#utils)

#### Methods

* [create](#create)
* [createWithWallet](#createwithwallet)
* [createWithAccount](#createwithaccount)
* [buildAuthHeaders](#buildauthheaders)
* [generateSignatureParams](#generatesignatureparams)
* [generateDocSignature](#generatedocsignature)

### Properties

* [config](#config)
* [publicClient](#publicclient)
* [walletClient](#walletclient)
* [cultura](#cultura)

## Accessors

### agreements

• `get` **agreements**(): [`AgreementClient`](./resources/agreement)

Get the Agreements client instance

#### Returns

[`AgreementClient`](./resources/agreement)

### assets

• `get` **assets**(): [`AssetClient`](./resources/asset)

Get the Assets client instance

#### Returns

[`AssetClient`](./resources/asset)

### listings

• `get` **listings**(): [`ListingClient`](./resources/listing)

Get the Listings client instance

#### Returns

[`ListingClient`](./resources/listing)

### smartLicenses

• `get` **smartLicenses**(): [`SmartLicenseClient`](./resources/smart-license)

Get the Smart Licenses client instance

#### Returns

[`SmartLicenseClient`](./resources/smart-license)

### bondToken

• `get` **bondToken**(): [`BondTokenClient`](./resources/bond-token)

Get the Bond Token client instance

#### Returns

[`BondTokenClient`](./resources/bond-token)

### users

• `get` **users**(): [`UserClient`](./resources/user)

Get the Users client instance

#### Returns

[`UserClient`](./resources/user)

### products

• `get` **products**(): [`ProductClient`](./resources/product)

Get the Products client instance

#### Returns

[`ProductClient`](./resources/product)

### royalties

• `get` **royalties**(): [`RoyaltyClient`](./resources/royalty)

Get the Royalties client instance

#### Returns

[`RoyaltyClient`](./resources/royalty)

### invoices

• `get` **invoices**(): [`InvoiceClient`](./resources/invoice)

Get the Invoices client instance

#### Returns

[`InvoiceClient`](./resources/invoice)

### query

• `get` **query**(): [`QueryClient`](./query/query)

Get the Query client instance for querying indexed blockchain data

#### Returns

[`QueryClient`](./query/query)

### utils

• `get` **utils**(): [`SpaceportUtils`](./utils/spaceport-utils)

Get the Utils module instance

#### Returns

[`SpaceportUtils`](./utils/spaceport-utils)

### constructor

• **new SpaceportSDK**(`config`): [`SpaceportSDK`](./spaceport-sdk)

#### Parameters

| Name     | Type                                           |
| :------- | :--------------------------------------------- |
| `config` | [`SpaceportConfig`](../types/spaceport-config) |

#### Returns

[`SpaceportSDK`](./spaceport-sdk)

## Methods

### create

▸ **create**(`config?`): [`SpaceportSDK`](./spaceport-sdk)

Create an instance of SpaceportClient

#### Parameters

| Name     | Type                                           | Description                    |
| :------- | :--------------------------------------------- | :----------------------------- |
| `config` | [`SpaceportConfig`](../types/spaceport-config) | Optional configuration options |

#### Returns

[`SpaceportSDK`](./spaceport-sdk)

A new instance of SpaceportClient

### createWithWallet

▸ **createWithWallet**(`ethereum`, `config?`): [`SpaceportSDK`](./spaceport-sdk)

Create a new SDK instance with a wallet

#### Parameters

| Name       | Type                                                                | Description                                |
| :--------- | :------------------------------------------------------------------ | :----------------------------------------- |
| `ethereum` | [`EthereumProvider`](../types/ethereum-provider)                    | Ethereum provider (e.g., window\.ethereum) |
| `config`   | `Omit`\<[`SpaceportConfig`](../types/spaceport-config), `"wallet"`> | Additional SDK configuration               |

#### Returns

[`SpaceportSDK`](./spaceport-sdk)

### createWithAccount

▸ **createWithAccount**(`account`, `config?`): [`SpaceportSDK`](./spaceport-sdk)

Create a new SDK instance with a specific account

#### Parameters

| Name      | Type                                                                 | Description                                                                        |
| :-------- | :------------------------------------------------------------------- | :--------------------------------------------------------------------------------- |
| `account` | `undefined` \| \`0x\$\{string}\` \| `Account`                        | Ethereum account address or Viem Account object created with privateKeyToAccount() |
| `config`  | `Omit`\<[`SpaceportConfig`](../types/spaceport-config), `"account"`> | Additional SDK configuration                                                       |

#### Returns

[`SpaceportSDK`](./spaceport-sdk)

**`Example`**

```typescript theme={null}
// 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

| Name                 | Type      | Default value | Description                                            |
| :------------------- | :-------- | :------------ | :----------------------------------------------------- |
| `includeContentType` | `boolean` | `true`        | Whether to include Content-Type header (default: true) |

#### Returns

`Record`\<`string`, `string`>

### generateSignatureParams

▸ **generateSignatureParams**(`signerAddress`, `dataToSign`, `primaryType`, `types`): `Promise`\<[`SignatureParams`](../types/signature-params)>

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

| Name            | Type                                                              | Description                                                        |
| :-------------- | :---------------------------------------------------------------- | :----------------------------------------------------------------- |
| `signerAddress` | \`0x\$\{string}\`                                                 | The address performing the signing.                                |
| `dataToSign`    | `Record`\<`string`, `unknown`>                                    | An object containing the data fields specific to the EIP-712 type. |
| `primaryType`   | `string`                                                          | The primary EIP-712 type name (e.g., "\_verifyTokenURI").          |
| `types`         | `Record`\<`string`, \{ `name`: `string` ; `type`: `string`  }\[]> | The EIP-712 type definitions.                                      |

#### Returns

`Promise`\<[`SignatureParams`](../types/signature-params)>

The generated SignatureParams.

### generateDocSignature

▸ **generateDocSignature**(`docURI`): `Promise`\<[`SignatureParams`](../types/signature-params)>

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

| Name     | Type     | Description              |
| :------- | :------- | :----------------------- |
| `docURI` | `string` | The document URI to sign |

#### Returns

`Promise`\<[`SignatureParams`](../types/signature-params)>

The signature params formatted for contract consumption

## Properties

### config

• `Readonly` **config**: [`SpaceportConfig`](../types/spaceport-config)

### publicClient

• `Readonly` **publicClient**: `Object`

### walletClient

• `Optional` `Readonly` **walletClient**: `Object`

### cultura

• `Optional` **cultura**: `CulturaSDK`
