mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-07-25 11:11:26 +00:00
add avatar
This commit is contained in:
@@ -152,6 +152,24 @@ export const publishGroupEncryptedResource = async ({encryptedData, identifier})
|
||||
throw new Error(error.message);
|
||||
}
|
||||
}
|
||||
export const publishOnQDN = async ({data, identifier, service}) => {
|
||||
try {
|
||||
|
||||
if(data && identifier && service){
|
||||
const registeredName = await getNameInfo()
|
||||
if(!registeredName) throw new Error('You need a name to publish')
|
||||
const res = await publishData({
|
||||
registeredName, file: data, service, identifier, uploadType: 'file', isBase64: true, withFee: true
|
||||
})
|
||||
return res
|
||||
|
||||
} else {
|
||||
throw new Error('Cannot encrypt content')
|
||||
}
|
||||
} catch (error: any) {
|
||||
throw new Error(error.message);
|
||||
}
|
||||
}
|
||||
|
||||
export function uint8ArrayToBase64(uint8Array: any) {
|
||||
const length = uint8Array.length
|
||||
|
Reference in New Issue
Block a user