Skip to content

Commit 6d36da5

Browse files
Update documentation for v0.1.3
1 parent 0b4b1f8 commit 6d36da5

File tree

7 files changed

+142
-48
lines changed

7 files changed

+142
-48
lines changed

docs/messaging.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Represents a message send to a far end node
5353
| msg | string | | the raw message itself to be sent to the far end node |
5454
| pubkey | string | | The public key of the far end lightning node running IMP |
5555
| amount | int64 | | Optional satoshi amount to send along with the message, defaults to 1 sat. |
56+
| reply_to_id | string | | Optional ID of the message that this message is replying to. |
5657

5758

5859

go/proto/imp/api/messaging/messaging.pb.go

Lines changed: 15 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/sendmessagerequest.js

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ proto.messaging.SendMessageRequest.toObject = function(includeInstance, msg) {
7272
var f, obj = {
7373
msg: jspb.Message.getFieldWithDefault(msg, 1, ""),
7474
pubkey: jspb.Message.getFieldWithDefault(msg, 2, ""),
75-
amount: jspb.Message.getFieldWithDefault(msg, 3, 0)
75+
amount: jspb.Message.getFieldWithDefault(msg, 3, 0),
76+
replyToId: jspb.Message.getFieldWithDefault(msg, 4, "")
7677
};
7778

7879
if (includeInstance) {
@@ -121,6 +122,10 @@ proto.messaging.SendMessageRequest.deserializeBinaryFromReader = function(msg, r
121122
var value = /** @type {number} */ (reader.readInt64());
122123
msg.setAmount(value);
123124
break;
125+
case 4:
126+
var value = /** @type {string} */ (reader.readString());
127+
msg.setReplyToId(value);
128+
break;
124129
default:
125130
reader.skipField();
126131
break;
@@ -171,6 +176,13 @@ proto.messaging.SendMessageRequest.serializeBinaryToWriter = function(message, w
171176
f
172177
);
173178
}
179+
f = message.getReplyToId();
180+
if (f.length > 0) {
181+
writer.writeString(
182+
4,
183+
f
184+
);
185+
}
174186
};
175187

176188

@@ -226,3 +238,21 @@ proto.messaging.SendMessageRequest.prototype.getAmount = function() {
226238
proto.messaging.SendMessageRequest.prototype.setAmount = function(value) {
227239
return jspb.Message.setProto3IntField(this, 3, value);
228240
};
241+
242+
243+
/**
244+
* optional string reply_to_id = 4;
245+
* @return {string}
246+
*/
247+
proto.messaging.SendMessageRequest.prototype.getReplyToId = function() {
248+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
249+
};
250+
251+
252+
/**
253+
* @param {string} value
254+
* @return {!proto.messaging.SendMessageRequest} returns this
255+
*/
256+
proto.messaging.SendMessageRequest.prototype.setReplyToId = function(value) {
257+
return jspb.Message.setProto3StringField(this, 4, value);
258+
};

openapiv2/proto/imp/api/messaging/messaging.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ var SwaggerJSON = `
7575
"amount": {
7676
"type": "string",
7777
"format": "int64"
78+
},
79+
"replyToId": {
80+
"type": "string"
7881
}
7982
},
8083
"title": "*\nRepresents a message send to a far end node"

openapiv2/proto/imp/api/messaging/messaging.swagger.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@
7272
"amount": {
7373
"type": "string",
7474
"format": "int64"
75+
},
76+
"replyToId": {
77+
"type": "string"
7578
}
7679
},
7780
"title": "*\nRepresents a message send to a far end node"

proto/messaging.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ message SendMessageRequest {
5050
string msg = 1; // the raw message itself to be sent to the far end node
5151
string pubkey = 2; // The public key of the far end lightning node running IMP
5252
int64 amount = 3; // Optional satoshi amount to send along with the message, defaults to 1 sat.
53+
string reply_to_id = 4; // Optional ID of the message that this message is replying to.
5354
}
5455

5556
/**

rust/messaging.rs

Lines changed: 88 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ pub struct SendMessageRequest {
2929
pub msg: ::std::string::String,
3030
pub pubkey: ::std::string::String,
3131
pub amount: i64,
32+
pub reply_to_id: ::std::string::String,
3233
// special fields
3334
pub unknown_fields: ::protobuf::UnknownFields,
3435
pub cached_size: ::protobuf::CachedSize,
@@ -111,6 +112,32 @@ impl SendMessageRequest {
111112
pub fn set_amount(&mut self, v: i64) {
112113
self.amount = v;
113114
}
115+
116+
// string reply_to_id = 4;
117+
118+
119+
pub fn get_reply_to_id(&self) -> &str {
120+
&self.reply_to_id
121+
}
122+
pub fn clear_reply_to_id(&mut self) {
123+
self.reply_to_id.clear();
124+
}
125+
126+
// Param is passed by value, moved
127+
pub fn set_reply_to_id(&mut self, v: ::std::string::String) {
128+
self.reply_to_id = v;
129+
}
130+
131+
// Mutable pointer to the field.
132+
// If field is not initialized, it is initialized with default value first.
133+
pub fn mut_reply_to_id(&mut self) -> &mut ::std::string::String {
134+
&mut self.reply_to_id
135+
}
136+
137+
// Take field
138+
pub fn take_reply_to_id(&mut self) -> ::std::string::String {
139+
::std::mem::replace(&mut self.reply_to_id, ::std::string::String::new())
140+
}
114141
}
115142

116143
impl ::protobuf::Message for SendMessageRequest {
@@ -135,6 +162,9 @@ impl ::protobuf::Message for SendMessageRequest {
135162
let tmp = is.read_int64()?;
136163
self.amount = tmp;
137164
},
165+
4 => {
166+
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.reply_to_id)?;
167+
},
138168
_ => {
139169
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
140170
},
@@ -156,6 +186,9 @@ impl ::protobuf::Message for SendMessageRequest {
156186
if self.amount != 0 {
157187
my_size += ::protobuf::rt::value_size(3, self.amount, ::protobuf::wire_format::WireTypeVarint);
158188
}
189+
if !self.reply_to_id.is_empty() {
190+
my_size += ::protobuf::rt::string_size(4, &self.reply_to_id);
191+
}
159192
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
160193
self.cached_size.set(my_size);
161194
my_size
@@ -171,6 +204,9 @@ impl ::protobuf::Message for SendMessageRequest {
171204
if self.amount != 0 {
172205
os.write_int64(3, self.amount)?;
173206
}
207+
if !self.reply_to_id.is_empty() {
208+
os.write_string(4, &self.reply_to_id)?;
209+
}
174210
os.write_unknown_fields(self.get_unknown_fields())?;
175211
::std::result::Result::Ok(())
176212
}
@@ -224,6 +260,11 @@ impl ::protobuf::Message for SendMessageRequest {
224260
|m: &SendMessageRequest| { &m.amount },
225261
|m: &mut SendMessageRequest| { &mut m.amount },
226262
));
263+
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
264+
"reply_to_id",
265+
|m: &SendMessageRequest| { &m.reply_to_id },
266+
|m: &mut SendMessageRequest| { &mut m.reply_to_id },
267+
));
227268
::protobuf::reflect::MessageDescriptor::new_pb_name::<SendMessageRequest>(
228269
"SendMessageRequest",
229270
fields,
@@ -243,6 +284,7 @@ impl ::protobuf::Clear for SendMessageRequest {
243284
self.msg.clear();
244285
self.pubkey.clear();
245286
self.amount = 0;
287+
self.reply_to_id.clear();
246288
self.unknown_fields.clear();
247289
}
248290
}
@@ -421,49 +463,53 @@ impl ::protobuf::reflect::ProtobufValue for SendMessageResponse {
421463
static file_descriptor_proto_data: &'static [u8] = b"\
422464
\n'proto/imp/api/messaging/messaging.proto\x12\tmessaging\x1a\x1cgoogle/\
423465
api/annotations.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\
424-
\"V\n\x12SendMessageRequest\x12\x10\n\x03msg\x18\x01\x20\x01(\tR\x03msg\
466+
\"v\n\x12SendMessageRequest\x12\x10\n\x03msg\x18\x01\x20\x01(\tR\x03msg\
425467
\x12\x16\n\x06pubkey\x18\x02\x20\x01(\tR\x06pubkey\x12\x16\n\x06amount\
426-
\x18\x03\x20\x01(\x03R\x06amount\"%\n\x13SendMessageResponse\x12\x0e\n\
427-
\x02id\x18\x01\x20\x01(\tR\x02id2v\n\tMessaging\x12i\n\x0bSendMessage\
428-
\x12\x1d.messaging.SendMessageRequest\x1a\x1e.messaging.SendMessageRespo\
429-
nse\"\x1b\x82\xd3\xe4\x93\x02\x15\"\x10/v1/message/send:\x01*B\xc9\x01Z#\
430-
github.com/imperviousai/freeimp/gen\x92A\xa0\x01\x12A\n\x12Messaging\x20\
431-
Services\"&\n\rImpervious\x20AI\x12\x15https://impervious.ai2\x031.0*\
432-
\x03\x01\x02\x042\x10application/json:\x10application/jsonr2\n\x14Docume\
433-
ntation\x20on\x20IMP\x12\x1ahttps://docs.impervious.aiJ\xd3\x07\n\x06\
434-
\x12\x04\x01\0;\x01\n>\n\x01\x0c\x12\x03\x01\0\x12\x1a4/\x20Allows\x20fo\
435-
r\x20p2p\x20messaging\x20between\x20Impervious\x20nodes\n\n\x08\n\x01\
436-
\x02\x12\x03\x03\0\x12\n\x08\n\x01\x08\x12\x03\x05\0:\n\t\n\x02\x08\x0b\
437-
\x12\x03\x05\0:\n\t\n\x02\x03\0\x12\x03\x07\0&\n\t\n\x02\x03\x01\x12\x03\
438-
\x08\08\n\t\n\x01\x08\x12\x04\n\0\x1c\x02\n\x0b\n\x03\x08\x92\x08\x12\
439-
\x04\n\0\x1c\x02\nT\n\x02\x06\0\x12\x04!\0+\x01\x1aH*\n\x20Messaging\x20\
440-
service\x20allows\x20for\x20p2p\x20messaging\x20between\x20Impervious\
441-
\x20nodes.\n\n\n\n\x03\x06\0\x01\x12\x03!\x08\x11\nC\n\x04\x06\0\x02\0\
442-
\x12\x04%\x08*\t\x1a5*\n\x20SendMessage\x20sends\x20a\x20text\x20message\
443-
\x20to\x20another\x20node.\n\n\x0c\n\x05\x06\0\x02\0\x01\x12\x03%\x0c\
444-
\x17\n\x0c\n\x05\x06\0\x02\0\x02\x12\x03%\x18*\n\x0c\n\x05\x06\0\x02\0\
445-
\x03\x12\x03%5H\n\r\n\x05\x06\0\x02\0\x04\x12\x04&\x10)\x12\n\x11\n\t\
446-
\x06\0\x02\0\x04\xb0\xca\xbc\"\x12\x04&\x10)\x12\n;\n\x02\x04\0\x12\x040\
447-
\04\x01\x1a/*\n\x20Represents\x20a\x20message\x20send\x20to\x20a\x20far\
448-
\x20end\x20node\n\n\n\n\x03\x04\0\x01\x12\x030\x08\x1a\nD\n\x04\x04\0\
449-
\x02\0\x12\x031\x08\x17\"7\x20the\x20raw\x20message\x20itself\x20to\x20b\
450-
e\x20sent\x20to\x20the\x20far\x20end\x20node\n\n\x0c\n\x05\x04\0\x02\0\
451-
\x05\x12\x031\x08\x0e\n\x0c\n\x05\x04\0\x02\0\x01\x12\x031\x0f\x12\n\x0c\
452-
\n\x05\x04\0\x02\0\x03\x12\x031\x15\x16\nG\n\x04\x04\0\x02\x01\x12\x032\
453-
\x08\x1a\":\x20The\x20public\x20key\x20of\x20the\x20far\x20end\x20lightn\
454-
ing\x20node\x20running\x20IMP\n\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x032\
455-
\x08\x0e\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x032\x0f\x15\n\x0c\n\x05\x04\
456-
\0\x02\x01\x03\x12\x032\x18\x19\nY\n\x04\x04\0\x02\x02\x12\x033\x08\x19\
457-
\"L\x20Optional\x20satoshi\x20amount\x20to\x20send\x20along\x20with\x20t\
458-
he\x20message,\x20defaults\x20to\x201\x20sat.\n\n\x0c\n\x05\x04\0\x02\
459-
\x02\x05\x12\x033\x08\r\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x033\x0e\x14\n\
460-
\x0c\n\x05\x04\0\x02\x02\x03\x12\x033\x17\x18\n>\n\x02\x04\x01\x12\x049\
461-
\0;\x01\x1a2*\n\x20Represents\x20a\x20response\x20back\x20from\x20a\x20s\
462-
ent\x20message\n\n\n\n\x03\x04\x01\x01\x12\x039\x08\x1b\n\"\n\x04\x04\
463-
\x01\x02\0\x12\x03:\x08\x16\"\x15\x20returned\x20message\x20ID\n\n\x0c\n\
464-
\x05\x04\x01\x02\0\x05\x12\x03:\x08\x0e\n\x0c\n\x05\x04\x01\x02\0\x01\
465-
\x12\x03:\x0f\x11\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03:\x14\x15b\x06pro\
466-
to3\
468+
\x18\x03\x20\x01(\x03R\x06amount\x12\x1e\n\x0breply_to_id\x18\x04\x20\
469+
\x01(\tR\treplyToId\"%\n\x13SendMessageResponse\x12\x0e\n\x02id\x18\x01\
470+
\x20\x01(\tR\x02id2v\n\tMessaging\x12i\n\x0bSendMessage\x12\x1d.messagin\
471+
g.SendMessageRequest\x1a\x1e.messaging.SendMessageResponse\"\x1b\x82\xd3\
472+
\xe4\x93\x02\x15\"\x10/v1/message/send:\x01*B\xc9\x01Z#github.com/imperv\
473+
iousai/freeimp/gen\x92A\xa0\x01\x12A\n\x12Messaging\x20Services\"&\n\rIm\
474+
pervious\x20AI\x12\x15https://impervious.ai2\x031.0*\x03\x01\x02\x042\
475+
\x10application/json:\x10application/jsonr2\n\x14Documentation\x20on\x20\
476+
IMP\x12\x1ahttps://docs.impervious.aiJ\xca\x08\n\x06\x12\x04\x01\0<\x01\
477+
\n>\n\x01\x0c\x12\x03\x01\0\x12\x1a4/\x20Allows\x20for\x20p2p\x20messagi\
478+
ng\x20between\x20Impervious\x20nodes\n\n\x08\n\x01\x02\x12\x03\x03\0\x12\
479+
\n\x08\n\x01\x08\x12\x03\x05\0:\n\t\n\x02\x08\x0b\x12\x03\x05\0:\n\t\n\
480+
\x02\x03\0\x12\x03\x07\0&\n\t\n\x02\x03\x01\x12\x03\x08\08\n\t\n\x01\x08\
481+
\x12\x04\n\0\x1c\x02\n\x0b\n\x03\x08\x92\x08\x12\x04\n\0\x1c\x02\nT\n\
482+
\x02\x06\0\x12\x04!\0+\x01\x1aH*\n\x20Messaging\x20service\x20allows\x20\
483+
for\x20p2p\x20messaging\x20between\x20Impervious\x20nodes.\n\n\n\n\x03\
484+
\x06\0\x01\x12\x03!\x08\x11\nC\n\x04\x06\0\x02\0\x12\x04%\x08*\t\x1a5*\n\
485+
\x20SendMessage\x20sends\x20a\x20text\x20message\x20to\x20another\x20nod\
486+
e.\n\n\x0c\n\x05\x06\0\x02\0\x01\x12\x03%\x0c\x17\n\x0c\n\x05\x06\0\x02\
487+
\0\x02\x12\x03%\x18*\n\x0c\n\x05\x06\0\x02\0\x03\x12\x03%5H\n\r\n\x05\
488+
\x06\0\x02\0\x04\x12\x04&\x10)\x12\n\x11\n\t\x06\0\x02\0\x04\xb0\xca\xbc\
489+
\"\x12\x04&\x10)\x12\n;\n\x02\x04\0\x12\x040\05\x01\x1a/*\n\x20Represent\
490+
s\x20a\x20message\x20send\x20to\x20a\x20far\x20end\x20node\n\n\n\n\x03\
491+
\x04\0\x01\x12\x030\x08\x1a\nD\n\x04\x04\0\x02\0\x12\x031\x08\x17\"7\x20\
492+
the\x20raw\x20message\x20itself\x20to\x20be\x20sent\x20to\x20the\x20far\
493+
\x20end\x20node\n\n\x0c\n\x05\x04\0\x02\0\x05\x12\x031\x08\x0e\n\x0c\n\
494+
\x05\x04\0\x02\0\x01\x12\x031\x0f\x12\n\x0c\n\x05\x04\0\x02\0\x03\x12\
495+
\x031\x15\x16\nG\n\x04\x04\0\x02\x01\x12\x032\x08\x1a\":\x20The\x20publi\
496+
c\x20key\x20of\x20the\x20far\x20end\x20lightning\x20node\x20running\x20I\
497+
MP\n\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x032\x08\x0e\n\x0c\n\x05\x04\0\
498+
\x02\x01\x01\x12\x032\x0f\x15\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x032\x18\
499+
\x19\nY\n\x04\x04\0\x02\x02\x12\x033\x08\x19\"L\x20Optional\x20satoshi\
500+
\x20amount\x20to\x20send\x20along\x20with\x20the\x20message,\x20defaults\
501+
\x20to\x201\x20sat.\n\n\x0c\n\x05\x04\0\x02\x02\x05\x12\x033\x08\r\n\x0c\
502+
\n\x05\x04\0\x02\x02\x01\x12\x033\x0e\x14\n\x0c\n\x05\x04\0\x02\x02\x03\
503+
\x12\x033\x17\x18\nK\n\x04\x04\0\x02\x03\x12\x034\x08\x1f\">\x20Optional\
504+
\x20ID\x20of\x20the\x20message\x20that\x20this\x20message\x20is\x20reply\
505+
ing\x20to.\n\n\x0c\n\x05\x04\0\x02\x03\x05\x12\x034\x08\x0e\n\x0c\n\x05\
506+
\x04\0\x02\x03\x01\x12\x034\x0f\x1a\n\x0c\n\x05\x04\0\x02\x03\x03\x12\
507+
\x034\x1d\x1e\n>\n\x02\x04\x01\x12\x04:\0<\x01\x1a2*\n\x20Represents\x20\
508+
a\x20response\x20back\x20from\x20a\x20sent\x20message\n\n\n\n\x03\x04\
509+
\x01\x01\x12\x03:\x08\x1b\n\"\n\x04\x04\x01\x02\0\x12\x03;\x08\x16\"\x15\
510+
\x20returned\x20message\x20ID\n\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03;\
511+
\x08\x0e\n\x0c\n\x05\x04\x01\x02\0\x01\x12\x03;\x0f\x11\n\x0c\n\x05\x04\
512+
\x01\x02\0\x03\x12\x03;\x14\x15b\x06proto3\
467513
";
468514

469515
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

0 commit comments

Comments
 (0)