LSP2ERC725YJSONSchema
decodeAssetUrl
▸ decodeAssetUrl(assetUrlValue
): Object
Decode a JSONURL value content.
Parameters
Name | Type | Description |
---|---|---|
assetUrlValue | BytesLike | The encoded value as { "valueContent": "ASSETURL" } . |
Returns
Object
{
// The hash digest of the function used to hash the JSON file.
"hashFunction": "string"
// the hashed bytes value of the JSON file.
"json": "string"
// The URL where the JSON file is hosted.
"url": "string"
}
Name | Type |
---|---|
hash | string |
hashFunction | string |
url | string |
Since
v0.0.1
Throws
When assetUrlValue
his composed of less than 36 bytes.
See
https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-2-ERC725YJSONSchema.md
Example
decodeAssetUrl("0x6f357c6a2a04850096912391bbb0966a624519e8f5d797df2a2c47425e892c25e00c053568747470733a2f2f676f6f676c652e636f6d2f") =>
{
hashFunction: "0x6f357c6a",
hash: "0x2a04850096912391bbb0966a624519e8f5d797df2a2c47425e892c25e00c0535",
url: "https://google.com/"
}
Defined in
LSP2ERC725YJSONSchema/decodeAssetUrl/decodeAssetUrl.ts:35
decodeJsonUrl
▸ decodeJsonUrl(jsonUrlValue
): Object
Decode a JSONURL value content.
Parameters
Name | Type | Description |
---|---|---|
jsonUrlValue | BytesLike | The encoded value as { "valueContent": "JSONURL" } . |
Returns
Object
{
// The hash digest of the function used to hash the JSON file.
"hashFunction": "string"
// the hashed bytes value of the JSON file.
"json": "string"
// The URL where the JSON file is hosted.
"url": "string"
}
Name | Type |
---|---|
hash | string |
hashFunction | string |
url | string |
Since
v0.0.1
Throws
When jsonUrlValue
his composed of less than 36 bytes.
See
https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-2-ERC725YJSONSchema.md
Example
decodeJsonUrl("0x6f357c6a4dade694d7dd4081f46073e99ce898a9b53cf6988452904de7db5cc704a4184968747470733a2f2f676f6f676c652e636f6d2f") =>
{
hashFunction: "0x6f357c6a",
hash: "0x4dade694d7dd4081f46073e99ce898a9b53cf6988452904de7db5cc704a41849",
url: "https://google.com/"
}
Defined in
LSP2ERC725YJSONSchema/decodeJsonUrl/decodeJsonUrl.ts:35