From e295b8de3682da9d21b2b8d6c88cb8ca24078d21 Mon Sep 17 00:00:00 2001 From: 0xmuralik Date: Tue, 27 Dec 2022 12:17:02 +0530 Subject: [PATCH] to byte array --- src/account.ts | 4 ++++ src/messages/registry.ts | 9 +++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/account.ts b/src/account.ts index 070f4f2..f0e929e 100644 --- a/src/account.ts +++ b/src/account.ts @@ -166,6 +166,10 @@ export class Account { assert(message); const eipMessageDomain: any = message.eipToSign.domain; + if(message.eipToSign.message.msgs[0].value.payload!=null){ + message.eipToSign.message.msgs[0].value.payload.record.attributes.value=Array.from(message.eipToSign.message.msgs[0].value.payload.record.attributes.value) + } + const signature = signTypedData({ data: { types: message.eipToSign.types as MessageTypes, diff --git a/src/messages/registry.ts b/src/messages/registry.ts index 44faf95..7ad4a32 100644 --- a/src/messages/registry.ts +++ b/src/messages/registry.ts @@ -44,14 +44,11 @@ const MSG_SET_RECORD_TYPES = { { name: 'create_time', type: 'string' }, { name: 'expiry_time', type: 'string' }, { name: 'deleted', type: 'bool' }, - { name: 'attributes', type: 'string' }, + { name: 'attributes', type: 'TypePayloadRecordAttributes' }, ], TypePayloadRecordAttributes: [ - { name: 'url', type: 'string' }, - { name: 'repo_registration_record_cid', type: 'string' }, - { name: 'build_artifact_cid', type: 'string' }, - { name: 'tls_cert_cid', type: 'string' }, - { name: 'type', type: 'string' }, + { name: 'type_url', type: 'string' }, + { name: 'value', type: 'uint8[]' }, ], TypePayloadSignatures: [ { name: 'sig', type: 'string' },