Methods

(inner) collectRoyaltyForReleaseViaHub(client, releasePublicKey, hubPublicKey) → {Object}

Collects royalties on a releaase via Hub Dashboard.

Parameters:
NameTypeDescription
clientObject

The Nina Client.

releasePublicKeyString

The public key of the Release.

hubPublicKeyString

The public key of the Hub.

Returns:

Hub Release, recipient, paymentMint.

Type: 
Object
Example
const royalty = await NinaClient.Hub.collectRoyaltyForReleaseViaHub(ninaClient, releasePublicKey, hubPublicKey);

(inner) fetch(publicKeyOrHandle, withAccountDataopt)

Fetches a Hub along with its Releases, Collaborators, and Posts.

Parameters:
NameTypeAttributesDefaultDescription
publicKeyOrHandleString

The public key or handle of the Hub account.

withAccountDataBoolean<optional>
false

Include full on-chain Hub, HubRelease, HubPost, HubContent, HubCollaborator, Release, and Post accounts.

Example
const hub = await NinaClient.Hub.fetch('ninas-picks');

(inner) fetchAll(paginationopt, withAccountDataopt)

Fetches all hubs.

Parameters:
NameTypeAttributesDefaultDescription
paginationObject<optional>
{limit: 20, offset: 0, sort: 'desc'}

Pagination options.

withAccountDataBoolean<optional>
false

Include full on-chain Hub accounts.

Example
const hubs = await NinaClient.Hub.fetchAll();

(inner) fetchCollaborator(publicKeyOrHandle, withAccountDataopt)

Fetches a Collaborator by Publickey.

Parameters:
NameTypeAttributesDefaultDescription
publicKeyOrHandleString

The public key or handle of the Hub account.

withAccountDataBoolean<optional>
false

Include full on-chain HubCollaborator accounts.

Example
const collaborators = await NinaClient.Hub.fetchCollaborators('ninas-picks');

(inner) fetchCollaborators(publicKeyOrHandle, withAccountDataopt, paginationopt)

Fetches the Collaborators of a Hub.

Parameters:
NameTypeAttributesDefaultDescription
publicKeyOrHandleString

The public key or handle of the Hub account.

withAccountDataBoolean<optional>
false

Include full on-chain HubCollaborator accounts.

paginationObject<optional>
{limit, offset, sort}

Pagination options.

Example
const collaborators = await NinaClient.Hub.fetchCollaborators('ninas-picks');

(inner) fetchHubPost(publicKeyOrHandle, hubPostPublicKey, withAccountDataopt)

Fetches a hubPost

Parameters:
NameTypeAttributesDefaultDescription
publicKeyOrHandleString

The public key or handle of the Hub.

hubPostPublicKeyString

The public key of the HubPost.

withAccountDataBoolean<optional>
false

Include full on-chain HubPost, HubContent, and Post accounts.

Example
const hubPost = await NinaClient.Hub.fetchHubPost('ninas-picks', 'H2aoAZfxbQX6s77yj31Duy7DiJnJcN3Gg1HkA2VuvNUZ');

(inner) fetchHubRelease(publicKeyOrHandle, hubReleasePublicKey, withAccountDataopt)

Fetches a Release for a Hub.

Parameters:
NameTypeAttributesDefaultDescription
publicKeyOrHandleString

The public key or handle of the Hub.

hubReleasePublicKeyString

The public key of the HubRelease.

withAccountDataBoolean<optional>
false

Include full on-chain HubPost, HubContent, and Post accounts.

Example
const hubRelease = await NinaClient.Hub.fetchHubRelease('ninas-picks', 'H2aoAZfxbQX6s77yj31Duy7DiJnJcN3Gg1HkA2VuvNUZ);

(inner) fetchPosts(publicKeyOrHandle, withAccountDataopt, paginationopt)

Fetches Posts for a hub.

Parameters:
NameTypeAttributesDefaultDescription
publicKeyOrHandleString

The public key or handle of the Hub account.

withAccountDataBoolean<optional>
false

Include full on-chain HubPost, HubContent, and Post accounts.

paginationObject<optional>
{limit, offset, sort}

Pagination options.

Example
const posts = await NinaClient.Hub.fetchPosts('ninas-picks');

(inner) fetchReleases(publicKeyOrHandle, withAccountDataopt, paginationopt)

Fetches Releases for a Hub.

Parameters:
NameTypeAttributesDefaultDescription
publicKeyOrHandleString

The public key or handle of the Hub account.

withAccountDataBoolean<optional>
false

Include full on-chain HubRelease, HubContent, and Release accounts.

paginationObject<optional>
{limit, offset, sort}

Pagination options.

Example
const releases = await NinaClient.Hub.fetchReleases('ninas-picks');

(inner) fetchSubscriptions(publicKeyOrHandle, paginationopt)

Fetches the subscriptions for a Hub.

Parameters:
NameTypeAttributesDefaultDescription
publicKeyOrHandleString

The public key or handle of the Hub account.

paginationObject<optional>
{limit, offset, sort}

Pagination options.

Example
const subscriptions = await NinaClient.Hub.fetchSubscriptions("ninas-picks");

(inner) hubAddCollaborator(client, hubPublicKey, collaboratorPubkey, canAddContent, canAddCollaborator, allowance) → {Object}

Adds a collaborator to a Hub.

Parameters:
NameTypeDescription
clientObject

The NinaClient.

hubPublicKeyString

The public key of the Hub account.

collaboratorPubkeyString

The public key of the collaborator account.

canAddContentBoolean

Boolean indicating if the collaborator can add content to the Hub.

canAddCollaboratorBoolean

Boolean indicating if the collaborator can add collaborators to the Hub.

allowanceInteger

integer indicating the amount of Hub actions the collaborator can execute (-1 for unlimited).

Returns:

Collaborator

Type: 
Object

(inner) hubAddRelease(client, hubPublicKey, releasePublicKey, fromHubopt) → {Object}

Adds a Release to a Hub.

Parameters:
NameTypeAttributesDescription
clientObject

The NinaClient.

hubPublicKeyString
releasePublicKeyString
fromHubString<optional>
Returns:

The Hub Release Data

Type: 
Object

(inner) hubContentToggleVisibility(client, hubPublicKey, contentAccountPublicKey, type) → {Object}

Toggles the visibility of a piece of content on a Hub.

Parameters:
NameTypeDescription
clientObject

The NinaClient.

hubPublicKeyString

Pulic key of the content's Hub.

contentAccountPublicKeyString

Pubkey of the content account.

typeString

Should be either 'Release' or 'Post'.

Returns:

The HubChildPublicKey.

Type: 
Object
Example
const hub = await NinaClient.Hub.hubContentToggleVisibility(ninaClient, hubPublicKey, contentAccountPublicKey, 'Release');

(inner) hubInit(client, hubParams) → {Object}

Initializes a Hub account with Hub Credit.

Parameters:
NameTypeDescription
clientObject

The NinaClient.

hubParamsObject

The Hub parameters. // NOTE: exand

Returns:

The created Hub account.

Type: 
Object
Example
const hub = await NinaClient.Hub.hubInit({})

(inner) hubRemoveCollaborator(client, hubPublicKey, collaboratorPubkey) → {Object}

Removes a collaborator from a Hub.

Parameters:
NameTypeDescription
clientObject

The NinaClient.

hubPublicKeyString
collaboratorPubkeyString
Returns:

Collaborator

Type: 
Object

(inner) hubUpdateCollaboratorPermission(client, hubPublicKey, collaboratorPubkey, canAddContent, canAddCollaborator, allowance) → {Object}

Updates the permissions of a collaborator on a Hub.

Parameters:
NameTypeDescription
clientObject

The NinaClient.

hubPublicKeyString

The public key of the Hub account.

collaboratorPubkeyString

The public key of the collaborator account.

canAddContentBoolean

Boolean indicating if the collaborator can add content to the Hub.

canAddCollaboratorBoolean

Boolean indicating if the collaborator can add collaborators to the Hub.

allowanceInteger

integer indicating the amount of Hub actions the collaborator can execute (-1 for unlimited).

Returns:

Collaborator

Type: 
Object
Example
const hub = await NinaClient.Hub.hubUpdateCollaboratorPermission(hubPublicKey, collaboratorPubkey, true, true, 10, wallet, connection);

(inner) hubUpdateConfig(client, hubPublicKey, uri, publishFee, referralFee) → {Object}

Updates the configuration of a Hub.

Parameters:
NameTypeDescription
clientObject

The NinaClient.

hubPublicKeyString

The public key of the Hub account.

uriString

The URI of the Hubs updated metadata.

publishFeeNumber
referralFeeNumber
Returns:

The updated Hub account.

Type: 
Object
Example
const hub = await NinaClient.Hub.hubUpdateConfig(hubPublicKey, 'https://nina.com', 0.1, 0.1, wallet, connection);

(inner) hubWithdraw(client, hubPublicKey) → {Object}

Withdraws Hub fees in Hub dashboard.

Parameters:
NameTypeDescription
clientObject

The Nina Client.

hubPublicKeyString
Returns:

the Hub Public Key.

Type: 
Object
Example
const txid = await NinaClient.Hub.hubWithdraw(ninaClient, hubPublicKey);

(inner) postInitViaHub(hubPublicKey, slug, uri, referenceReleaseopt, fromHubopt) → {Object}

Creates a Post on a Hub.

Parameters:
NameTypeAttributesDescription
hubPublicKeyString

The public key of the Hub.

slugString

The slug of the Post.

uriString

The URI of the Post.

referenceReleaseString<optional>

The public key of the reference Release.

fromHubString<optional>

The public key of the reference Hub.

Returns:

The Post and Referenced Release Public Key.

Type: 
Object
Example
const post = await NinaClient.Hub.postInitViaHub(ninaClient, hubPublicKey, slug, uri);

(inner) postUpdateViaHub(hubPublicKey, slug, uri, referenceReleaseopt, fromHubopt) → {Object}

Creates a Post on a Hub.

Parameters:
NameTypeAttributesDescription
hubPublicKeyString

The public key of the Hub.

slugString

The slug of the Post.

uriString

The URI of the Post.

referenceReleaseString<optional>

The public key of the reference Release.

fromHubString<optional>

The public key of the reference Hub.

Returns:

The Post.

Type: 
Object
Example
const post = await NinaClient.Hub.postInitViaHub(ninaClient, hubPublicKey, slug, uri);