2018-07-04 14:44:26 +00:00
|
|
|
syntax = "proto2";
|
2018-07-29 14:17:00 +00:00
|
|
|
package hw.trezor.messages.stellar;
|
2018-07-04 14:44:26 +00:00
|
|
|
|
|
|
|
// Sugar for easier handling in Java
|
|
|
|
option java_package = "com.satoshilabs.trezor.lib.protobuf";
|
|
|
|
option java_outer_classname = "TrezorMessageStellar";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Describes a Stellar asset
|
2018-07-16 14:51:03 +00:00
|
|
|
* @embed
|
2018-07-04 14:44:26 +00:00
|
|
|
*/
|
|
|
|
message StellarAssetType {
|
|
|
|
optional uint32 type = 1; // 0 = native asset (XLM), 1 = alphanum 4, 2 = alphanum 12
|
|
|
|
optional string code = 2; // for non-native assets, string describing the code
|
|
|
|
optional string issuer = 3; // issuing address
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-07-16 14:51:03 +00:00
|
|
|
* Request: Address at the specified index
|
|
|
|
* @start
|
|
|
|
* @next StellarAddress
|
2018-07-04 14:44:26 +00:00
|
|
|
*/
|
2018-07-16 14:51:03 +00:00
|
|
|
message StellarGetAddress {
|
2018-07-04 14:44:26 +00:00
|
|
|
repeated uint32 address_n = 1; // BIP-32 path. For compatibility with other wallets, must be m/44'/148'/index'
|
|
|
|
optional bool show_display = 2; // optionally show on display before sending the result
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-07-16 14:51:03 +00:00
|
|
|
* Response: Address for the given index
|
|
|
|
* @end
|
2018-07-04 14:44:26 +00:00
|
|
|
*/
|
2018-07-16 14:51:03 +00:00
|
|
|
message StellarAddress {
|
|
|
|
optional string address = 1; // Address in Stellar format (base32 of a pubkey with checksum)
|
2018-07-04 14:44:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-07-16 14:51:03 +00:00
|
|
|
* Request: Public key at the specified index
|
|
|
|
* @start
|
|
|
|
* @next StellarPublicKey
|
2018-07-04 14:44:26 +00:00
|
|
|
*/
|
2018-07-16 16:19:46 +00:00
|
|
|
message StellarGetPublicKey {
|
2018-07-04 14:44:26 +00:00
|
|
|
repeated uint32 address_n = 1; // BIP-32 path. For compatibility with other wallets, must be m/44'/148'/index'
|
|
|
|
optional bool show_display = 2; // optionally show on display before sending the result
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-07-16 14:51:03 +00:00
|
|
|
* Response: Public key for the given index
|
|
|
|
* @end
|
2018-07-04 14:44:26 +00:00
|
|
|
*/
|
2018-07-16 14:51:03 +00:00
|
|
|
message StellarPublicKey {
|
|
|
|
optional bytes public_key = 1; // Raw bytes of the public key (no version or checksum)
|
2018-07-04 14:44:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: ask device to sign Stellar transaction
|
2018-07-16 16:19:46 +00:00
|
|
|
* @start
|
2018-07-04 14:44:26 +00:00
|
|
|
* @next StellarTxOpRequest
|
|
|
|
*/
|
|
|
|
message StellarSignTx {
|
|
|
|
repeated uint32 address_n = 2; // BIP-32 path. For compatibility with other wallets, must be m/44'/148'/index'
|
|
|
|
optional string network_passphrase = 3; // passphrase for signing messages on the destination network
|
2018-07-10 18:25:58 +00:00
|
|
|
optional string source_account = 4; // source account address
|
2018-07-04 14:44:26 +00:00
|
|
|
optional uint32 fee = 5; // Fee (in stroops) for the transaction
|
|
|
|
optional uint64 sequence_number = 6; // transaction sequence number
|
|
|
|
optional uint32 timebounds_start = 8; // unix timestamp (client must truncate this to 32 bytes)
|
|
|
|
optional uint32 timebounds_end = 9; // unix timestamp (client must truncate this to 32 bytes)
|
|
|
|
optional uint32 memo_type = 10; // 0 = none, 1 = text, 2 = id, 3 = hash, 4 = return
|
|
|
|
optional string memo_text = 11; // up to 28 characters (4 bytes are for length)
|
|
|
|
optional uint64 memo_id = 12; // 8-byte uint64
|
|
|
|
optional bytes memo_hash = 13; // 32 bytes representing a hash
|
|
|
|
optional uint32 num_operations = 14; // number of operations in this transaction
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Response: device is ready for client to send the next operation
|
|
|
|
* @next StellarPaymentOp
|
|
|
|
* @next StellarCreateAccountOp
|
|
|
|
* @next StellarPathPaymentOp
|
|
|
|
* @next StellarManageOfferOp
|
|
|
|
* @next StellarCreatePassiveOfferOp
|
|
|
|
* @next StellarSetOptionsOp
|
|
|
|
* @next StellarChangeTrustOp
|
|
|
|
* @next StellarAllowTrustOp
|
|
|
|
* @next StellarAccountMergeOp
|
|
|
|
* @next StellarManageDataOp
|
|
|
|
* @next StellarBumpSequenceOp
|
|
|
|
*/
|
|
|
|
message StellarTxOpRequest {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: ask device to confirm this operation type
|
|
|
|
* @next StellarTxOpRequest
|
|
|
|
* @next StellarSignedTx
|
|
|
|
*/
|
|
|
|
message StellarPaymentOp {
|
2018-07-10 18:25:58 +00:00
|
|
|
optional string source_account = 1; // (optional) source account address
|
2018-07-04 14:44:26 +00:00
|
|
|
optional string destination_account = 2; // destination account address
|
|
|
|
optional StellarAssetType asset = 3; // asset involved in the operation
|
|
|
|
optional sint64 amount = 4; // amount of the given asset to pay
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: ask device to confirm this operation type
|
|
|
|
* @next StellarTxOpRequest
|
|
|
|
* @next StellarSignedTx
|
|
|
|
*/
|
|
|
|
message StellarCreateAccountOp {
|
2018-07-10 18:25:58 +00:00
|
|
|
optional string source_account = 1; // (optional) source account address
|
2018-07-04 14:44:26 +00:00
|
|
|
optional string new_account = 2; // account address to create
|
|
|
|
optional sint64 starting_balance = 3; // initial starting balance for the new account
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: ask device to confirm this operation type
|
|
|
|
* @next StellarTxOpRequest
|
|
|
|
* @next StellarSignedTx
|
|
|
|
*/
|
|
|
|
message StellarPathPaymentOp {
|
2018-07-10 18:25:58 +00:00
|
|
|
optional string source_account = 1; // (optional) source address
|
2018-07-04 14:44:26 +00:00
|
|
|
optional StellarAssetType send_asset = 2;
|
|
|
|
optional sint64 send_max = 3;
|
|
|
|
optional string destination_account = 4;
|
|
|
|
optional StellarAssetType destination_asset = 5;
|
|
|
|
optional sint64 destination_amount = 6;
|
|
|
|
repeated StellarAssetType paths = 7;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: ask device to confirm this operation type
|
|
|
|
* @next StellarTxOpRequest
|
|
|
|
* @next StellarSignedTx
|
|
|
|
*/
|
|
|
|
message StellarManageOfferOp {
|
2018-07-10 18:25:58 +00:00
|
|
|
optional string source_account = 1; // (optional) source account address
|
2018-07-04 14:44:26 +00:00
|
|
|
optional StellarAssetType selling_asset = 2;
|
|
|
|
optional StellarAssetType buying_asset = 3;
|
|
|
|
optional sint64 amount = 4;
|
|
|
|
optional uint32 price_n = 5; // Price numerator
|
|
|
|
optional uint32 price_d = 6; // Price denominator
|
|
|
|
optional uint64 offer_id = 7; // Offer ID for updating an existing offer
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: ask device to confirm this operation type
|
|
|
|
* @next StellarTxOpRequest
|
|
|
|
* @next StellarSignedTx
|
|
|
|
*/
|
|
|
|
message StellarCreatePassiveOfferOp {
|
2018-07-10 18:25:58 +00:00
|
|
|
optional string source_account = 1; // (optional) source account address
|
2018-07-04 14:44:26 +00:00
|
|
|
optional StellarAssetType selling_asset = 2;
|
|
|
|
optional StellarAssetType buying_asset = 3;
|
|
|
|
optional sint64 amount = 4;
|
|
|
|
optional uint32 price_n = 5; // Price numerator
|
|
|
|
optional uint32 price_d = 6; // Price denominator
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: ask device to confirm this operation type
|
|
|
|
* @next StellarTxOpRequest
|
|
|
|
* @next StellarSignedTx
|
|
|
|
*/
|
|
|
|
message StellarSetOptionsOp {
|
2018-07-10 18:25:58 +00:00
|
|
|
optional string source_account = 1; // (optional) source account address
|
2018-07-04 14:44:26 +00:00
|
|
|
optional string inflation_destination_account = 2; // (optional) inflation destination address
|
|
|
|
optional uint32 clear_flags = 3;
|
|
|
|
optional uint32 set_flags = 4;
|
|
|
|
optional uint32 master_weight = 5;
|
|
|
|
optional uint32 low_threshold = 6;
|
|
|
|
optional uint32 medium_threshold = 7;
|
|
|
|
optional uint32 high_threshold = 8;
|
|
|
|
optional string home_domain = 9;
|
|
|
|
optional uint32 signer_type = 10;
|
|
|
|
optional bytes signer_key = 11;
|
|
|
|
optional uint32 signer_weight = 12;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: ask device to confirm this operation type
|
|
|
|
* @next StellarTxOpRequest
|
|
|
|
* @next StellarSignedTx
|
|
|
|
*/
|
|
|
|
message StellarChangeTrustOp {
|
2018-07-10 18:25:58 +00:00
|
|
|
optional string source_account = 1; // (optional) source account address
|
2018-07-04 14:44:26 +00:00
|
|
|
optional StellarAssetType asset = 2;
|
|
|
|
optional uint64 limit = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: ask device to confirm this operation type
|
|
|
|
* @next StellarTxOpRequest
|
|
|
|
* @next StellarSignedTx
|
|
|
|
*/
|
|
|
|
message StellarAllowTrustOp {
|
2018-07-10 18:25:58 +00:00
|
|
|
optional string source_account = 1; // (optional) source account address
|
2018-07-04 14:44:26 +00:00
|
|
|
optional string trusted_account = 2; // The account being allowed to hold the asset
|
|
|
|
optional uint32 asset_type = 3; // 1 = 4-character, 2 = 12-character
|
|
|
|
optional string asset_code = 4; // human-readable asset code
|
|
|
|
optional uint32 is_authorized = 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: ask device to confirm this operation type
|
|
|
|
* @next StellarTxOpRequest
|
|
|
|
* @next StellarSignedTx
|
|
|
|
*/
|
|
|
|
message StellarAccountMergeOp {
|
2018-07-10 18:25:58 +00:00
|
|
|
optional string source_account = 1; // (optional) source account address
|
2018-07-04 14:44:26 +00:00
|
|
|
optional string destination_account = 2; // destination account address
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: ask device to confirm this operation type
|
|
|
|
* @next StellarTxOpRequest
|
|
|
|
* @next StellarSignedTx
|
|
|
|
*/
|
|
|
|
message StellarManageDataOp {
|
2018-07-10 18:25:58 +00:00
|
|
|
optional string source_account = 1; // (optional) source account address
|
2018-07-04 14:44:26 +00:00
|
|
|
optional string key = 2;
|
|
|
|
optional bytes value = 3; // 64 bytes of arbitrary data
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: ask device to confirm this operation type
|
|
|
|
* @next StellarTxOpRequest
|
|
|
|
* @next StellarSignedTx
|
|
|
|
*/
|
|
|
|
message StellarBumpSequenceOp {
|
2018-07-10 18:25:58 +00:00
|
|
|
optional string source_account = 1; // (optional) source account address
|
2018-07-04 14:44:26 +00:00
|
|
|
optional uint64 bump_to = 2; // new sequence number
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Response: signature for transaction
|
2018-07-16 14:51:03 +00:00
|
|
|
* @end
|
2018-07-04 14:44:26 +00:00
|
|
|
*/
|
|
|
|
message StellarSignedTx {
|
|
|
|
optional bytes public_key = 1; // public key for the private key used to sign data
|
|
|
|
optional bytes signature = 2; // signature suitable for sending to the Stellar network
|
|
|
|
}
|