Coin Tunnel
Code examples
If you really love copy and pasting, this is the place for you.
Here is an example for using node-fetch to make a post request to Coin-Tunnel's servers and create a no-buyer transaction.
const fetch = require('node-fetch');
let data = {
callback: "callback url",
usd: 20,
note: {
let headers = {
'Content-Type': 'application/json',
'Authorization': 'API key'
fetch('', {
method: 'POST',
body: JSON.stringify(data),
headers: headers
}).then(res => res.json())
.then(json => {
// show users json.deposit_adr
// tell them to deposit json.price_in_btc
Of course, wait for the callback at the URL you specified like this
const express = require('express');
const app = express();
var bodyParser = require('body-parser')
app.use(bodyParser.urlencoded({ extended: false }))
// parse application/json
let port = 3000;
app.set('port', port);"/callback", async (req, res) => {
if (req.headers.verifac !== "your set verification string (So random people can't trick your server)") return res.status(401).send("Hackers suck");
// now you are certain that the server is who it says it is (Coin Tunnel)
if (req.body.status !== "ok") console.log(req.body) // If something went wrong
let note = req.body.note;
// You can then give the user something based on the note that you set earlier!
return res.send("That was easy!")
app.listen(port, () =>`Listening on port ${port}`));
Copy link