I’m working with nem-sdk for .js , and I am attempting to follow the mosaicTransfer.js example (https://github.com/QuantumMechanics/NEM-sdk/blob/master/examples/nodejs/mosaicTransfer.js) on the mainnet. I’ve got 99% of the code sorted out, loaded my wallet. However, I notice when I send a transferTransaction, the fee is set to NaN. If I send, I get ‘FAILURE_INSUFFICIENT_FEE’.
Can someone illuminate why the fee defaults to NaN? I have a valid NS, a valid mosaic, valid attachments in the mosaicDefinitionMetaDataPair. I can set the fee to a value manually before sending. However, is there some other step that’s not in the example used to generate the fee? I tried using fees.calculateMosaics(), but that also returns NaN. Puzzled at this. The example code for mosaicTransfer.js mentions fees, but seems to indicate that this will be computed in the definition.
Also, if I set the fee manually to 100000, it sends just fine. But to improve my understanding of API usage, I’d like to use the algorithm provided in the library to compute network fees.
Thanks in advance.