diff --git a/src/services/service.ts b/src/services/service.ts index fbca8fe..6c5b269 100755 --- a/src/services/service.ts +++ b/src/services/service.ts @@ -557,7 +557,7 @@ export default class Services { notes: [], ...folderData, }; - const ownerRoleFields = [Object.keys(privateData), 'roles']; + const ownerRoleFields = [...Object.keys(privateData), 'roles']; const stakeholdersRoleFields = ['documents', 'notes']; const roles: Record = { @@ -599,7 +599,7 @@ export default class Services { await this.getTokensFromFaucet(); try { - return this.getProcess( + return this.createProcess( privateData, {}, roles @@ -1695,6 +1695,12 @@ export default class Services { } public hexToBlob(hexString: string): Blob { + const uint8Array = this.hexToUInt8Array(hexString); + + return new Blob([uint8Array], { type: "application/octet-stream" }); + } + + public hexToUInt8Array(hexString: string): Uint8Array { if (hexString.length % 2 !== 0) { throw new Error("Invalid hex string: length must be even"); } @@ -1703,7 +1709,7 @@ export default class Services { uint8Array[i / 2] = parseInt(hexString.substr(i, 2), 16); } - return new Blob([uint8Array], { type: "application/octet-stream" }); + return uint8Array; } public async blobToHex(blob: Blob): Promise {