From 7358ab16361f3a6d518148f87cc9f10fd968fc12 Mon Sep 17 00:00:00 2001 From: Tomas Susanka Date: Tue, 10 Jul 2018 17:35:31 +0200 Subject: [PATCH] protobuf: Ripple (#162) --- protob/messages-ripple.proto | 55 ++++++++++++++++++++++++++++++++++++ protob/messages.proto | 6 ++++ 2 files changed, 61 insertions(+) create mode 100644 protob/messages-ripple.proto diff --git a/protob/messages-ripple.proto b/protob/messages-ripple.proto new file mode 100644 index 0000000000..7cbe514157 --- /dev/null +++ b/protob/messages-ripple.proto @@ -0,0 +1,55 @@ +syntax = "proto2"; + +// Sugar for easier handling in Java +option java_package = "com.satoshilabs.trezor.lib.protobuf"; +option java_outer_classname = "TrezorMessageRipple"; + +/** + * Request: Address at the specified index + * @next RippleAddress + */ +message RippleGetAddress { + repeated uint32 address_n = 1; // BIP-32 path. For compatibility with other wallets, must be m/44'/144'/index' + optional bool show_display = 2; // optionally show on display before sending the result +} + +/** + * Response: Address for the given index + * @prev RippleGetAddress + */ +message RippleAddress { + optional string address = 1; // Address in Ripple format (base58 of a pubkey with checksum) +} + +/** + * Request: ask device to sign Ripple transaction + * @next RippleSignedTx + */ +message RippleSignTx { + repeated uint32 address_n = 1; // BIP-32 path. For compatibility with other wallets, must be m/44'/144'/index' + optional uint64 fee = 2; // fee (in drops) for the transaction + optional uint32 flags = 3; // transaction flags + optional uint32 sequence = 4; // transaction sequence number + optional uint32 last_ledger_sequence = 5; // see https://developers.ripple.com/reliable-transaction-submission.html#lastledgersequence + optional RipplePayment payment = 6; // Payment transaction type + + /** + * Payment transaction type + * - simple A sends money to B + * - only a subset of fields is supported + * - see https://developers.ripple.com/payment.html + */ + message RipplePayment { + optional uint64 amount = 1; // only XRP is supported at the moment so this an integer + optional string destination = 2; // destination account address + } +} + +/** + * Response: signature for transaction + * @prev RippleSignTx + */ +message RippleSignedTx { + optional bytes signature = 1; + optional bytes serialized_tx = 2; +} diff --git a/protob/messages.proto b/protob/messages.proto index 8f15182c3f..f4ff80bf84 100644 --- a/protob/messages.proto +++ b/protob/messages.proto @@ -172,4 +172,10 @@ enum MessageType { MessageType_CardanoAddress = 308 [(wire_out) = true]; MessageType_CardanoTxAck = 309 [(wire_in) = true]; MessageType_CardanoSignedTransaction = 310 [(wire_out) = true]; + + // Ripple + MessageType_RippleGetAddress = 400 [(wire_in) = true]; + MessageType_RippleAddress = 401 [(wire_out) = true]; + MessageType_RippleSignTx = 402 [(wire_in) = true]; + MessageType_RippleSignedTx = 403 [(wire_in) = true]; }