Hi,
I followed the example given in
https://nemlibrary.com/guide/transaction/
How to create a Transfer Transaction with Mosaics
My code is
Rx.Observable.from([
{quantity: 100}
]).flatMap(_ => mosaicHttp.getMosaicTransferableWithAmount(mosaidId, _.quantity))
.toArray()
.map(mosaics => nem.TransferTransaction.createWithMosaics(
nem.TimeWindow.createWithDeadline(),
new nem.Address(myconst.TEscoAddr),
mosaics,
nem.EmptyMessage
)
)
.map(transaction => account.signTransaction(transaction))
.flatMap(signedTransaction => transactionHttp.announceTransaction(signedTransaction))
.subscribe(nemAnnounceResult => {
console.log(nemAnnounceResult);
})
but i get the error
\Coding\NEM\node_modules\rxjs\util\subscribeToResult.js:43
root_1.root.setTimeout(function () { throw err; });
^
EmptyError: no elements in sequence
at new EmptyError (C:\Users\lumia\OneDrive\Besc\Coding\NEM\node_modules\rxjs\util\EmptyError.js:20:26)
at LastSubscriber._complete (C:\Users\lumia\OneDrive\Besc\Coding\NEM\node_modules\rxjs\operators\last.js:114:31)
at LastSubscriber.Subscriber.complete (C:\Users\lumia\OneDrive\Besc\Coding\NEM\node_modules\rxjs\Subscriber.js:114:18)
at FilterSubscriber.Subscriber._complete (C:\Users\lumia\OneDrive\Besc\Coding\NEM\node_modules\rxjs\Subscriber.js:132:26)
at FilterSubscriber.Subscriber.complete (C:\Users\lumia\OneDrive\Besc\Coding\NEM\node_modules\rxjs\Subscriber.js:114:18)
at MergeMapSubscriber._complete (C:\Users\lumia\OneDrive\Besc\Coding\NEM\node_modules\rxjs\operators\mergeMap.js:137:30)
at MergeMapSubscriber.Subscriber.complete (C:\Users\lumia\OneDrive\Besc\Coding\NEM\node_modules\rxjs\Subscriber.js:114:18)
at MapSubscriber.Subscriber._complete (C:\Users\lumia\OneDrive\Besc\Coding\NEM\node_modules\rxjs\Subscriber.js:132:26)
at MapSubscriber.Subscriber.complete (C:\Users\lumia\OneDrive\Besc\Coding\NEM\node_modules\rxjs\Subscriber.js:114:18)
at RetryWhenSubscriber.Subscriber._complete (C:\Users\lumia\OneDrive\Besc\Coding\NEM\node_modules\rxjs\Subscriber.js:132:26)