From 66ae488690043813531c6f7dd6d4295a28e94a78 Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Wed, 9 Oct 2024 11:05:30 +0200 Subject: [PATCH] chore(protobuf): remove unused definitions (monero, webauthn) --- packages/protobuf/messages.json | 1030 ----------------- packages/protobuf/scripts/protobuf-build.sh | 2 +- .../scripts/protobuf-patches/index.ts | 59 - packages/protobuf/src/messages-schema.ts | 10 - packages/protobuf/src/messages.ts | 7 - 5 files changed, 1 insertion(+), 1107 deletions(-) diff --git a/packages/protobuf/messages.json b/packages/protobuf/messages.json index 3bb7beae115..f302d862163 100644 --- a/packages/protobuf/messages.json +++ b/packages/protobuf/messages.json @@ -5079,954 +5079,6 @@ } } }, - "MoneroNetworkType": { - "values": { - "MAINNET": 0, - "TESTNET": 1, - "STAGENET": 2, - "FAKECHAIN": 3 - } - }, - "MoneroTransactionSourceEntry": { - "fields": { - "outputs": { - "rule": "repeated", - "type": "MoneroOutputEntry", - "id": 1 - }, - "real_output": { - "type": "uint64", - "id": 2 - }, - "real_out_tx_key": { - "type": "bytes", - "id": 3 - }, - "real_out_additional_tx_keys": { - "rule": "repeated", - "type": "bytes", - "id": 4 - }, - "real_output_in_tx_index": { - "type": "uint64", - "id": 5 - }, - "amount": { - "type": "uint64", - "id": 6 - }, - "rct": { - "type": "bool", - "id": 7 - }, - "mask": { - "type": "bytes", - "id": 8 - }, - "multisig_kLRki": { - "type": "MoneroMultisigKLRki", - "id": 9 - }, - "subaddr_minor": { - "type": "uint32", - "id": 10 - } - }, - "nested": { - "MoneroOutputEntry": { - "fields": { - "idx": { - "type": "uint64", - "id": 1 - }, - "key": { - "type": "MoneroRctKeyPublic", - "id": 2 - } - }, - "nested": { - "MoneroRctKeyPublic": { - "fields": { - "dest": { - "rule": "required", - "type": "bytes", - "id": 1 - }, - "commitment": { - "rule": "required", - "type": "bytes", - "id": 2 - } - } - } - } - }, - "MoneroMultisigKLRki": { - "fields": { - "K": { - "type": "bytes", - "id": 1 - }, - "L": { - "type": "bytes", - "id": 2 - }, - "R": { - "type": "bytes", - "id": 3 - }, - "ki": { - "type": "bytes", - "id": 4 - } - } - } - } - }, - "MoneroTransactionDestinationEntry": { - "fields": { - "amount": { - "type": "uint64", - "id": 1 - }, - "addr": { - "type": "MoneroAccountPublicAddress", - "id": 2 - }, - "is_subaddress": { - "type": "bool", - "id": 3 - }, - "original": { - "type": "bytes", - "id": 4 - }, - "is_integrated": { - "type": "bool", - "id": 5 - } - }, - "nested": { - "MoneroAccountPublicAddress": { - "fields": { - "spend_public_key": { - "type": "bytes", - "id": 1 - }, - "view_public_key": { - "type": "bytes", - "id": 2 - } - } - } - } - }, - "MoneroTransactionRsigData": { - "fields": { - "rsig_type": { - "type": "uint32", - "id": 1 - }, - "offload_type": { - "type": "uint32", - "id": 2 - }, - "grouping": { - "rule": "repeated", - "type": "uint64", - "id": 3, - "options": { - "packed": false - } - }, - "mask": { - "type": "bytes", - "id": 4 - }, - "rsig": { - "type": "bytes", - "id": 5 - }, - "rsig_parts": { - "rule": "repeated", - "type": "bytes", - "id": 6 - }, - "bp_version": { - "type": "uint32", - "id": 7 - } - } - }, - "MoneroGetAddress": { - "fields": { - "address_n": { - "rule": "repeated", - "type": "uint32", - "id": 1, - "options": { - "packed": false - } - }, - "show_display": { - "type": "bool", - "id": 2 - }, - "network_type": { - "type": "MoneroNetworkType", - "id": 3, - "options": { - "default": "MAINNET" - } - }, - "account": { - "type": "uint32", - "id": 4 - }, - "minor": { - "type": "uint32", - "id": 5 - }, - "payment_id": { - "type": "bytes", - "id": 6 - }, - "chunkify": { - "type": "bool", - "id": 7 - } - } - }, - "MoneroAddress": { - "fields": { - "address": { - "type": "bytes", - "id": 1 - } - } - }, - "MoneroGetWatchKey": { - "fields": { - "address_n": { - "rule": "repeated", - "type": "uint32", - "id": 1, - "options": { - "packed": false - } - }, - "network_type": { - "type": "MoneroNetworkType", - "id": 2, - "options": { - "default": "MAINNET" - } - } - } - }, - "MoneroWatchKey": { - "fields": { - "watch_key": { - "type": "bytes", - "id": 1 - }, - "address": { - "type": "bytes", - "id": 2 - } - } - }, - "MoneroTransactionInitRequest": { - "fields": { - "version": { - "type": "uint32", - "id": 1 - }, - "address_n": { - "rule": "repeated", - "type": "uint32", - "id": 2, - "options": { - "packed": false - } - }, - "network_type": { - "type": "MoneroNetworkType", - "id": 3, - "options": { - "default": "MAINNET" - } - }, - "tsx_data": { - "type": "MoneroTransactionData", - "id": 4 - } - }, - "nested": { - "MoneroTransactionData": { - "fields": { - "version": { - "type": "uint32", - "id": 1 - }, - "payment_id": { - "type": "bytes", - "id": 2 - }, - "unlock_time": { - "type": "uint64", - "id": 3 - }, - "outputs": { - "rule": "repeated", - "type": "MoneroTransactionDestinationEntry", - "id": 4 - }, - "change_dts": { - "type": "MoneroTransactionDestinationEntry", - "id": 5 - }, - "num_inputs": { - "type": "uint32", - "id": 6 - }, - "mixin": { - "type": "uint32", - "id": 7 - }, - "fee": { - "type": "uint64", - "id": 8 - }, - "account": { - "type": "uint32", - "id": 9 - }, - "minor_indices": { - "rule": "repeated", - "type": "uint32", - "id": 10, - "options": { - "packed": false - } - }, - "rsig_data": { - "type": "MoneroTransactionRsigData", - "id": 11 - }, - "integrated_indices": { - "rule": "repeated", - "type": "uint32", - "id": 12, - "options": { - "packed": false - } - }, - "client_version": { - "type": "uint32", - "id": 13 - }, - "hard_fork": { - "type": "uint32", - "id": 14 - }, - "monero_version": { - "type": "bytes", - "id": 15 - }, - "chunkify": { - "type": "bool", - "id": 16 - } - } - } - } - }, - "MoneroTransactionInitAck": { - "fields": { - "hmacs": { - "rule": "repeated", - "type": "bytes", - "id": 1 - }, - "rsig_data": { - "type": "MoneroTransactionRsigData", - "id": 2 - } - } - }, - "MoneroTransactionSetInputRequest": { - "fields": { - "src_entr": { - "type": "MoneroTransactionSourceEntry", - "id": 1 - } - } - }, - "MoneroTransactionSetInputAck": { - "fields": { - "vini": { - "type": "bytes", - "id": 1 - }, - "vini_hmac": { - "type": "bytes", - "id": 2 - }, - "pseudo_out": { - "type": "bytes", - "id": 3 - }, - "pseudo_out_hmac": { - "type": "bytes", - "id": 4 - }, - "pseudo_out_alpha": { - "type": "bytes", - "id": 5 - }, - "spend_key": { - "type": "bytes", - "id": 6 - } - } - }, - "MoneroTransactionInputViniRequest": { - "fields": { - "src_entr": { - "type": "MoneroTransactionSourceEntry", - "id": 1 - }, - "vini": { - "type": "bytes", - "id": 2 - }, - "vini_hmac": { - "type": "bytes", - "id": 3 - }, - "pseudo_out": { - "type": "bytes", - "id": 4 - }, - "pseudo_out_hmac": { - "type": "bytes", - "id": 5 - }, - "orig_idx": { - "type": "uint32", - "id": 6 - } - } - }, - "MoneroTransactionInputViniAck": { - "fields": {} - }, - "MoneroTransactionAllInputsSetRequest": { - "fields": {} - }, - "MoneroTransactionAllInputsSetAck": { - "fields": { - "rsig_data": { - "type": "MoneroTransactionRsigData", - "id": 1 - } - } - }, - "MoneroTransactionSetOutputRequest": { - "fields": { - "dst_entr": { - "type": "MoneroTransactionDestinationEntry", - "id": 1 - }, - "dst_entr_hmac": { - "type": "bytes", - "id": 2 - }, - "rsig_data": { - "type": "MoneroTransactionRsigData", - "id": 3 - }, - "is_offloaded_bp": { - "type": "bool", - "id": 4 - } - } - }, - "MoneroTransactionSetOutputAck": { - "fields": { - "tx_out": { - "type": "bytes", - "id": 1 - }, - "vouti_hmac": { - "type": "bytes", - "id": 2 - }, - "rsig_data": { - "type": "MoneroTransactionRsigData", - "id": 3 - }, - "out_pk": { - "type": "bytes", - "id": 4 - }, - "ecdh_info": { - "type": "bytes", - "id": 5 - } - } - }, - "MoneroTransactionAllOutSetRequest": { - "fields": { - "rsig_data": { - "type": "MoneroTransactionRsigData", - "id": 1 - } - } - }, - "MoneroTransactionAllOutSetAck": { - "fields": { - "extra": { - "type": "bytes", - "id": 1 - }, - "tx_prefix_hash": { - "type": "bytes", - "id": 2 - }, - "rv": { - "type": "MoneroRingCtSig", - "id": 4 - }, - "full_message_hash": { - "type": "bytes", - "id": 5 - } - }, - "nested": { - "MoneroRingCtSig": { - "fields": { - "txn_fee": { - "type": "uint64", - "id": 1 - }, - "message": { - "type": "bytes", - "id": 2 - }, - "rv_type": { - "type": "uint32", - "id": 3 - } - } - } - } - }, - "MoneroTransactionSignInputRequest": { - "fields": { - "src_entr": { - "type": "MoneroTransactionSourceEntry", - "id": 1 - }, - "vini": { - "type": "bytes", - "id": 2 - }, - "vini_hmac": { - "type": "bytes", - "id": 3 - }, - "pseudo_out": { - "type": "bytes", - "id": 4 - }, - "pseudo_out_hmac": { - "type": "bytes", - "id": 5 - }, - "pseudo_out_alpha": { - "type": "bytes", - "id": 6 - }, - "spend_key": { - "type": "bytes", - "id": 7 - }, - "orig_idx": { - "type": "uint32", - "id": 8 - } - } - }, - "MoneroTransactionSignInputAck": { - "fields": { - "signature": { - "type": "bytes", - "id": 1 - }, - "pseudo_out": { - "type": "bytes", - "id": 2 - } - } - }, - "MoneroTransactionFinalRequest": { - "fields": {} - }, - "MoneroTransactionFinalAck": { - "fields": { - "cout_key": { - "type": "bytes", - "id": 1 - }, - "salt": { - "type": "bytes", - "id": 2 - }, - "rand_mult": { - "type": "bytes", - "id": 3 - }, - "tx_enc_keys": { - "type": "bytes", - "id": 4 - }, - "opening_key": { - "type": "bytes", - "id": 5 - } - } - }, - "MoneroKeyImageExportInitRequest": { - "fields": { - "num": { - "rule": "required", - "type": "uint64", - "id": 1 - }, - "hash": { - "rule": "required", - "type": "bytes", - "id": 2 - }, - "address_n": { - "rule": "repeated", - "type": "uint32", - "id": 3, - "options": { - "packed": false - } - }, - "network_type": { - "type": "MoneroNetworkType", - "id": 4, - "options": { - "default": "MAINNET" - } - }, - "subs": { - "rule": "repeated", - "type": "MoneroSubAddressIndicesList", - "id": 5 - } - }, - "nested": { - "MoneroSubAddressIndicesList": { - "fields": { - "account": { - "rule": "required", - "type": "uint32", - "id": 1 - }, - "minor_indices": { - "rule": "repeated", - "type": "uint32", - "id": 2, - "options": { - "packed": false - } - } - } - } - } - }, - "MoneroKeyImageExportInitAck": { - "fields": {} - }, - "MoneroKeyImageSyncStepRequest": { - "fields": { - "tdis": { - "rule": "repeated", - "type": "MoneroTransferDetails", - "id": 1 - } - }, - "nested": { - "MoneroTransferDetails": { - "fields": { - "out_key": { - "rule": "required", - "type": "bytes", - "id": 1 - }, - "tx_pub_key": { - "rule": "required", - "type": "bytes", - "id": 2 - }, - "additional_tx_pub_keys": { - "rule": "repeated", - "type": "bytes", - "id": 3 - }, - "internal_output_index": { - "rule": "required", - "type": "uint64", - "id": 4 - }, - "sub_addr_major": { - "type": "uint32", - "id": 5 - }, - "sub_addr_minor": { - "type": "uint32", - "id": 6 - } - } - } - } - }, - "MoneroKeyImageSyncStepAck": { - "fields": { - "kis": { - "rule": "repeated", - "type": "MoneroExportedKeyImage", - "id": 1 - } - }, - "nested": { - "MoneroExportedKeyImage": { - "fields": { - "iv": { - "type": "bytes", - "id": 1 - }, - "blob": { - "type": "bytes", - "id": 3 - } - } - } - } - }, - "MoneroKeyImageSyncFinalRequest": { - "fields": {} - }, - "MoneroKeyImageSyncFinalAck": { - "fields": { - "enc_key": { - "type": "bytes", - "id": 1 - } - } - }, - "MoneroGetTxKeyRequest": { - "fields": { - "address_n": { - "rule": "repeated", - "type": "uint32", - "id": 1, - "options": { - "packed": false - } - }, - "network_type": { - "type": "MoneroNetworkType", - "id": 2, - "options": { - "default": "MAINNET" - } - }, - "salt1": { - "rule": "required", - "type": "bytes", - "id": 3 - }, - "salt2": { - "rule": "required", - "type": "bytes", - "id": 4 - }, - "tx_enc_keys": { - "rule": "required", - "type": "bytes", - "id": 5 - }, - "tx_prefix_hash": { - "rule": "required", - "type": "bytes", - "id": 6 - }, - "reason": { - "type": "uint32", - "id": 7 - }, - "view_public_key": { - "type": "bytes", - "id": 8 - } - } - }, - "MoneroGetTxKeyAck": { - "fields": { - "salt": { - "type": "bytes", - "id": 1 - }, - "tx_keys": { - "type": "bytes", - "id": 2 - }, - "tx_derivations": { - "type": "bytes", - "id": 3 - } - } - }, - "MoneroLiveRefreshStartRequest": { - "fields": { - "address_n": { - "rule": "repeated", - "type": "uint32", - "id": 1, - "options": { - "packed": false - } - }, - "network_type": { - "type": "MoneroNetworkType", - "id": 2, - "options": { - "default": "MAINNET" - } - } - } - }, - "MoneroLiveRefreshStartAck": { - "fields": {} - }, - "MoneroLiveRefreshStepRequest": { - "fields": { - "out_key": { - "rule": "required", - "type": "bytes", - "id": 1 - }, - "recv_deriv": { - "rule": "required", - "type": "bytes", - "id": 2 - }, - "real_out_idx": { - "rule": "required", - "type": "uint64", - "id": 3 - }, - "sub_addr_major": { - "rule": "required", - "type": "uint32", - "id": 4 - }, - "sub_addr_minor": { - "rule": "required", - "type": "uint32", - "id": 5 - } - } - }, - "MoneroLiveRefreshStepAck": { - "fields": { - "salt": { - "type": "bytes", - "id": 1 - }, - "key_image": { - "type": "bytes", - "id": 2 - } - } - }, - "MoneroLiveRefreshFinalRequest": { - "fields": {} - }, - "MoneroLiveRefreshFinalAck": { - "fields": {} - }, - "DebugMoneroDiagRequest": { - "fields": { - "ins": { - "type": "uint64", - "id": 1 - }, - "p1": { - "type": "uint64", - "id": 2 - }, - "p2": { - "type": "uint64", - "id": 3 - }, - "pd": { - "rule": "repeated", - "type": "uint64", - "id": 4, - "options": { - "packed": false - } - }, - "data1": { - "type": "bytes", - "id": 5 - }, - "data2": { - "type": "bytes", - "id": 6 - } - } - }, - "DebugMoneroDiagAck": { - "fields": { - "ins": { - "type": "uint64", - "id": 1 - }, - "p1": { - "type": "uint64", - "id": 2 - }, - "p2": { - "type": "uint64", - "id": 3 - }, - "pd": { - "rule": "repeated", - "type": "uint64", - "id": 4, - "options": { - "packed": false - } - }, - "data1": { - "type": "bytes", - "id": 5 - }, - "data2": { - "type": "bytes", - "id": 6 - } - } - }, "NEMGetAddress": { "fields": { "address_n": { @@ -7614,88 +6666,6 @@ } } }, - "WebAuthnListResidentCredentials": { - "fields": {} - }, - "WebAuthnAddResidentCredential": { - "fields": { - "credential_id": { - "type": "bytes", - "id": 1 - } - } - }, - "WebAuthnRemoveResidentCredential": { - "fields": { - "index": { - "type": "uint32", - "id": 1 - } - } - }, - "WebAuthnCredentials": { - "fields": { - "credentials": { - "rule": "repeated", - "type": "WebAuthnCredential", - "id": 1 - } - }, - "nested": { - "WebAuthnCredential": { - "fields": { - "index": { - "type": "uint32", - "id": 1 - }, - "id": { - "type": "bytes", - "id": 2 - }, - "rp_id": { - "type": "string", - "id": 3 - }, - "rp_name": { - "type": "string", - "id": 4 - }, - "user_id": { - "type": "bytes", - "id": 5 - }, - "user_name": { - "type": "string", - "id": 6 - }, - "user_display_name": { - "type": "string", - "id": 7 - }, - "creation_time": { - "type": "uint32", - "id": 8 - }, - "hmac_secret": { - "type": "bool", - "id": 9 - }, - "use_sign_count": { - "type": "bool", - "id": 10 - }, - "algorithm": { - "type": "sint32", - "id": 11 - }, - "curve": { - "type": "sint32", - "id": 12 - } - } - } - } - }, "MessageType": { "values": { "MessageType_Initialize": 0, diff --git a/packages/protobuf/scripts/protobuf-build.sh b/packages/protobuf/scripts/protobuf-build.sh index 874755b0b1e..c42ec9e3d88 100755 --- a/packages/protobuf/scripts/protobuf-build.sh +++ b/packages/protobuf/scripts/protobuf-build.sh @@ -39,7 +39,7 @@ cd .. cd "$SCRIPTS_PATH" -yarn tsx ./protobuf-definitions.ts "$REPO_PATH/common/protob" +yarn tsx ./protobuf-definitions.ts "$REPO_PATH/common/protob" --skip=monero,webauthn,thp yarn tsx ./protobuf-types.ts yarn workspace @trezor/protobuf g:prettier --write {messages.json,src/messages.ts} diff --git a/packages/protobuf/scripts/protobuf-patches/index.ts b/packages/protobuf/scripts/protobuf-patches/index.ts index 891c02a1ee8..aa29f312f63 100644 --- a/packages/protobuf/scripts/protobuf-patches/index.ts +++ b/packages/protobuf/scripts/protobuf-patches/index.ts @@ -268,10 +268,6 @@ export const SKIP = [ 'TxInput', // declared in TxInputType patch 'TxOutput', // declared in TxOutputType patch // not implemented - 'CosiCommit', - 'CosiCommitment', - 'CosiSign', - 'CosiSignature', 'DebugSwipeDirection', 'DebugLinkDecision', 'DebugLinkLayout', @@ -288,59 +284,4 @@ export const SKIP = [ 'DebugLinkEraseSdCard', 'DebugLinkWatchLayout', 'LoadDevice', - 'MoneroRctKeyPublic', - 'MoneroOutputEntry', - 'MoneroMultisigKLRki', - 'MoneroTransactionSourceEntry', - 'MoneroAccountPublicAddress', - 'MoneroTransactionDestinationEntry', - 'MoneroTransactionRsigData', - 'MoneroGetAddress', - 'MoneroAddress', - 'MoneroGetWatchKey', - 'MoneroWatchKey', - 'MoneroTransactionData', - 'MoneroTransactionInitRequest', - 'MoneroTransactionInitAck', - 'MoneroTransactionSetInputRequest', - 'MoneroTransactionSetInputAck', - 'MoneroTransactionInputsPermutationRequest', - 'MoneroTransactionInputsPermutationAck', - 'MoneroTransactionInputViniRequest', - 'MoneroTransactionInputViniAck', - 'MoneroTransactionAllInputsSetRequest', - 'MoneroTransactionAllInputsSetAck', - 'MoneroTransactionSetOutputRequest', - 'MoneroTransactionSetOutputAck', - 'MoneroTransactionAllOutSetRequest', - 'MoneroRingCtSig', - 'MoneroTransactionAllOutSetAck', - 'MoneroTransactionSignInputRequest', - 'MoneroTransactionSignInputAck', - 'MoneroTransactionFinalRequest', - 'MoneroTransactionFinalAck', - 'MoneroSubAddressIndicesList', - 'MoneroKeyImageExportInitRequest', - 'MoneroKeyImageExportInitAck', - 'MoneroTransferDetails', - 'MoneroKeyImageSyncStepRequest', - 'MoneroExportedKeyImage', - 'MoneroKeyImageSyncStepAck', - 'MoneroKeyImageSyncFinalRequest', - 'MoneroKeyImageSyncFinalAck', - 'MoneroGetTxKeyRequest', - 'MoneroGetTxKeyAck', - 'MoneroLiveRefreshStartRequest', - 'MoneroLiveRefreshStartAck', - 'MoneroLiveRefreshStepRequest', - 'MoneroLiveRefreshStepAck', - 'MoneroLiveRefreshFinalRequest', - 'MoneroLiveRefreshFinalAck', - 'DebugMoneroDiagRequest', - 'DebugMoneroDiagAck', - 'WebAuthnListResidentCredentials', - 'WebAuthnAddResidentCredential', - 'WebAuthnRemoveResidentCredential', - 'WebAuthnCredential', - 'WebAuthnCredentials', ]; diff --git a/packages/protobuf/src/messages-schema.ts b/packages/protobuf/src/messages-schema.ts index 812f807c7d9..6e5b30608e0 100644 --- a/packages/protobuf/src/messages-schema.ts +++ b/packages/protobuf/src/messages-schema.ts @@ -2681,16 +2681,6 @@ export const SetBrightness = Type.Object( { $id: 'SetBrightness' }, ); -export enum MoneroNetworkType { - MAINNET = 0, - TESTNET = 1, - STAGENET = 2, - FAKECHAIN = 3, -} - -export type EnumMoneroNetworkType = Static; -export const EnumMoneroNetworkType = Type.Enum(MoneroNetworkType); - export type NEMGetAddress = Static; export const NEMGetAddress = Type.Object( { diff --git a/packages/protobuf/src/messages.ts b/packages/protobuf/src/messages.ts index ee8ff18b85c..0ca72b95375 100644 --- a/packages/protobuf/src/messages.ts +++ b/packages/protobuf/src/messages.ts @@ -1910,13 +1910,6 @@ export type SetBrightness = { value?: number; }; -export enum MoneroNetworkType { - MAINNET = 0, - TESTNET = 1, - STAGENET = 2, - FAKECHAIN = 3, -} - // NEMGetAddress export type NEMGetAddress = { address_n: number[];