From 8fb60adb4a668e38c8c4e5a66d4da9e079598d71 Mon Sep 17 00:00:00 2001 From: Mahmoud Aboelenein Date: Wed, 10 Jul 2024 10:49:31 +0300 Subject: [PATCH 1/3] added protocol param to signMessage request --- src/request/types/btcMethods.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/request/types/btcMethods.ts b/src/request/types/btcMethods.ts index 53ec675..54bcb6d 100644 --- a/src/request/types/btcMethods.ts +++ b/src/request/types/btcMethods.ts @@ -75,6 +75,12 @@ export type GetAddresses = MethodParamsAndResult< >; export const signMessageMethodName = 'signMessage'; + +export enum MessageSigningProtocols { + ECDSA = 'ECDSA', + BIP322 = 'BIP322', +} + export const signMessageParamsSchema = v.object({ /** * The address used for signing. @@ -84,6 +90,10 @@ export const signMessageParamsSchema = v.object({ * The message to sign. **/ message: v.string(), + /** + * The protocol to use for signing the message. + */ + protocol: v.optional(v.enum(MessageSigningProtocols)), }); export type SignMessageParams = v.InferOutput; export const signMessageResultSchema = v.object({ @@ -99,6 +109,10 @@ export const signMessageResultSchema = v.object({ * The address used for signing. */ address: v.string(), + /** + * The protocol to use for signing the message. + */ + protocol: v.enum(MessageSigningProtocols), }); export type SignMessageResult = v.InferOutput; export const signMessageRequestMessageSchema = v.object({ From 5508153b8e3e342b1f616ba3f202c2f7a95d5011 Mon Sep 17 00:00:00 2001 From: Mahmoud Aboelenein Date: Fri, 12 Jul 2024 01:46:59 +0300 Subject: [PATCH 2/3] add protocol to legacy signMessage payload --- src/messages/types.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/messages/types.ts b/src/messages/types.ts index 5c4baf2..467fd95 100644 --- a/src/messages/types.ts +++ b/src/messages/types.ts @@ -1,8 +1,10 @@ +import { MessageSigningProtocols } from 'src/request'; import type { RequestOptions, RequestPayload } from '../types'; export interface SignMessagePayload extends RequestPayload { address: string; message: string; + protocol?: MessageSigningProtocols; } export type SignMessageResponse = string; From eeb584a05d28eb75ae527fb04a333b19112d8649 Mon Sep 17 00:00:00 2001 From: Mahmoud Aboelenein Date: Tue, 16 Jul 2024 11:47:57 +0300 Subject: [PATCH 3/3] update version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9823dc8..c1f943c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@sats-connect/core", - "version": "0.1.0", + "version": "0.1.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@sats-connect/core", - "version": "0.1.0", + "version": "0.1.1", "license": "ISC", "dependencies": { "axios": "1.6.8", diff --git a/package.json b/package.json index 9a22fbb..7b60173 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sats-connect/core", - "version": "0.1.0", + "version": "0.1.1", "main": "dist/index.mjs", "module": "dist/index.mjs", "types": "dist/index.d.mts",