Send XEM recieve Mosaic PHP or JS code?

Hello,

Im trying to put together a simple interface where someone receives Mosaic upon sending XEM to an address.

Anyone do such an implementation in any web programming launguage so far ?

The closest code i found is one for the NEM Testnet Faucet but even that does not seem to be working
http://namuyan.dip.jp/nem/testnet/index.php

Upon following the instructions here

I sucessfully setup the site but the page gives error under section XEM Faucet
Error has occurred on NIS. Prease wait …

However NIS is sucessfully running

http://127.0.0.1:7890/node/extended-info

{“node”:{“metaData”:{“features”:1,“application”:null,“networkId”:-104,“version”:“0.6.95-BETA”,“platform”:“Oracle Corporation (1.8.0_151) on Linux”},“endpoint”:{“protocol”:“http”,“port”:7890,“host”:“49.197.39.101”},“identity”:{“name”:“TBJGYYNIKXYHMB7NMETWQYU55XWEGXJJQYZ4MDSL”,“public-key”:“53f5cb7383edc729afdc4c7c6154502744671bfe8567cf5b601c2928061ddc78”}},“nisInfo”:{“currentTime”:89945842,“application”:“NEM Deploy”,“startTime”:89939345,“version”:“0.6.95-BETA”,“signer”:null}}

Anyone has experience with the TestNet Faucet code above and know what they did to get around this issue ?

Or anyone with a similar code for recieving mosaic upon sending XEM could share some pointers ?

Many Thanks
Tanveer

1 Like

Ask on telegram @nemprojects. More devs there.

Have you visited this git yet??? It’s super useful and has a whole bunch of examples. I would look at the “transfer” and “mosaic transfer” examples for the project your talking about. You could also use parts of the “monitor” example to verify transaction before you distribute your mosaics.

1 Like

Hi! I am doing exactly this, using typescript and NEM library, in my NEM Supernodes Crowdfunding hackaton project. The supernode account receives XEM and send back XSN mosaics, or receives XSN mosaics and send back XEMs.

You can look the code at: https://github.com/mateuslopes/nemsupernodes-crowdfunding-system