Skip to main content

Elv Utils

MakeCsv

MakeCsv(
  fields,
  full
)

Create a CSV row with the specified fields with values from the metadata

Returns: string A CSV row

Parameters

NameTypeRequiredDescription
fieldsarray

Array of fields in dot notation eg. ["public.name","public.nfts[0]"]

fullobject

object metadata JOSN

ReadCsvObjects

ReadCsvObjects(csvFile)

Read a CSV file and parse into a JSON object

Applies string substitutions on input:

  • ${UUID}

CSV file format: id,field1,field2 iq_1111,value1,value2 iq_2222,value1,value2

Output format: { "iq_1111" : { "field1": "value1", "field2": "value2" }, "iq_2222" : { "field1": "value1", "field2": "value2" } }

Returns: object Map of object IDs to metadata

Parameters

NameTypeRequiredDescription
csvFilestring

path to CSV file

UpdateFabricUrl

UpdateFabricUrl(
  url,
  newHash
)

Parse a fabric URL of format 'http(s)://host/.../q/hq__.../...' and replace the object hash with the newly provided one.

Parameters

NameTypeRequiredDescription
urlstring
newHashstring

Format 'hq__...'