From 502c8fb0795986b0a488ad3684c1c23f0b807a40 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 12 Dec 2023 14:40:53 -0500 Subject: [PATCH] fix: need to strip off multiformats prefix --- src/methods/registry.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/methods/registry.ts b/src/methods/registry.ts index ff8a772..400b7b6 100644 --- a/src/methods/registry.ts +++ b/src/methods/registry.ts @@ -90,6 +90,8 @@ export async function subscribeToEntry( }; } +const base64urlEncode = (d: Uint8Array) => base64url.encode(d).substring(1); + export async function publishEntry( this: S5Client, signedEntry: SignedRegistryEntry, @@ -115,10 +117,10 @@ export async function publishEntry( endpointPath: opts.endpointPublishEntry, method: "post", data: { - pk: base64url.encode(signedEntry.pk), + pk: base64urlEncode(signedEntry.pk), revision: signedEntry.revision, - data: base64url.encode(signedEntry.data), - signature: base64url.encode(signedEntry.signature), + data: base64urlEncode(signedEntry.data), + signature: base64urlEncode(signedEntry.signature), }, }); }