formsend / nano Goto Github PK
View Code? Open in Web Editor NEW⚠️ Moved ⚠️
Home Page: https://github.com/fwd/nano-server
License: MIT License
⚠️ Moved ⚠️
Home Page: https://github.com/fwd/nano-server
License: MIT License
Webhook_url does not seem to be firing. I suspect it might also be due to extra parameters in the url but not sure. This happens even when using POST to get checkout url.
Here are some debug details:
POST url = https://nano.to/{my_nano_address}
body = {
"title": "Test Title",
"plans": [
{
"name": "content name",
"price": "0.01"
}
],
"business": {
"name": "Test business"
},
"success_url": "https://localhost:8000/123",
"cancel_url": "https://localhost:8000",
"webhook_url": "https://ptsv2.com/t/z3ohr-1633032238/post?content_id=modern_art&order_id=test3&code=supersecret",
"raw": "true"
}
Response:
{
"id": "38250487ae2",
"url": "https://api.nano.to/checkout/38250487ae2",
"exp": "2021-10-01T20:07:20.624Z"
}
After completing the payment successfully I check the post test server: https://ptsv2.com/t/z3ohr-1633032238 and nothing shows up there.
We should establish a way for xno.to to handshake the wallet that purchased the domain so they can control the look and feel of their page without using GET params.
If we only handle design and content on pages through GET, then anyone could URL bomb that domain with whatever bad actor content they wanted.
Example:
https://xno.to/Moon?title=Support Bitcoin, Ӿ is bad&description=<p>This was setup to show how you could damage someone’s rep on their page just by sending a complex url, which the owner of this domain can’t stop. Even though the Ӿ would go to the affected party, they would never be able to remove this link.</p>
&image=https://media4.giphy.com/media/LukAHGCMfxMbK/giphy.gif&success_url=https://xno.to/wtrsld
Originally posted by wtrsld November 22, 2021
Hi, I took some time to refine the checkout page for Nano.to
I realize you didn't ask for this but it is my hope that you have this in your back pocket if you need to refine stuff.
Let me know if you want me to get your specs for stuff or how you'd like me to hand off.
Really appreciate you making this, it's freaking cool.
For web
Checkout page no image
Checkout page with image
Hi there,
I was inspecting the source code and I see that Errors are returned rather than throw
. Can I learn the reason why? I see that you are using try
and catch
, but there is a little good reason for doing that. Throwing right in the error will mitigate problems later on.
For example, if you are planning to make use of the test suite (I just started to write some of them), watching throw
s is easier than looking at return values.
I would like to hear your thoughts on that.
Pretty straight forward.
This will drastically increase CoinMarketCap API cost 😅 but f*ck it. It's what the people want.
Discussions welcomed.
For the folks new to NANO landing on your checkout.
What are some options?
nano.org, crypto.com?
History endpoint fixed with #38 but can we add confirmed
and pending
properties so we can programmatically check if a transaction is cemented on the network, and/or pending?
Would pretty much make it very easy to check if a payment is complete by referencing the amount specifically.
~
❯ https --body "https://nano.to/xanza/history/0.85"
{
"account": "nano_3u6b56w7cqd64g9wxkidg5iwnksku8b1rtgcnho1sesgkwpe9rwb7ufktp61",
"amount": "0.85",
"balance": "222006732799999999998231010344960",
"hash": "6A81D58621234FEDDC97867F818686788C317A5E04A65FA9AAA36FC802ECCB29",
"height": "82",
"link": "EC891938555D64138FCECA0B70E1CA4B32D9920C69CAA3EA0CB32E972CC3E389",
"local_timestamp": "1637201394",
"previous": "5C66C4ED30788F80E2339A8BDEFFB89D84230AD3BC4868B147452FC5C759486E",
"representative": "nano_3zapp5z141qpjipsb1jnjdmk49jwqy58i6u6wnyrh6x7woajeyme85shxewt",
"signature": "1BB42776493F600A43AC10B733B4011E62C5593375F2C10013E7EA399CA18663E5BD4A5ACC358BABAD02A189EFC5058B8EDCE",
"subtype": "send",
"type": "state",
"work": "31d2d5b3ba7affbb"
}
Above is what the endpoint looks like, and below, what would be amazing;
~
❯ https --body "https://nano.to/xanza/history/0.85"
{
"account": "nano_3u6b56w7cqd64g9wxkidg5iwnksku8b1rtgcnho1sesgkwpe9rwb7ufktp61",
"amount": "0.85",
"balance": "222006732799999999998231010344960",
"hash": "6A81D58621234FEDDC97867F818686788C317A5E04A65FA9AAA36FC802ECCB29",
"height": "82",
"link": "EC891938555D64138FCECA0B70E1CA4B32D9920C69CAA3EA0CB32E972CC3E389",
"local_timestamp": "1637201394",
"previous": "5C66C4ED30788F80E2339A8BDEFFB89D84230AD3BC4868B147452FC5C759486E",
"representative": "nano_3zapp5z141qpjipsb1jnjdmk49jwqy58i6u6wnyrh6x7woajeyme85shxewt",
"signature": "1BB42776493F600A43AC10B733B4011E62C5593375F2C10013E7EA399CA18663E5BD4A5ACC358BABAD02A189EFC5058B8EDCE",
"subtype": "send",
"type": "state",
"complete": true, // complete = {true,false}
"pending": false, // pending = {true,false}
"work": "31d2d5b3ba7affbb"
}
This is more a URL limitation than a bug.
For example:
https://nano.to/moon?success_url=https://mywebsite.com/success?id={{id}}
This would not work as intended because of the second '?' in the URL
Of course this is not an issue with POST requests.
Here's some example code for bypassing this issue meanwhile.
// npm install axios
axios.post('https://nano.to/[NANO_ADDRESS_OR_LEASED_NAME]', {
"title": "Donate",
"price": 10,
"business": {
"name": "McDonalds",
"logo": "https://www.tailorbrands.com/wp-content/uploads/2020/07/mcdonalds-logo.jpg"
},
"success_url": "https://mywebsite.com/success?id={{id}}&anotherParam=hello",
"cancel_url": "https://google.com"
})
Example response:
{
"id": "666ee7bf26a",
"url": "https://api.nano.to/checkout/666ee7bf26a",
"exp": "2021-09-23T01:51:23.853Z"
}
It's important to note that Checkouts urls have a 4 hour lifespan. After, they expire.
All the URL params that can be passed via GET, also work via POST.
Twilio part is easy.
You'd have to pre-purchase SMS credits??
Not sure.
Hi @santiesque,
Today, I could not get a successful run of the testing suite like I did yesterday. Now, each API end-point is returning HTML instead of JSON. I also check that manually (https://api.nano.to/name/moon) in a browser. Did something in the API layer change all the sudden?
Link: https://nano.to/moon/account
Creating this issue for myself later.
NanoCrawler pending response:
{
"total": 1,
"blocks": [
{
"type": "pending",
"amount": "3950000000000001024000000000",
"hash": "{confirmed hash}",
"source": "{test account}",
"timestamp": null
}
],
"pendingBalance": "3950000000000001024000000000"
}
QR code uses amount "3950000000000001024000000000". I think "3950000000000000000000000000" is being sent to the backend check at https://api.nano.to/checkout/{cart_id}/check/nano
Back Nov 5, 3PM EST
Only the rental system of Usernames is temporarily unavailable.
Other 'Username' related APIs are not affected.
I have a webhook_url 'Add Credits' I am experimenting with. The only way to truly keep webhoook_url secret is to create a checkout session server side.
It would be very convenient if Nano.to had a concept of an 'App' where webhook_url is already saved. A basic api flow:
A new endpoint that creates an app for a specific address.
Post endpoint: https://nano.to/{nano_address}/newApp
Body:
{
"title": "New Order",
"plans": [
{
"name": "product 1",
"price": "0.1"
}
],
"metaData": { "token": "12345" },
"success_url": "success_url",
"cancel_url": "cancel_url",
"webhook_url": "https://Add_Credits"
}
Response:
{
"app_code": "12345"
}
This call only needs to be done once.
Client can then make call: GET https://nano.to/{nano_address}/{app_code}/getCheckOut
Response
{
"id": "6ff2a2435def2",
"url": "https://nano.to/checkout/6ff2a2435def2",
"exp": "April 16, 2022 9:35 AM EST/UTC−05:00"
}
If webhook status != 200 then direct user to cancel_url. I am working on a proof of concept and this would simplify a lot of things. Maybe something like ?force_webhook=true
In my webhook logic I am adding security checks to make sure the nano.to params were not messed with.
API will be down for a few minutes, up to an hour. Starting 8PM Eastern Time.
I was playing around with the API and decided to create a little CLI to generate a QR code in the terminal that can be scanned on your device.
It has two modes, one for generating a QR code exclusively for nano.to and another that uses nano.to to get a usernames address and generate a QR code that can be scanned using regular wallet apps or scanner apps.
This is the current check for Nano pending transactions
await server.http.get(`https://api.nanocrawler.cc/v2/accounts/${order.address}/pending`)
I need something like this for BTC & others.
Anyone know a good API?
async payment(address, amount) {
if (!address) return new Error("First parameter, NANO address is missing.")
if (!amount) return new Error("Second parameter, NANO amount is missing.")
var history = await this.history(address)
history = history.find(a => a.amount == amount || a.amount == `${amount}0`) || false
if (history && history.hash) {
return history
}
var pending = await this.pending(address)
pending = pending.find(a => a.amount == amount || a.amount == `${amount}0`) || false
if (pending && pending.hash) {
return pending
}
return false
},
https://nano.to/xanza/history/0.85 -> "page not found"
If you send a request like this:
https://nano.to/Moon?currency=HUF
The documentation doesn't mention anything about being able to pass currency value, but if you do then you will get some weird results;
As you can see HUF
appears multiple times, but the conversion rate is still USD
, which is very misleading as 1$=310Ft
.
I would be really grateful if you could add a feature to select a currency when creating a checkout page. If you do, then maybe I will drop a few NANOs in your wallet as a reward ;)
Add logic to auto check payment. A polling method with backoff factor and max retry would work. If max retries are exceeded then revert to manual check payment button.
I think the Checkout API and the world would benefit from Nano.to having a separate, public QR generating API endpoint.
Something like this:
GET: https://api.nano.to/qr?address=nano_37...&color=red&icon=nano
Etc.
Discussions welcomed.
ht -b https://nano.to/pay/xanza amount==5000000000000000000000000000000
Have also tried whole numbers, and not raw. Nothing is respected. There's also seems to be a bug with the username where extra characters are added for no reason.
NanoLooker is better looking.
Nanocrawler still reliable AF tho. Nothing personal.
Thoughts? Will go into effect next week.
Creating issue for myself later.
If this happed to you, and you're reading this.
Please email esteban[at]nano.to and I'll correct it. Takes a second.
My first born Nano node. 🥲
US-1 (New York, New York)
No RPC access. It's for Nano.to.
Current qr codes are showing an amount in decimal(ex: 1.844997), but natrium and nault only accept this amount in raw(ex: 1844997000000000000000000000000). Also, to put the nano account it needs to put "nano:" before the address.
❌nano_37y6iq8m1zx9inwkkcgqh34kqsihzpjfwgp9jir8xpb9jrcwhkmoxpo61f4o?amount=1.844997
✔️nano:nano_37y6iq8m1zx9inwkkcgqh34kqsihzpjfwgp9jir8xpb9jrcwhkmoxpo61f4o?amount=1844997000000000000000000000000
example response from https://github.com/formsend/nano#get-nano-transaction-by-amount :
{
"type": "state",
"representative": "nano_3kqdiqmqiojr1aqqj51aq8bzz5jtwnkmhb38qwf3ppngo8uhhzkdkn7up7rp",
"link": "F082A253FD6BD1376F28256A0F342CBD5FF1A3A8848359487119EA10EC06CF09",
"balance": "0.215288",
"previous": "F082A253FD6BD1376F28256A0F342CBD5FF1A3A8848359487119EA10EC06CF09",
"subtype": "receive",
"account": "nano_37y6iq8m1zx9inwkkcgqh34kqsihzpjfwgp9jir8xpb9jrcwhkmoxpo61f4o",
"amount": "0.02143",
"height": "244",
"hash": "94E74C2EDAE153C181858BD28CFB67BA990EC8D1C43427658A118C947121A995",
"work": "610bb7829e958415",
"signature": "E09B7AF936EE4CE248630F4D03407B5BB40E258FC06B841472A30FE4FF423962F5E2201BAB321B39C10C250169D8033EB1600D9D58E39B271B2B58CC7CDB9508",
"balance_raw": "215288000000000000000000000000",
"amount_raw": "21430000000000000000000000000"
}
the following fields are excluded for transactions that are ready to be received:
docs could either include a similar list or an example response for a receivable transaction (not in account history)
-
the following fields are missing from the example:
Hey I have a suggestion!
Can we make it so that underscores "_" will be treated as spaces in the title and description since we can't put spaces in URLs
Cheers :)
Lot of people asking for this. I agree.
When a vanity name is up for renewal, notify the owner and provide a grace period relative to term leased. During the grace period, only the original nano address will be able to purchase again.
Notification
The easiest way to implement is by passing a ?notify=[email protected] URL parameter when requesting reservation link from the API
Should we offer SMS notification as well?
Important to note that notification information will NOT be public information after registration.
FYI: You can check the status of any name by using '?whois=true' param on any nano.to name.
Ex: https://nano.to/moon?whois=true
Grace Periods
Thoughts, comments, concerns?
Spelling
Grammar / sentence
Please let me know if there are things I got wrong. English is not my first language 😄
nano_1y9apw56b3d9j6di4d3yx33u53bs3rheemofd1uknfikajy8b1zj7owuik3d
Originally posted by Niush November 22, 2021
GET: NANO Block By Hash is returning 524 Timeout error through Cloudflare. @santiesque
Example:
https://api.nano.to/hash/94E74C2EDAE153C181858BD28CFB67BA990EC8D1C43427658A118C947121A995
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.