Skip to content

Commit 836e03c

Browse files
committed
return whole bundle on publishing
1 parent a2ad8f8 commit 836e03c

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

examples/constructAndPublishLater.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ const iota = require('@iota/core').composeAPI({
3939

4040
console.log("Publishing created messages...")
4141
// if optional parameter message is passed, message is stored locally after publishing
42-
console.log("Bundle 1:", await raam.publishMessageTransfers(mt1.transfers, {message: mt1.message}))
43-
console.log("Bundle 2:", await raam.publishMessageTransfers(mt2.transfers, {message: mt2.message}))
42+
console.log("Bundle 1:", (await raam.publishMessageTransfers(mt1.transfers, {message: mt1.message}))[0].bundle)
43+
console.log("Bundle 2:", (await raam.publishMessageTransfers(mt2.transfers, {message: mt2.message}))[0].bundle)
4444

4545
const reader = new RAAMReader(raam.channelRoot, {iota, channelPassword: "PASSWORD"})
4646
response = await reader.fetch({end: 3})

examples/simpleReadWrite.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ const iota = require('@iota/core').composeAPI({
2727
console.log("Messages:", messages)
2828

2929
console.log("Publishing 2 messages...")
30-
console.log("Bundle 1:", await raam.publish("HELLOIOTA", {messagePassword: messagePasswords[0]}))
30+
console.log("Bundle 1:", (await raam.publish("HELLOIOTA", {messagePassword: messagePasswords[0]}))[0].bundle)
3131
const {channelRoot: nextRoot} = await RAAM.fromSeed(generateSeed(), {security: 1, height: 2})
32-
console.log("Bundle 2:", await raam.publish("", {index: 3, messagePassword: messagePasswords[2], nextRoot}))
32+
console.log("Bundle 2:", (await raam.publish("", {index: 3, messagePassword: messagePasswords[2], nextRoot}))[0].bundle)
3333

3434
let response = await raam.fetch({end: 3, messagePasswords})
3535
console.log("Messages:", response.messages)
@@ -49,7 +49,7 @@ const iota = require('@iota/core').composeAPI({
4949
response.errors.forEach(e => console.error(e))
5050
response.skipped.forEach(s => console.error(s))
5151

52-
console.log("Bundle 3:", await raam.publish("SECONDMESSAGE", {index: 1, messagePassword: messagePasswords[1]}))
52+
console.log("Bundle 3:", (await raam.publish("SECONDMESSAGE", {index: 1, messagePassword: messagePasswords[1]}))[0].bundle)
5353

5454
response = await reader.fetch({index: 1, messagePasswords})
5555
console.log("Message:", response.messages)

lib/raam.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class RAAM extends RAAMReader {
130130
* @param {API} [options.iota = this.iota] - A composed IOTA API for communication with a full node providing POW.
131131
*
132132
* @returns {Promise}
133-
* @fulfil {Trytes} - The bundle hash of the attached message.
133+
* @fulfil {Transaction[]} - The bundle of the attached message.
134134
* @reject {Error}
135135
* - if message is too long
136136
*/
@@ -143,7 +143,7 @@ class RAAM extends RAAMReader {
143143
}
144144
this.cursor = this.messages.length
145145
}
146-
return bundle[0].bundle
146+
return bundle
147147
}
148148

149149
/**
@@ -163,7 +163,7 @@ class RAAM extends RAAMReader {
163163
* @param {Int8Array} [options.nextRoot] - The root of another channel, used for branching or when channel is exausted.
164164
*
165165
* @returns {Promise}
166-
* @fulfil {Trytes} - The bundle hash of the attached message.
166+
* @fulfil {Transaction[]} - The bundle of the attached message.
167167
* @reject {Error}
168168
* - if message is too long
169169
* - if message isn't formatted as trytes.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "raam.client.js",
3-
"version": "0.7.4",
3+
"version": "0.7.5",
44
"description": "A messaging protocol for the IOTA tangle allowing access of arbitrary messages in O(1)",
55
"keywords": [
66
"iota",

types/raam.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export class RAAM extends RAAMReader {
132132
* @param {API} [options.iota = this.iota] - A composed IOTA API for communication with a full node providing POW.
133133
*
134134
* @returns {Promise}
135-
* @fulfil {Hash} - The bundle hash of the attached message.
135+
* @fulfil {Transaction[]} - The bundle of the attached message.
136136
* @reject {Error}
137137
* - if message is too long
138138
*/
@@ -156,7 +156,7 @@ export class RAAM extends RAAMReader {
156156
* @param {Int8Array} [options.nextRoot] - The root of another channel, used for branching or when channel is exausted.
157157
*
158158
* @returns {Promise}
159-
* @fulfil {Hash} - The bundle hash of the attached message.
159+
* @fulfil {Transaction[]} - The bundle of the attached message.
160160
* @reject {Error}
161161
* - if message is too long
162162
* - if message isn't formatted as trytes.

0 commit comments

Comments
 (0)