From 3398b63c8c5a3ada0124747a8ea0b9b519539ba2 Mon Sep 17 00:00:00 2001 From: GiMa-Maya <128942712+GiMa-Maya@users.noreply.github.com> Date: Sun, 3 Mar 2024 17:40:32 +0100 Subject: [PATCH 1/2] Create messages-kujira.proto --- messages-kujira.proto | 123 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 messages-kujira.proto diff --git a/messages-kujira.proto b/messages-kujira.proto new file mode 100644 index 0000000..a20d4ce --- /dev/null +++ b/messages-kujira.proto @@ -0,0 +1,123 @@ +syntax = "proto2"; + +/** + * WARNING: Make sure Kujira messages align with the tendermint messages + */ + +/* Sugar for easier handling in Java */ +option java_package = "com.keepkey.deviceprotocol"; +option java_outer_classname = "KeepKeyMessageKujira"; + +import "types.proto"; + +/** + * Request: Address at the specified index + * @start + * @next KujiraAddress + */ +message KujiraGetAddress { + /* BIP-32 path. For compatibility with other wallets, must be + * m/44'/931'/index' */ + repeated uint32 address_n = 1; + /* optionally show on display before sending the result */ + optional bool show_display = 2; + /* if true, return an address with the testnet prefix */ + optional bool testnet = 3; +} + +/** + * Response: Address for the given index + * @end + */ +message KujiraAddress { + /* Bech32-encoded address */ + optional string address = 1; +} + +/** + * Request: ask device to sign Kujira transaction + * @start + * @next KujiraSignedTx + */ +message KujiraSignTx { + /* BIP-32 path. For compatibility with other wallets, must be + * m/44'/118'/index'/0/0 */ + repeated uint32 address_n = 1; + optional uint64 account_number = 2 [ jstype = JS_STRING ]; + optional string chain_id = 3; + optional uint32 fee_amount = 4; + optional uint32 gas = 5; + optional string memo = 6; + optional uint64 sequence = 7 [ jstype = JS_STRING ]; + optional uint32 msg_count = 8; + /* if true, decode addresses with prefix 'tosmo' */ + optional bool testnet = 9; +} + +message KujiraMsgRequest {} + +message KujiraMsgAck { + optional KujiraMsgSend send = 1; + optional KujiraMsgDelegate delegate = 2; + optional KujiraMsgUndelegate undelegate = 3; + optional KujiraMsgRedelegate redelegate = 4; + optional KujiraMsgRewards rewards = 5; + optional KujiraMsgIBCTransfer ibc_transfer = 10; +} + +message KujiraMsgSend { + optional string from_address = 1; + optional string to_address = 2; + optional string denom = 3; + optional string amount = 4; + optional OutputAddressType address_type = 5; +} + +message KujiraMsgDelegate { + optional string delegator_address = 1; + optional string validator_address = 2; + optional string denom = 3; + optional string amount = 4; +} + +message KujiraMsgUndelegate { + optional string delegator_address = 1; + optional string validator_address = 2; + optional string denom = 3; + optional string amount = 4; +} + +message KujiraMsgRedelegate { + optional string delegator_address = 1; + optional string validator_src_address = 2; + optional string validator_dst_address = 3; + optional string denom = 4; + optional string amount = 5; +} + +message KujiraMsgRewards { + optional string delegator_address = 1; + optional string validator_address = 2; +} + +message KujiraMsgIBCTransfer { + optional string source_port = 1; + optional string source_channel = 2; + optional string denom = 3; + optional string amount = 4; + optional string sender = 5; + optional string receiver = 6; + optional string revision_number = 7; + optional string revision_height = 8; +} + +/** + * Response: signature for transaction + * @end + */ +message KujiraSignedTx { + /* public key for the private key used to sign data */ + optional bytes public_key = 1; + /* signature suitable for sending to the Kujira network */ + optional bytes signature = 2; +} From fd1f566f9b3f10b0446f5584b3deffaf8f89340e Mon Sep 17 00:00:00 2001 From: GiMa-Maya <128942712+GiMa-Maya@users.noreply.github.com> Date: Sun, 3 Mar 2024 17:45:30 +0100 Subject: [PATCH 2/2] Update messages.proto --- messages.proto | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/messages.proto b/messages.proto index 69ea747..102329a 100644 --- a/messages.proto +++ b/messages.proto @@ -192,6 +192,20 @@ enum MessageType { MessageType_MayachainSignedTx = 1205 [ (wire_out) = true ]; } +// Kujira + MessageType_KujiraGetAddress = 1300 [ (wire_in) = true ]; + MessageType_KujiraAddress = 1301 [ (wire_out) = true ]; + MessageType_KujiraSignTx = 1302 [ (wire_in) = true ]; + MessageType_KujiraMsgRequest = 1303 [ (wire_out) = true ]; + MessageType_KujiraMsgAck = 1304 [ (wire_in) = true ]; + MessageType_KujiraMsgSend = 1305 [ (wire_in) = true ]; + MessageType_KujiraMsgDelegate = 1306 [ (wire_in) = true ]; + MessageType_KujiraMsgUndelegate = 1307 [ (wire_in) = true ]; + MessageType_KujiraMsgRedelegate = 1308 [ (wire_in) = true ]; + MessageType_KujiraMsgRewards = 1309 [ (wire_in) = true ]; + MessageType_KujiraMsgIBCTransfer = 1310 [ (wire_in) = true ]; + MessageType_KujiraSignedTx = 1311 [ (wire_out) = true ]; + //////////////////// // Basic messages // ////////////////////