Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DescriptorDataClient

Descriptor Data Client

 const ledger = LedgerClientFactory.create({nodeHost: "https://europe.signum.network"})
 const client = new DescriptorDataClient(ledger);
 const descriptorData = DescriptorDataBuilder
                        .create('ohager')
                        .setType('hum')
                        .setBackground('QmUFc4dyX7TJn5dPxp8CrcDeedoV18owTBUWApYMuF6Koc', 'image/jpeg')
                        .setAvatar('QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR', 'image/gif')
                        .setSocialMediaLinks(['https://somelink.com'])
                        .setDescription('Just a humble dev...')
                        .setHomePage('https://digital-independence.dev')
                        .build();
 const transaction = await client.setAccountDescriptor({
                 descriptorData: DescriptorDataBuilder.create('descriptor').build(),
                senderPublicKey: '497d559d18d989b8....ed2716a4b2121902',
                senderPrivateKey: '**********************************'
                });

A helper class to get Descriptor information from accounts, contracts, assets, and/or aliases. It even resolves Descriptor data from referenced aliases. Furthermore, it helps on updating descriptor data according to SRC44 specifications.

Hierarchy

  • DescriptorDataClient

Index

Constructors

constructor

Methods

getAccountByAlias

  • getAccountByAlias(aliasName: string): Promise<Account | null>

getAssetBranding

  • getAssetBranding(tokenId: string): Promise<Descriptor[]>
  • Branded Assets are constructed indirectly to allow already existing Tokens/Assets to have additional (brand) data. Branded Assets link an alias with SRC44 compliant data checking for identity of issuer and alias owner. Only if those match, the descriptor data is being returned.

    If the token issuer is a contract, then the contracts creator is being used for identity matching Due to the indirection it's possible to have multiple brands.

    See also setAssetBranding

    Parameters

    • tokenId: string

    Returns Promise<Descriptor[]>

    An array of descriptors/brands - can be empty

getContractBranding

  • getContractBranding(contractId: string): Promise<Descriptor[]>

getFromAccount

  • getFromAccount(accountId: string): Promise<Descriptor>

getFromAlias

  • getFromAlias(aliasName: string): Promise<Descriptor>

getFromAsset

  • getFromAsset(assetId: string): Promise<Descriptor>
  • Gets the descriptor data from an asset/token. It also resolved referenced alias descriptor

    Asset descriptions are immutable and can be set only on issuance. As this client does not issue assets, no setters/updaters are provided

    Parameters

    • assetId: string

      The token/asset id

    Returns Promise<Descriptor>

    The fetched Descriptor data. It might throw exceptions if it has no compatible data.

getFromContract

  • getFromContract(contractId: string): Promise<Descriptor>
  • Gets the descriptor data from a contract. It also resolved referenced alias descriptor

    Contract descriptions are immutable and can be set only on contract deployment. As this client does not deploy contracts, no setters/updaters for contracts are provided

    Parameters

    • contractId: string

      The contract id

    Returns Promise<Descriptor>

    The fetched Descriptor data. It might throw exceptions if it has no compatible data.

setAccountDescriptor

setAliasDescriptor

setAssetBranding

setContractBranding