EluvioLive

EluvioLive is an application platform built on top of the Eluvio Content Fabric. It provides a consumer-facing marketplace for digital content: live performances, digital collectibles, etc.

This SDK provides tools for working with EluvioLive APIs and services.

Constructor

new EluvioLive({
configUrl,
mainObjectId
})
EluvioLive

Instantiate the EluvioLive SDK

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

The Content Fabric configuration URL

mainObjectId string

The top-level Eluvio Live object ID

Source:

Methods

async ASNFTRedeemOffer({
addr,
offerId
})

Redeem an nft offer using the Authority Service

Parameters:
Name Type Description
addr string

The NFT contract address

offerId string

The Offer ID

Source:

async AccountShow()

Show info about this account.

Source:

async AddMinter({
addr,
mintAddr
})

Add a minter to NFT or ElvToken

Parameters:
Name Type Description
addr string

The NFT/ElvToken contract address

mintAddr string

The address of the minter (key or helper contract)

Source:

async AdminHealth({host}) → Promise.<Object>

Get Admin API status from Authority Service

Returns: The API Response for the adm/health api
Parameters:
Name Type Description
host string

Authority Service url (Optional)

Source:

async AsNftTransfer({
addr,
tokenId
})
→ Promise.<Object>

Transfer the specified NFT token as the owner using Authority Service

Returns: NFT info JSON
Parameters:
Name Type Description
addr string

Local NFT contract address

tokenId integer

External NFT token ID

Source:

async CheckIsOwner({
addr,
tokenId
})

Checks if the current signer address owns the NFT token. Throws error if not owner.

Parameters:
Name Type Description
addr string

Local NFT contract address

tokenId integer

External NFT token ID

Source:

async ContentClearPolicy({objectId})

Get the content object policy from the Object metadata and the delegate from the Object's contract meta

Parameters:
Name Type Description
objectId string

The NFT object ID

Source:

async ContentGetPolicy({objectId})

Get the content object policy from the Object metadata and the delegate from the Object's contract meta

Parameters:
Name Type Description
objectId string

The NFT object ID

Source:

async ContentSetPolicy({
objectId,
policyPath,
data
})

Sets the content object policy

Parameters:
Name Type Description
objectId string

The NFT object ID

policyPath string

Path to the content policy file (eg. policy.yaml).

data string

Metadata path within the policy object to link to

Source:

async ContentSetPolicyDelegate({
objectId,
delegateId
})

Sets the content object policy

Parameters:
Name Type Description
objectId string

The NFT object ID

delegateId string

Path to the content policy file (eg. policy.yaml).

Source:

async CreateNftContract({
tenantId,
minterAddr,
mintHelperAddr,
collectionName,
collectionSymbol,
contractUri,
proxyAddress,
totalSupply,
hold
})
→ Promise.<Object>

Create a new NFT contract (ElvTradable, ERC-721-based) and set it up for this tenant

  • create a new contract
  • add minter
  • add NFT address to tenant 'tenant_nfts' group

TODO: preflight - ensure signer is a tenant admin

Returns: New contract address
Parameters:
Name Type Description
tenantId string

The tenant ID

minterAddr string

Address of the minter (hex format) (Optional, Default uses tenant minter config)

mintHelperAddr string

Address of the mint helper (hex format) (Optional, Default uses tenant minter config)

collectionName string

Short name for the ERC-721 contract

collectionSymbol string

Short string for the ERC-721 contract

contractUri string

URI for the ERC-721 contract

proxyAddress string

Proxy address for the ERC721 contract (Optional, Default uses tenant minter config)

totalSupply number

the mint cap for this template (should be called 'cap')

hold number

the hold period (seconds)

Source:

async CreateNftTransferProxy({}) → Promise.<Object>

Create a new NFT TransferProxy contract

Returns: New contract address
Source:

async CreateWalletAccount({
email,
tenant,
callbackUrl,
onlyCreateAccount,
onlySendEmail,
scheduleAt
})
→ Promise.<Object>

create account for tenant

Returns: The API Response containing created account info
Parameters:
Name Type Description
email string

The email to create, or @filename to read a list of emails from file

tenant string

The Tenant ID

callbackUrl string

The base URL info for the link in the email

onlyCreateAccount boolean

only create the account

onlySendEmail boolean

only send email, do not create the account

scheduleAt string

when to schedule the email

Source:

async Domains() → Promise.<Object>

Get the list of domains from the Main Live Object info/domains_map

Returns: List of domain objects
Source:

async FabricTenantBalanceOf({
objectId,
ownerAddr
})
→ Promise.<Object>

Get a list of the NFTs of this tenant owned by 'ownerAddr'

Returns: Number of tokens owned
Parameters:
Name Type Description
objectId string

The ID of the tenant specific EluvioLive object

ownerAddr string

A user address to check the balance of

Source:

async IsMinter({
addr,
mintAddr
})

check if minter to NFT or ElvToken

Parameters:
Name Type Description
addr string

The NFT/ElvToken contract address

mintAddr string

The address of the minter (key or helper contract)

Source:

async List({
tenantId,
tenantSlug
})
→ Promise.<Object>

Get the list of Tenant marketplaces/sites from the Main Live Object No Tenant ID or Tenant Slug will return all tenants.

Returns: List or single Tenant Info
Parameters:
Name Type Description
tenantId string

The Tenant ID (Optional).

tenantSlug string

The Tenant ID (Optional). No Tenant ID will return all tenants.

Source:

async NFTAddRedeemableOffer({addr})

Add a redeemable offer to the NFT contract

Parameters:
Name Type Description
addr string

The NFT contract address

Source:

async NFTIsOfferActive({
addr,
offerId
})

Returns true if offer is active (has not been removed)

Parameters:
Name Type Description
addr string

The NFT contract address

offerId string

The Offer ID

Source:

async NFTIsOfferRedeemed({
addr,
offerId
})

Returns true if offer is redeemed

Parameters:
Name Type Description
addr string

The NFT contract address

offerId string

The Offer ID

Source:

async NFTRedeemOffer({
addr,
offerId
})

Redeem an nft offer using the contract directly

Parameters:
Name Type Description
addr string

The NFT contract address

offerId string

The Offer ID

Source:

async NFTRefresh({
tenant,
maxNumber
})
→ Promise.<Object>

Synchronize backend listings with fabric metadata for a specific tenant's NFT

Returns: The API Response containing list of Wallet Info
Parameters:
Name Type Description
tenant string

The Tenant ID

maxNumber integer

The address to mint to

Source:

async NFTRemoveRedeemableOffer({addr})

Remove a redeemable offer from the NFT contract

Parameters:
Name Type Description
addr string

The NFT contract address

Source:

async NftBalanceOf({
addr,
ownerAddr
})
→ Promise.<Object>

Get the NFT balance for a given user address

Returns: Number of tokens owned
Parameters:
Name Type Description
addr string

The NFT contract address

ownerAddr string

A user address to check the balance of

Source:

async NftBuild({
library,
hash,
nftDir
})
→ Promise.<Object>

Set the public/nft section based on asset metadata

For generative NFTs we use the following convention - nftDir must contain: One or more json files with a '.json' extension (for example: nft001.json, nft002.json) Example JSON File:

{ "count":3, (OPTIONAL, Default: 1) "name": "Example NFT", (OPTIONAL, Default: from Content Object) "display_name": "Example NFT", (OPTIONAL, Default: from Content Object) "description" : "This is an example NFT.", (OPTIONAL, Default: from Content Object) "rich_text" : "", (OPTIONAL, Default: from Content Object) "image": "https://image003", "embed_url":"https://videoURL003", "attributes:": [ { "trait_type":"trait01", "value": "test1", "rarity": 0.2 (OPTIONAL, If not present, it will be calculated) } ] }

The 'count' is an optional parameter to generate copies of this nft element inside the /public/nfts array

All other optional keys (name, display_name, description, etc) will override the NFT content object's value from /asset_metadata/nft if present.

The required key 'attributes' is an array of objects {"trait_type": "", "value": ""} and is used to calculate trait rarity. If rarity is already present in the attribute, it will be used instead.

Returns: The public/nft or public/nfts JSON
Parameters:
Name Type Description
library string

ID

hash string

The NFT Template hash or id

nftDir string

Directory containing nft json file(s) for building nfts

Source:

async NftBurn({
addr,
tokenId
})
→ Promise.<Object>

Burn the specified NFT token as the owner

Returns: NFT info JSON
Parameters:
Name Type Description
addr string

Local NFT contract address

tokenId integer

External NFT token ID

Source:

async NftGetPolicyAndPermissions({nftAddress}) → object

Gets the nft policy and permissions for a given contract

Returns:

object containing the policy string and the list of addresses from nft metadata

Parameters:
Name Type Description
nftAddress string

The NFT contract address. Can also be iqXXX format.

Source:

async NftGetTransferFee({address}) → string

Gets the baseTransferFee of the NFT Contract

Returns: The fee as a big number sring
Parameters:
Name Type Description
address string

The NFT contract address

Source:

async NftLookup({
addr,
tokenId
})
→ Promise.<Object>

Set the public/nft section based on asset metadata

Returns: NFT info JSON
Parameters:
Name Type Description
addr string

Local NFT contract address

tokenId integer

External NFT token ID

Source:

async NftMake({assetMetadata}) → Promise.<Object>

Make the public/nft section based on asset metadata Prerequisites:

  • NFT contract set
Returns: The public/nft JSON
Parameters:
Name Type Description
assetMetadata Object

The NFT Template asset metadata

Source:

async NftMakeGenerative({
assetMetadata,
hash,
imagePath,
attrs,
rarity
})
→ Promise.<Object>

Make a single element of the public/nfts section of a generative, multi image/video token based on asset metadata and input parameters. The public/nfts key is an array of objects, each equivalent to the single NFT public/nft section.

Prerequisites:

  • NFT contract set
Returns: The public/nfts JSON array element
Parameters:
Name Type Description
assetMetadata Object

The NFT Template asset metadata

hash string

NFT Template hash

imagePath string

Local file path to the image

attrs Object

Extra attributes for this token

rarity Object

Stats for each trait and value

Source:

async NftPackGetDist({versionHash}) → object

Pack - retrieve pack spec and pack distribtion from an NFT Template using authd tenant-authenticated pack APIs. The spec and distribition are saved in JSON files.

Returns: file names where spec and dist are saved
Parameters:
Name Type Description
versionHash string

NFT Template object hash

Source:

async NftPackSetDist({versionHash}) → Promise.<Object>

Pack - set a previously created pack distribution in pack object metadata

Returns: The new object info
Parameters:
Name Type Description
versionHash string

NFT Template content hash

Source:

async NftProxyBurn({
addr,
tokenId
})
→ Promise.<Object>

Burn the specified NFT token as a proxy owner

Returns: NFT info JSON
Parameters:
Name Type Description
addr string

Local NFT contract address

tokenId integer

External NFT token ID

Source:

async NftProxyTransferFrom({
addr,
fromAddr,
toAddr,
tokenId
})
→ Promise.<Object>

Transfer an NFT as a proxy owner.

Returns: ?
Parameters:
Name Type Description
addr string

The NFT contract address

fromAddr string

The current owner of the token

toAddr string

A user address to tranfer to

tokenId integer

The token ID

Source:

async NftSetPolicyAndPermissions({
objectId,
policyPath,
addresses,
clearAddressesoptional
})

Sets the nft policy and permissions for a given object throws error if something goes wrong.

Parameters:
Name Type Attributes Default Description
objectId string

The NFT object ID

policyPath string

Path to the policy file (eg. nft_owner_minter.yaml). Note that the policy must contain the minter address

addresses Array.<string>

Array of addresses to set the policy permissions

clearAddresses boolean <optional>
false

Clear existing permissions by writing an empty address list before applying the new ones

Source:

async NftSetTransferFee({
address,
fee
})
→ Promise.<Object>

Sets the baseTransferFee of the NFT Contract

Returns: The Contract transaction logs
Parameters:
Name Type Description
address string

The NFT contract address

fee string

Fee in ETH to set as a big number string

Source:

async NftSetTransferProxy({
addr,
proxyAddress
})
→ Promise.<Object>

Set a TransferProxy for this NFT contract. If no proxy address is specified, create a new one. Must be run as the NFT contract owner.

Returns: New contract address
Parameters:
Name Type Description
addr string

The NFT Transfer Proxy contract address

proxyAddress string

The address of the proxy contract (optional)

Source:

async NftShow({
addr,
mintHelper,
minter,
proxyAddr,
showOwners,
showOwnersViaContract,
includeEmail,
tokenId
})
→ Promise.<Object>

Show info about this NFT

Returns: An object containing NFT info, including 'warnings'
Parameters:
Name Type Description
addr string

The NFT contract address

mintHelper string

Warn if this is not a minter for the NFT contract (hex)

minter string

Warn if this is not the owner of the mint helper contract (hex)

proxyAddr string

proxy owner address

showOwners integer

Enumerate all token owners using a fast indexed query. Only used if tokenId is undefined.

showOwnersViaContract integer

Enumerate all token info up to the given amount. Only used if tokenId is undefined.

includeEmail string

Include email address for owners, as bound to the given tenant ID. Only used if tokenId is undefined.

tokenId integer

The token ID to show info for. This will take precedence over showOwners

Source:

async NftShowToken({
addr,
tokenId
})
→ Promise.<Object>

Show info on one token in the NFT contract

Returns: An object containing token info, including 'warnings'
Parameters:
Name Type Description
addr string

The NFT contract address

tokenId integer

The token ID

Source:

async NftTemplateAddNftContract({
objectId,
nftAddr,
collectionName,
collectionSymbol,
hold,
contractUri,
totalSupply
})
→ Promise.<Object>

Create a new NFT contract and set it in the NFT Template object's metadata.

Returns: An object containing info about the new NFT
Parameters:
Name Type Description
objectId string

The ID of the NFT Template

nftAddr string

The NFT contract address (optional; by default create one)

collectionName string

Short name for the ERC-721 contract

collectionSymbol string

Short string for the ERC-721 contract

hold string

Hold period in seconds

contractUri string

URI for the ERC-721 contract

totalSupply string

the mint cap for this template (should be called 'cap')

Source:

async NftTransfer({
addr,
tokenId
})
→ Promise.<Object>

Transfer the specified NFT token as the owner through contract

Returns: NFT info JSON
Parameters:
Name Type Description
addr string

Local NFT contract address

tokenId integer

External NFT token ID

Source:

async RenounceMinter()

Renounce the minter(msg.sender) from NFT or ElvToken

Source:

async ShowMintHelper({addr}) → Promise.<Object>

Show NFT mint helper info

Returns: Mint helper info object
Parameters:
Name Type Description
addr string

The mint helper contract address

Source:

async ShowNftTransferProxy({addr}) → Promise.<Object>

Show NFT Transfer Proxy info

Returns: Proxy info object
Parameters:
Name Type Description
addr string

The NFT Transfer Proxy contract address

Source:

async SiteSetDrop({
libraryId,
objectId,
uuid,
start,
end,
endVote,
startMint,
newUuid,
update
})
→ Promise.<Object>

Set start dates for a drop event (all stages)

Returns: An object containing new drop info
Parameters:
Name Type Description
libraryId string

The 'properties' library ID

objectId string

The ID of the site object

uuid string

UUID of the drop (a site may contain multiple)

start string

the start date of the event

end string

the end date of the event (optional)

endVote string

the start date of the post vote stage (optional)

startMint string

the start date of the mint stage (optional)

newUuid boolean

create a new UUID for the drop (optional)

update string

Tenant-level EluvioLive object ID, to update

Source:

async SiteShow({
libraryId,
objectId
})
→ Promise.<Object>

Show info about this site (event)

Returns: An object containing site info, including 'warnings'
Parameters:
Name Type Description
libraryId string

The 'properties' library ID

objectId string

The ID of the site object

Source:

async TenantAddNft({
tenantId,
nftAddr
})

Add an NFT contract to the tenant's 'tenant_nfts' group

Parameters:
Name Type Description
tenantId string

The ID of the tenant (iten***)

nftAddr string

= The address of the NFT contract (hex format)

Source:

async TenantBalanceOf({
tenantId,
ownerAddr,
maxNumber
})
→ Promise.<Object>

Get a list of the NFTs of this tenant owned by 'ownerAddr'

Returns: Number of tokens owned
Parameters:
Name Type Description
tenantId string

The ID of the tenant (iten***)

ownerAddr string

A user address to check the balance of

maxNumber integer

Max number of NFTs returned

Source:

async TenantCreateMinterConfig({tenant}) → Promise.<Object>

Create minter configuration using the authority service

Returns: The API Response for the request
Parameters:
Name Type Description
tenant string

The Tenant ID

Source:

async TenantDeleteMinterConfig({tenant}) → Promise.<Object>

Delete minter configuration using the authority service

Returns: The API Response for the request
Parameters:
Name Type Description
tenant string

The Tenant ID

Source:

async TenantDeployHelperContracts({tenant}) → Promise.<Object>

Deploy minter helper contract using the authority service

Returns: The API Response for the request
Parameters:
Name Type Description
tenant string

The Tenant ID

Source:

async TenantGetMinterConfig({tenant}) → Promise.<Object>

Get minter configuration from authority service

Returns: The API Response for the tenant's minter configuration
Parameters:
Name Type Description
tenant string

The Tenant ID

Source:

async TenantGroupInfo()

Show group info about this tenant.

Source:

async TenantHasNft({
tenantId,
nftAddr
})

Returns true if an NFT contract is in the tenant's 'tenant_nfts' group

Parameters:
Name Type Description
tenantId string

The ID of the tenant (iten***)

nftAddr string

= The address of the NFT contract (hex format)

Source:

async TenantMint({
tenant,
marketplace,
sku,
addr
})
→ Promise.<Object>

Mint an NFT using Tenant Auth

Returns: API Response Object
Parameters:
Name Type Description
tenant string

The Tenant ID

marketplace string

Marketplace ID of the NFT

sku string

SKU of the NFTs

addr string

The address to mint to

Source:

async TenantNftList({tenantId})

Returns list of NFT contracts in the tenant's 'tenant_nfts' group

Parameters:
Name Type Description
tenantId string

The ID of the tenant (iten***)

Source:

async TenantPathAuthServiceRequest({
path,
method,
queryParams,
headers
})
→ Promise.<Object>

Authority Service API request using path auth. Typically used for GET and DELETE

Returns: The API Response
Parameters:
Name Type Description
path string

The request endpoint

method string

The rquest method

queryParams Object

The query parameters

headers Object

The headers

Source:

async TenantPrimarySales({
tenant,
marketplace
})
→ Promise.<Object>

Get primary sales history for the tenant

Returns: The API Response containing primary sales info
Parameters:
Name Type Description
tenant string

The Tenant ID

marketplace string

The marketplace ID

Source:

async TenantPublishData({
tenant,
host,
contentHash,
updateLinks,
env
})
→ Promise.<Object>

Submits a new content version hash of this account's Tenant Object for updating to the Eluvio Live Tree.

Returns: The API Response for the request
Parameters:
Name Type Description
tenant string

The Tenant ID

host string

Authority Service url (Optional)

contentHash string

Version hash of the new Tenant Object to submit

updateLinks boolean

True to update links

env string

Environment to update -- "production" or "staging", default production

Source:

async TenantPublishPrivate({
tenant,
host,
env
})
→ Promise.<Object>

Submits info to authd about the existence of a private (non-media-wallet-enabled) tenant. The key reason for this is to allow the tenant to get its DB tables initialized.

Returns: The API Response for the request
Parameters:
Name Type Description
tenant string

The Tenant ID

host string

Authority Service url (Optional)

env string

Environment to update -- "production" or "staging", default production

Source:

async TenantRemoveNft({
tenantId,
nftAddr
})

Remove an NFT contract from the tenant's 'tenant_nfts' group

Parameters:
Name Type Description
tenantId string

The ID of the tenant (iten***)

nftAddr string

= The address of the NFT contract (hex format)

Source:

async TenantReplaceMinterConfig({tenant}) → Promise.<Object>

Replaces minter configuration using the authority service

Returns: The API Response for the request
Parameters:
Name Type Description
tenant string

The Tenant ID

Source:

async TenantSecondarySales({tenant}) → Promise.<Object>

Get secondary sales history for the tenant

Returns: The API Response containing primary sales info
Parameters:
Name Type Description
tenant string

The Tenant ID

Source:

async TenantSessionsCsv({
tenant,
start_ts,
end_ts
})
→ Promise.<Object>

Fetch session data from the analytics API for a tenant

Returns: The API Response containing session csv info
Parameters:
Name Type Description
tenant string

The Tenant ID

start_ts int

Start timestamp in seconds since epoch

end_ts int

End timestamp in seconds since epoch

Source:

async TenantSetTokenURI({
requestType,
tenantId,
contractAddress,
tokenURI,
tokenId,
host,
csv
})
→ Promise.<Object>

Set the Token URI for an NFT. Currently only setting one and a time. Will support types, single, batch and all.

Returns: An object containing tenant info, including 'warnings'
Parameters:
Name Type Description
requestType string

The type of request: single, batch, all

tenantId string

The ID of the tenant (iten***)

contractAddress string

The NFT contract address

tokenURI string

The new token URI

tokenId int

The NFT token ID

host string

The host to use for the request, undefined to use config

csv string

The CSV file to use for the request, undefined to use config

Source:

async TenantShow({tenantId}) → Promise.<Object>

Show info about this tenant. Currently only listing NFT marketplaces.

Returns: An object containing tenant info, including 'warnings'
Parameters:
Name Type Description
tenantId string

The ID of the tenant (iten***)

Source:

async TenantTicketsGenerate({
tenant,
otp,
otpClass,
quantity,
emails,
embedUrlBase
})
→ Promise.<Object>

Generate tickets (NTP) as a tenant.

Tickets may be bound to emails - in this case, the list of emails has to be supplied as an argument, and the 'quantity' is no longer allowed.

Note that technically tickets can be bound to any user identifier. Emails are the most common but other IDs such as usernames or oauth/openid subject IDs are also used, so there is no required format for the strings in the file.

Optionally creates embed URLs for each ticket code generated, based on a template URL that contains all required embed URL parameters except for the ticket and optionally email.

Returns: Tickets API Response Object
Parameters:
Name Type Description
tenant string

The Tenant ID

otp string

The OTP ID

otpClass integer

The OTP class (4 or 5) (default 5)

quantity integer

Number of tickets to generate

emails string

File containing one email per line

embedUrlBase string

Base embed URL, used to generate embed URLs for each ticket

Source:

async TenantTransferFailures({tenant}) → Promise.<Object>

Get failed transfer report for the tenant. Used to identify payments collected on failed transfers.

Returns: The API Response containing the failed transfers report
Parameters:
Name Type Description
tenant string

The Tenant ID

Source:

async TenantUnifiedSales({tenant}) → Promise.<Object>

Get unified primary&secondary sales history for the tenant

Returns: The API Response containing primary sales info
Parameters:
Name Type Description
tenant string

The Tenant ID

Source:

async TenantUpdateTokenURI({
tenantId,
contractAddress,
hash,
dryRun
})
→ Promise.<Object>

Update all token URIs for a given contract to the new hash provided as argument.

Returns: An object containing operation result
Parameters:
Name Type Description
tenantId string

Tenant ID (iten format)

contractAddress string

The NFT contract address

hash string

The new NFT template object hash

dryRun bool

Dry run flag (default 'true')

Source:

async TenantWallets({
tenant,
maxNumber
})
→ Promise.<Object>

Get the list of wallets bound by the Tenant

Returns: The API Response containing list of Wallet Info
Parameters:
Name Type Description
tenant string

The Tenant ID

maxNumber integer

The address to mint to

Source:

async readNftDir({nftDir}) → Promise.<Object>

Read image and attributes info from a directory

Required format:

  • the directory should contain a list of '*.json' files (flat, not in a hierarchy) Returns an array of objects containing:
  • imgFile - file name (no path)
  • imgFilePath - full path to source file
  • attrs - attributes object (optional)
Returns: The 'images' object and calculated rarity
Parameters:
Name Type Description
nftDir string

the directory containing the nft json files

Source: