Open hathbanger opened 1 year ago
@hathbanger I'm a little confused that we're using snake case here.. didn't you want to use camel?
@berryhill looks to be a bug somewhere in the parsing for this mega wallet:
req:
http://localhost:3000/api/inscriptions?walletAddress=bc1pydf2px4mq8q2w85t2854fmjugkcja20849jde70n34l6k5thr08qqhx8v8
logs:
{"time":"2023-07-25T08:45:40.980197+02:00","id":"","remote_ip":"::1","host":"localhost:3444","method":"GET","uri":"/addresses/bc1pydf2px4mq8q2w85t2854fmjugkcja20849jde70n34l6k5thr08qqhx8v8/inscriptions?page=1&limit=100","user_agent":"axios/1.4.0","status":500,"error":"","latency":234537334,"latency_human":"234.537334ms","bytes_in":0,"bytes_out":13}
{"time":"2023-07-25T08:46:01.349826+02:00","level":"ERROR","prefix":"echo","file":"best_in_slot.go","line":"88","message":"invalid character 'T' looking for beginning of value"}
{"time":"2023-07-25T08:46:01.349868+02:00","level":"ERROR","prefix":"echo","file":"inscriptions.go","line":"26","message":"invalid character 'T' looking for beginning of value"}
here's the call to BIS for posterity:
curl --location 'https://api.bestinslot.xyz/v3/wallet/inscriptions?address=bc1pydf2px4mq8q2w85t2854fmjugkcja20849jde70n34l6k5thr08qqhx8v8&sort_by=inscr_num&order=asc&offset=0&count=100' \
--header 'x-api-key: xxx'
just started working.
tried running it again and it failed:
{"time":"2023-07-25T09:08:45.903422+02:00","id":"","remote_ip":"::1","host":"localhost:3444","method":"GET","uri":"/addresses/bc1pydf2px4mq8q2w85t2854fmjugkcja20849jde70n34l6k5thr08qqhx8v8/inscriptions?page=2&limit=100","user_agent":"axios/1.4.0","status":200,"error":"","latency":362969500,"latency_human":"362.9695ms","bytes_in":0,"bytes_out":102754}
{"time":"2023-07-25T09:08:46.176827+02:00","level":"ERROR","prefix":"echo","file":"best_in_slot.go","line":"88","message":"invalid character 'T' looking for beginning of value"}
{"time":"2023-07-25T09:08:46.176881+02:00","level":"ERROR","prefix":"echo","file":"inscriptions.go","line":"26","message":"invalid character 'T' looking for beginning of value"}
{"time":"2023-07-25T09:08:46.176923+02:00","id":"","remote_ip":"::1","host":"localhost:3444","method":"GET","uri":"/addresses/bc1pydf2px4mq8q2w85t2854fmjugkcja20849jde70n34l6k5thr08qqhx8v8/inscriptions?page=3&limit=100","user_agent":"axios/1.4.0","status":500,"error":"","latency":262402666,"latency_human":"262.402666ms","bytes_in":0,"bytes_out":13}
{"time":"2023-07-25T09:08:47.682732+02:00","level":"ERROR","prefix":"echo","file":"best_in_slot.go","line":"88","message":"invalid character 'T' looking for beginning of value"}
{"time":"2023-07-25T09:08:47.682768+02:00","level":"ERROR","prefix":"echo","file":"inscriptions.go","line":"26","message":"invalid character 'T' looking for beginning of value"}
{"time":"2023-07-25T09:08:47.682796+02:00","id":"","remote_ip":"::1","host":"localhost:3444","method":"GET","uri":"/addresses/bc1pydf2px4mq8q2w85t2854fmjugkcja20849jde70n34l6k5thr08qqhx8v8/inscriptions?page=1&limit=100","user_agent":"axios/1.4.0","status":500,"error":"","latency":270989125,"latency_human":"270.989125ms","bytes_in":0,"bytes_out":13}
ok just ran it AGAIN and it worked:
{"time":"2023-07-25T09:09:50.759425+02:00","id":"","remote_ip":"::1","host":"localhost:3444","method":"GET","uri":"/addresses/bc1pydf2px4mq8q2w85t2854fmjugkcja20849jde70n34l6k5thr08qqhx8v8/inscriptions?page=1&limit=100","user_agent":"axios/1.4.0","status":200,"error":"","latency":1193706292,"latency_human":"1.193706292s","bytes_in":0,"bytes_out":79140}
{"time":"2023-07-25T09:09:51.154536+02:00","id":"","remote_ip":"::1","host":"localhost:3444","method":"GET","uri":"/addresses/bc1pydf2px4mq8q2w85t2854fmjugkcja20849jde70n34l6k5thr08qqhx8v8/inscriptions?page=2&limit=100","user_agent":"axios/1.4.0","status":200,"error":"","latency":387311667,"latency_human":"387.311667ms","bytes_in":0,"bytes_out":102754}
{"time":"2023-07-25T09:09:51.477123+02:00","id":"","remote_ip":"::1","host":"localhost:3444","method":"GET","uri":"/addresses/bc1pydf2px4mq8q2w85t2854fmjugkcja20849jde70n34l6k5thr08qqhx8v8/inscriptions?page=3&limit=100","user_agent":"axios/1.4.0","status":200,"error":"","latency":316677334,"latency_human":"316.677334ms","bytes_in":0,"bytes_out":79364}
{"time":"2023-07-25T09:09:51.772998+02:00","id":"","remote_ip":"::1","host":"localhost:3444","method":"GET","uri":"/addresses/bc1pydf2px4mq8q2w85t2854fmjugkcja20849jde70n34l6k5thr08qqhx8v8/inscriptions?page=4&limit=100","user_agent":"axios/1.4.0","status":200,"error":"","latency":277585667,"latency_human":"277.585667ms","bytes_in":0,"bytes_out":73526}
{"time":"2023-07-25T09:09:52.083134+02:00","id":"","remote_ip":"::1","host":"localhost:3444","method":"GET","uri":"/addresses/bc1pydf2px4mq8q2w85t2854fmjugkcja20849jde70n34l6k5thr08qqhx8v8/inscriptions?page=5&limit=100","user_agent":"axios/1.4.0","status":200,"error":"","latency":300856208,"latency_human":"300.856208ms","bytes_in":0,"bytes_out":72998}
{"time":"2023-07-25T09:09:52.380219+02:00","id":"","remote_ip":"::1","host":"localhost:3444","method":"GET","uri":"/addresses/bc1pydf2px4mq8q2w85t2854fmjugkcja20849jde70n34l6k5thr08qqhx8v8/inscriptions?page=6&limit=100","user_agent":"axios/1.4.0","status":200,"error":"","latency":278742375,"latency_human":"278.742375ms","bytes_in":0,"bytes_out":72919}
{"time":"2023-07-25T09:09:52.678983+02:00","id":"","remote_ip":"::1","host":"localhost:3444","method":"GET","uri":"/addresses/bc1pydf2px4mq8q2w85t2854fmjugkcja20849jde70n34l6k5thr08qqhx8v8/inscriptions?page=7&limit=100","user_agent":"axios/1.4.0","status":200,"error":"","latency":292944917,"latency_human":"292.944917ms","bytes_in":0,"bytes_out":74625}
{"time":"2023-07-25T09:09:52.93343+02:00","id":"","remote_ip":"::1","host":"localhost:3444","method":"GET","uri":"/addresses/bc1pydf2px4mq8q2w85t2854fmjugkcja20849jde70n34l6k5thr08qqhx8v8/inscriptions?page=8&limit=100","user_agent":"axios/1.4.0","status":200,"error":"","latency":251156167,"latency_human":"251.156167ms","bytes_in":0,"bytes_out":30054}
Tested successfully
$ curl --location http://localhost:3444/addresses/bc1p5pvvfjtnhl32llttswchrtyd9mdzd3p7yps98tlydh2dm6zj6gqsfkmcnd/inscriptions
Updates
This will more than likely take the form of:
GET?address/:id/inscriptions?page={int}&limit={int}
info
build out endpoint to return wallet inscriptions.
down to change the route path here as well.
current request / response below
request:
response:
here's the current endpoint (in js)
https://github.com/pineappleworkshop/nakamoto-trading-co/blob/dev/apps/nakamoto/app/api/inscriptions/route.ts#L1-L28
and here's the supporting function: https://github.com/pineappleworkshop/nakamoto-trading-co/blob/dev/apps/nakamoto/lib/inscriptions.ts#L9-L21C3