Skip to content

Commit

Permalink
feat(protobuf): add pubkeys order fields
Browse files Browse the repository at this point in the history
  • Loading branch information
mroz22 committed Dec 10, 2024
1 parent 1e8ee7a commit afd17a3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/protobuf/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,12 @@
"SATOSHI": 3
}
},
"MultisigPubkeysOrder": {
"values": {
"PRESERVED": 0,
"LEXICOGRAPHIC": 1
}
},
"MultisigRedeemScriptType": {
"fields": {
"pubkeys": {
Expand Down Expand Up @@ -309,6 +315,13 @@
"options": {
"packed": false
}
},
"pubkeys_order": {
"type": "MultisigPubkeysOrder",
"id": 6,
"options": {
"default": "PRESERVED"
}
}
},
"nested": {
Expand Down
9 changes: 9 additions & 0 deletions packages/protobuf/src/messages-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,14 @@ export enum AmountUnit {
export type EnumAmountUnit = Static<typeof EnumAmountUnit>;
export const EnumAmountUnit = Type.Enum(AmountUnit);

export enum MultisigPubkeysOrder {
PRESERVED = 0,
LEXICOGRAPHIC = 1,
}

export type EnumMultisigPubkeysOrder = Static<typeof EnumMultisigPubkeysOrder>;
export const EnumMultisigPubkeysOrder = Type.Enum(MultisigPubkeysOrder);

export type HDNodeType = Static<typeof HDNodeType>;
export const HDNodeType = Type.Object(
{
Expand Down Expand Up @@ -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' },
);
Expand Down
6 changes: 6 additions & 0 deletions packages/protobuf/src/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ export enum AmountUnit {
SATOSHI = 3,
}

export enum MultisigPubkeysOrder {
PRESERVED = 0,
LEXICOGRAPHIC = 1,
}

export type HDNodeType = {
depth: number;
fingerprint: number;
Expand All @@ -160,6 +165,7 @@ export type MultisigRedeemScriptType = {
m: number;
nodes?: HDNodeType[];
address_n?: number[];
pubkeys_order?: MultisigPubkeysOrder;
};

export type GetPublicKey = {
Expand Down

0 comments on commit afd17a3

Please sign in to comment.