Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Kujira #83

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 123 additions & 0 deletions messages-kujira.proto
Original file line number Diff line number Diff line change
@@ -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;
}
14 changes: 14 additions & 0 deletions messages.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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 //
////////////////////
Expand Down