From afd17a37c4b54654ece3d1d126a18692422bab3c Mon Sep 17 00:00:00 2001 From: Martin Varmuza Date: Tue, 10 Dec 2024 12:01:51 +0100 Subject: [PATCH] feat(protobuf): add pubkeys order fields --- packages/protobuf/messages.json | 13 +++++++++++++ packages/protobuf/src/messages-schema.ts | 9 +++++++++ packages/protobuf/src/messages.ts | 6 ++++++ 3 files changed, 28 insertions(+) diff --git a/packages/protobuf/messages.json b/packages/protobuf/messages.json index f5427b7c8d2..10dd6da802e 100644 --- a/packages/protobuf/messages.json +++ b/packages/protobuf/messages.json @@ -280,6 +280,12 @@ "SATOSHI": 3 } }, + "MultisigPubkeysOrder": { + "values": { + "PRESERVED": 0, + "LEXICOGRAPHIC": 1 + } + }, "MultisigRedeemScriptType": { "fields": { "pubkeys": { @@ -309,6 +315,13 @@ "options": { "packed": false } + }, + "pubkeys_order": { + "type": "MultisigPubkeysOrder", + "id": 6, + "options": { + "default": "PRESERVED" + } } }, "nested": { diff --git a/packages/protobuf/src/messages-schema.ts b/packages/protobuf/src/messages-schema.ts index 815dc9887e2..947ac3e048e 100644 --- a/packages/protobuf/src/messages-schema.ts +++ b/packages/protobuf/src/messages-schema.ts @@ -205,6 +205,14 @@ export enum AmountUnit { export type EnumAmountUnit = Static; export const EnumAmountUnit = Type.Enum(AmountUnit); +export enum MultisigPubkeysOrder { + PRESERVED = 0, + LEXICOGRAPHIC = 1, +} + +export type EnumMultisigPubkeysOrder = Static; +export const EnumMultisigPubkeysOrder = Type.Enum(MultisigPubkeysOrder); + export type HDNodeType = Static; export const HDNodeType = Type.Object( { @@ -235,6 +243,7 @@ export const MultisigRedeemScriptType = Type.Object( m: Type.Number(), nodes: Type.Optional(Type.Array(HDNodeType)), address_n: Type.Optional(Type.Array(Type.Number())), + pubkeys_order: Type.Optional(EnumMultisigPubkeysOrder), }, { $id: 'MultisigRedeemScriptType' }, ); diff --git a/packages/protobuf/src/messages.ts b/packages/protobuf/src/messages.ts index 2531a6c4f05..ae0600e4bc9 100644 --- a/packages/protobuf/src/messages.ts +++ b/packages/protobuf/src/messages.ts @@ -140,6 +140,11 @@ export enum AmountUnit { SATOSHI = 3, } +export enum MultisigPubkeysOrder { + PRESERVED = 0, + LEXICOGRAPHIC = 1, +} + export type HDNodeType = { depth: number; fingerprint: number; @@ -160,6 +165,7 @@ export type MultisigRedeemScriptType = { m: number; nodes?: HDNodeType[]; address_n?: number[]; + pubkeys_order?: MultisigPubkeysOrder; }; export type GetPublicKey = {