ElvTenant

Provides tenant administration operations on the Eluvio Content Fabric: managing access groups (tenant admins, content admins, tenant users), configuring faucet funding and sharing keys, and setting tenant status.

Constructor

new ElvTenant({
configUrl,
debugLoggingoptional
})
ElvTenant

Instantiate the ElvTenant object

Returns: New ElvTenant object connected to the specified content fabric and blockchain
Parameters:
Name Type Attributes Default Description
configUrl string

The Content Fabric configuration URL

debugLogging boolean <optional>
false

Enable verbose debug logging

Source:

Methods

async Init({privateKey})

Initialize the ElvTenant SDK with the provided private key.

Parameters:
Name Type Description
privateKey string

Hex-encoded private key for the signing account

Source:

async TenantCheckGroupConfig({
tenantId,
groupAddr,
tenantOwner
})
→ Promise.<Object>

Verify that an access group is correctly associated with the given tenant. Checks ownership, contract type, and tenant ID via contract metadata, the tenant contract field, and fabric object metadata (in that order).

Returns:

Object with success boolean, optional message and need_format fields

Parameters:
Name Type Description
tenantId string

Tenant ID (iten***)

groupAddr string

Address of the access group to verify

tenantOwner string

Expected owner address of the tenant contract

Source:

async TenantContentAdminGroup({tenantId}) → Promise.<string>

Retrieve the address of the content admins group registered on the tenant contract.

Returns:

Address of the content admins group

Parameters:
Name Type Description
tenantId string

Tenant ID (iten***)

Source:

async TenantCreateFaucetAndFund({
asUrl,
tenantId,
amountoptional,
noFundsoptional
})
→ Promise.<Object>

Create (or retrieve) a faucet funding address for the tenant via the authority service, then optionally transfer ELV from the current account to fund it.

Returns:

Result including faucet config and optional amount_transferred / current_balance

Parameters:
Name Type Attributes Default Description
asUrl string

Authority service base URL

tenantId string

Tenant ID (iten***)

amount number <optional>
20

Amount of ELV to transfer to the faucet funding address

noFunds boolean <optional>
false

Create the faucet address without transferring funds

Source:

async TenantCreateSharingKey({
asUrl,
tenantId
})
→ Promise.<Object>

Create a sharing key for the tenant via the authority service and add the resulting signing address to the tenant's content admins group.

Returns:

Result including sharing key info from the authority service

Parameters:
Name Type Description
asUrl string

Authority service base URL

tenantId string

Tenant ID (iten***)

Source:

async TenantDeleteFaucet({
asUrl,
tenantId
})
→ Promise.<void>

Delete the faucet funding configuration for a tenant via the authority service.

Parameters:
Name Type Description
asUrl string

Authority service base URL

tenantId string

Tenant ID (iten***)

Source:

async TenantFundUser({
asUrl,
tenantId,
userAddress
})
→ Promise.<Object>

Fund a user wallet address via the tenant's faucet. The user's balance must be below the faucet's configured per_top_up_limit, and the request is signed with the tenant's multi-sig token.

Returns:

Faucet fund response from the authority service

Parameters:
Name Type Description
asUrl string

Authority service base URL

tenantId string

Tenant ID (iten***)

userAddress string

Ethereum address of the user to fund

Source:

async TenantGetFaucet({
asUrl,
tenantId
})
→ Promise.<Object>

Retrieve the faucet funding configuration for a tenant from the authority service.

Returns:

Faucet configuration object from the authority service

Parameters:
Name Type Description
asUrl string

Authority service base URL

tenantId string

Tenant ID (iten***)

Source:

async TenantGetSharingKey({
asUrl,
tenantId
})
→ Promise.<Object>

Retrieve the sharing key configuration for a tenant from the authority service. The request is signed with the tenant's multi-sig token.

Returns:

Sharing key configuration from the authority service

Parameters:
Name Type Description
asUrl string

Authority service base URL

tenantId string

Tenant ID (iten***)

Source:

async TenantInfo(tenantId)

Get tenant-level information

Parameters:
Name Type Description
tenantId string

Tenant ID (iten)

Source:

async TenantRemoveContentAdmin(
tenantId,
contentAdminsAddress
)

Remove a content admin from this tenant.

Parameters:
Name Type Description
tenantId string

The ID of the tenant (iten***)

contentAdminsAddress string

Address of content admin we want to remove.

Source:

async TenantRemoveTenantUsers(
tenantId,
tenantUsersAddress
)

Remove a tenant user group from this tenant.

Parameters:
Name Type Description
tenantId string

The ID of the tenant (iten***)

tenantUsersAddress string

Address of tenant users address we want to remove.

Source:

async TenantSetContentAdmins(
tenantId,
contentAdminAddr
)
→ string

Create a new content admin group corresponding to this tenant.

Returns:

Content Admin Group's address

Parameters:
Name Type Description
tenantId string

The ID of the tenant (iten***)

contentAdminAddr string

Content Admin Group's address, new group will be created if not specified (optional)

Source:

async TenantSetEluvioLiveId(
tenantId,
eluvioLiveId
)

Set the Eluvio Live tenant object ID on the tenant contract.

Parameters:
Name Type Description
tenantId string

Tenant ID (iten)

eluvioLiveId string

Object ID of the tenant-leve Eluvio Live object

Source:

async TenantSetGroupConfig(
tenantId,
groupAddress
)

Associate group with the tenant with tenantId.

Parameters:
Name Type Description
tenantId string

The ID of the tenant (iten***)

groupAddress string

Address of the group we want to remove.

Source:

async TenantSetStatus(
tenantContractId,
tenantStatus
)
→ Promise.<{tenantStatus: string, tenantContractId: string}>

Add tenant status

Parameters:
Name Type Description
tenantContractId string

The ID of the tenant Id (iten***)

tenantStatus string

tenant status: acive | inactive

Source:

async TenantSetTenantUsers(
tenantId,
tenantUsersAddr
)
→ string

Create a new tenant users group corresponding to this tenant.

Returns:

Tenant users Group's address

Parameters:
Name Type Description
tenantId string

The ID of the tenant (iten***)

tenantUsersAddr string

Tenant users Group's address, new group will be created if not specified (optional)

Source:

async TenantShow(
tenantId,
asUrl,
show_metadata
)

Return tenant admins group and content admins group corresponding to this tenant.

Parameters:
Name Type Description
tenantId string

The ID of the tenant (iten***)

asUrl string

authority service URL

show_metadata boolean

Enable retrieving metadata from tenant object

Source:

async TenantStatus(tenantContractId) → Promise.<string>

Retrieve tenant status

Parameters:
Name Type Description
tenantContractId string

The ID of the tenant Id (iten***)

Source: