Skip to main content

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,
  debugLogging // optional
}) → ElvTenant

Instantiate the ElvTenant object

Returns: New ElvTenant object connected to the specified content fabric and blockchain

Parameters

NameTypeRequiredDescription
configUrlstring

The Content Fabric configuration URL

debugLoggingboolean

Enable verbose debug logging

(default: false)

Init

Init({ privateKey })

Initialize the ElvTenant SDK with the provided private key.

Parameters

NameTypeRequiredDescription
privateKeystring

Hex-encoded private key for the signing account

TenantCheckGroupConfig

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

NameTypeRequiredDescription
tenantIdstring

Tenant ID (iten***)

groupAddrstring

Address of the access group to verify

tenantOwnerstring

Expected owner address of the tenant contract

TenantContentAdminGroup

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

NameTypeRequiredDescription
tenantIdstring

Tenant ID (iten***)

TenantCreateFaucetAndFund

TenantCreateFaucetAndFund({
  asUrl,
  tenantId,
  amount, // optional
  noFunds // optional
}) → 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

NameTypeRequiredDescription
asUrlstring

Authority service base URL

tenantIdstring

Tenant ID (iten***)

amountnumber

Amount of ELV to transfer to the faucet funding address

(default: 20)
noFundsboolean

Create the faucet address without transferring funds

(default: false)

TenantCreateSharingKey

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

NameTypeRequiredDescription
asUrlstring

Authority service base URL

tenantIdstring

Tenant ID (iten***)

TenantDeleteFaucet

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

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

Parameters

NameTypeRequiredDescription
asUrlstring

Authority service base URL

tenantIdstring

Tenant ID (iten***)

TenantFundUser

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

NameTypeRequiredDescription
asUrlstring

Authority service base URL

tenantIdstring

Tenant ID (iten***)

userAddressstring

Ethereum address of the user to fund

TenantGetFaucet

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

NameTypeRequiredDescription
asUrlstring

Authority service base URL

tenantIdstring

Tenant ID (iten***)

TenantGetSharingKey

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

NameTypeRequiredDescription
asUrlstring

Authority service base URL

tenantIdstring

Tenant ID (iten***)

TenantInfo

TenantInfo(tenantId)

Get tenant-level information

Parameters

NameTypeRequiredDescription
tenantIdstring

Tenant ID (iten)

TenantRemoveContentAdmin

TenantRemoveContentAdmin(
  tenantId,
  contentAdminsAddress
)

Remove a content admin from this tenant.

Parameters

NameTypeRequiredDescription
tenantIdstring

The ID of the tenant (iten***)

contentAdminsAddressstring

Address of content admin we want to remove.

TenantRemoveTenantUsers

TenantRemoveTenantUsers(
  tenantId,
  tenantUsersAddress
)

Remove a tenant user group from this tenant.

Parameters

NameTypeRequiredDescription
tenantIdstring

The ID of the tenant (iten***)

tenantUsersAddressstring

Address of tenant users address we want to remove.

TenantSetContentAdmins

TenantSetContentAdmins(
  tenantId,
  contentAdminAddr
) → string

Create a new content admin group corresponding to this tenant.

Returns: Content Admin Group's address

Parameters

NameTypeRequiredDescription
tenantIdstring

The ID of the tenant (iten***)

contentAdminAddrstring

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

TenantSetEluvioLiveId

TenantSetEluvioLiveId(
  tenantId,
  eluvioLiveId
)

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

Parameters

NameTypeRequiredDescription
tenantIdstring

Tenant ID (iten)

eluvioLiveIdstring

Object ID of the tenant-leve Eluvio Live object

TenantSetGroupConfig

TenantSetGroupConfig(
  tenantId,
  groupAddress
)

Associate group with the tenant with tenantId.

Parameters

NameTypeRequiredDescription
tenantIdstring

The ID of the tenant (iten***)

groupAddressstring

Address of the group we want to remove.

TenantSetStatus

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

Add tenant status

Parameters

NameTypeRequiredDescription
tenantContractIdstring

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

tenantStatusstring

tenant status: acive | inactive

TenantSetTenantUsers

TenantSetTenantUsers(
  tenantId,
  tenantUsersAddr
) → string

Create a new tenant users group corresponding to this tenant.

Returns: Tenant users Group's address

Parameters

NameTypeRequiredDescription
tenantIdstring

The ID of the tenant (iten***)

tenantUsersAddrstring

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

TenantShow

TenantShow(
  tenantId,
  asUrl,
  show_metadata
)

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

Parameters

NameTypeRequiredDescription
tenantIdstring

The ID of the tenant (iten***)

asUrlstring

authority service URL

show_metadataboolean

Enable retrieving metadata from tenant object

TenantStatus

TenantStatus(tenantContractId) → Promise.<string>

Retrieve tenant status

Parameters

NameTypeRequiredDescription
tenantContractIdstring

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