Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add router Runes balance and format Tx response to JSON #2978

Merged
merged 24 commits into from
Jan 31, 2024

Conversation

lugondev
Copy link
Contributor

@lugondev lugondev commented Jan 7, 2024

  • Formatting response /tx/{tx_id} into JSON
  • Add router /runes/balance to fetch all runes balance

@lugondev
Copy link
Contributor Author

lugondev commented Jan 7, 2024

@casey @raphjaph I want to bring more the functions from commands to server routes to make it easier for UI access and development.

Following: #2936

@ordinals ordinals deleted a comment from alexluffy Jan 7, 2024
@ordinals ordinals deleted a comment from doshidev99 Jan 7, 2024
Copy link
Collaborator

@raphjaph raphjaph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far!

Could you add tests for both endpoints in tests/json_api.rs?

src/subcommand/server.rs Outdated Show resolved Hide resolved
@lugondev
Copy link
Contributor Author

lugondev commented Jan 9, 2024

Ok, I will do it

@lugondev
Copy link
Contributor Author

lugondev commented Jan 28, 2024

hi @raphjaph, it's been a long time. I have just added tests for the router, all tests were passed in my local but had a failure tests in CI.
give me any feedback
thanks!

LugonShot 2024-01-28 at 14 45 27@2x

Copy link
Collaborator

@raphjaph raphjaph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor things.

I'm also thinking we should probably also add an HTML page for this. If you have a good idea how to display this let me know. Probably some <dl>/<dt> list.

src/subcommand/server.rs Outdated Show resolved Hide resolved
src/subcommand/server.rs Outdated Show resolved Hide resolved
@lugondev
Copy link
Contributor Author

Just some minor things.

I'm also thinking we should probably also add an HTML page for this. If you have a good idea how to display this let me know. Probably some <dl>/<dt> list.

yeah, will I do it in next pull request?

@lugondev
Copy link
Contributor Author

Just some minor things.
I'm also thinking we should probably also add an HTML page for this. If you have a good idea how to display this let me know. Probably some <dl>/<dt> list.

yeah, will I do it in next pull request?

I would like to use this endpoint for my product with the official repo ord. Thank you for understanding.

@lugondev
Copy link
Contributor Author

@raphjaph help me check this pull request

Copy link
Collaborator

@raphjaph raphjaph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Just fixed some small things here and there

@lugondev
Copy link
Contributor Author

LGTM!

Just fixed some small things here and there

thanks you so much

Copy link
Collaborator

@casey casey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good @lugondev, amazing work!

@raphjaph raphjaph enabled auto-merge (squash) January 31, 2024 05:34
@raphjaph raphjaph merged commit d829fd2 into ordinals:master Jan 31, 2024
6 checks passed
lifofifoX added a commit to lifofifoX/ord that referenced this pull request Feb 2, 2024
* master:
  Use a flag to indicate a mint (ordinals#3068)
  Add dry run to send, print Outgoing and PSBT (ordinals#3063)
  Make invariant message more concise (ordinals#3029)
  Add /runes/balances (ordinals#2978)
thedoublejay pushed a commit to sadoprotocol/ord that referenced this pull request Mar 12, 2024
* Add recipe to deploy to all servers in fleet (ordinals#2992)

* Suppress empty command output (ordinals#2995)

* Optimize get_inscription_ids_by_sat_paginated (ordinals#2996)

* Add crate to audit content security policy (ordinals#2993)

* Remove dead link from README (ordinals#3000)

* Add `indexed` to output JSON (ordinals#2971)

* Cache less aggressively (ordinals#3002)

* Add minimal Dockerfile (ordinals#2786)

* Don't use browser sniffing when serving favicon (ordinals#3003)

* Add option to retain sat index for spent outputs (ordinals#2999)

* Hide BVM Network inscriptions (ordinals#3012)

* Use --name instead of --wallet in README (ordinals#3010)

* Add blocks and transaction JSON endpoints (ordinals#3004)

* Inscribe with delegate (ordinals#3021)

* Use untyped table API to get table info (ordinals#2747)

* Make wallet communicate with index via RPC (ordinals#2929)

* Break deploy recipes into multiple lines (ordinals#3026)

* Test fee-spent inscription numbering (ordinals#3032)

* Remove uneccessary allocations in Inscription Script Creation (ordinals#3039)

* Better wallet error messages (ordinals#3041)

* Add documentation for reinscriptions (ordinals#2963)

* Exclude unnecessary docs (ordinals#3043)

* Enable JSON API by default (ordinals#3047)

* Forbid destinations in same-sat mode (ordinals#3038)

* Dump and restore wallet from descriptors (ordinals#3048)

* Add /runes/balances (ordinals#2978)

* Make invariant message more concise (ordinals#3029)

* Add dry run to send, print Outgoing and PSBT (ordinals#3063)

* Use a flag to indicate a mint (ordinals#3068)

* Move SatPoint into library (ordinals#3077)

* [ordinals] Bump version: 0.0.1 → 0.0.2 (ordinals#3078)

* Use min instead of clamp (ordinals#3081)

* Make clippy stop complaining about insane repair callback (ordinals#3104)

* Remove index parameter from index_block (ordinals#3088)

* Allow specifying satpoint in `same-sat` batch inscribe (ordinals#3100)

* Show reinscriptions in `ord wallet inscriptions` (ordinals#3101)

* Move sat and friends into ordinals crate (ordinals#3079)

* fix naming (ordinals#3112)

* Return signed PSBT from `ord wallet send` (ordinals#3093)

* Add /r/blockinfo endpoint (ordinals#3075)

* Import multiple descriptors at a time (ordinals#3091)

* Add `satpoints` batch inscribe mode (ordinals#3115)

* Allow inscribing AVIF images (ordinals#3123)

* Fix spelling mistake in bip.mediawiki (ordinals#3118)

* Only allow mnemonic from stdin (ordinals#3023)

* Emit inscription update events to channel (ordinals#3137)

* Make Options public (ordinals#3138)

* Use `image-rendering: auto` when downscaling images (ordinals#3144)

* Add `ord env` to spin up a test bitcoin daemon and ord server (ordinals#3146)

* Display inscription content type counts on /status (ordinals#3127)

* Add optional HTTP authentication for server (ordinals#3131)

* Make wallet async (ordinals#3142)

* Add `/r/inscription` endpoint for getting inscription details (ordinals#2628)

* Use `image-rendering: auto` for AVIF inscriptions (ordinals#3148)

* Make `ord env` more user friendly (ordinals#3153)

* Move JSON structs into api module (ordinals#3167)

* Display parent above metadata on /inscription (ordinals#3160)

* Represent rune IDs as `BLOCK:TX` (ordinals#3165)

* Add parent preview to inscription page (ordinals#3163)

* Update inscription sat documentation (ordinals#3114)

* Fix lints (ordinals#3124)

* Remove unnecessary lifetime from Formatter (ordinals#3178)

* Print PSBT for dry run inscribe (ordinals#3116)

* Update docs to reflect wallet changes (ordinals#3179)

* Improve configuration (ordinals#3156)

* Document `ord env` (ordinals#3180)

* Install openssl in docker image (ordinals#3181)

* Release 0.16.0-rc0 (ordinals#3182)

* Refactor test server to use arguments (ordinals#3183)

* Update ordinals crate (ordinals#3184)

* Release 0.16.0-rc1 (ordinals#3185)

* Allow configuring interval between commits to index (ordinals#3186)

* Credit contributors in changelog (ordinals#3187)

* Make deploys noninteractive (ordinals#3189)

* Make nop and burn tags one byte (ordinals#3207)

* Encode claims as tag (ordinals#3206)

* Add content proxy (ordinals#3216)

* Add reinscribe option to batch file (ordinals#3220)

* Check for duplicate satpoints in `satpoints` mode (ordinals#3221)

* Overhaul settings (ordinals#3188)

* Rename index_envelopes to index_inscriptions (ordinals#3233)

* Test that runes can be minted with no edict (ordinals#3231)

* Add libssl-dev to ubuntu install command (ordinals#3235)

* Enable indexing runes on mainnet (ordinals#3236)

* Document `ord wallet restore` (ordinals#3237)

* Load config from default data dir and configure `ord env ` using config (ordinals#3240)

* Document `ord env` commands (ordinals#3241)

* Fix list numbering in handbook (ordinals#3248)

* Display initial sync time on status page (ordinals#3250)

* Create tempdir in download-log recipe (ordinals#3242)

* Don't consider unconfirmed UTXOs as spent (ordinals#3255)

* Reserve inscription tag 15 (ordinals#3256)

* Rename genesis fee to inscription fee (ordinals#3257)

* Add more fields to /r/blockinfo (ordinals#3260)

* Add `id` inscription recursive JSON (ordinals#3258)

* Document recursive endpoint backwards compatibility guarantees (ordinals#3265)

* Release 0.16.0 (ordinals#3264)

- Bump version: 0.16.0-rc1 → 0.16.0
- Update changelog
- Update changelog contributor credits
- Update dependencies

* Bump ordinals version: 0.0.3 → 0.0.4 (ordinals#3267)

---------

Co-authored-by: Casey Rodarmor <[email protected]>
Co-authored-by: oxSaturn <[email protected]>
Co-authored-by: raph <[email protected]>
Co-authored-by: Robert Clarke <[email protected]>
Co-authored-by: Davirain <[email protected]>
Co-authored-by: Jeremy Rubin <[email protected]>
Co-authored-by: mj10021 <[email protected]>
Co-authored-by: zhiqiangxu <[email protected]>
Co-authored-by: 0xLugon <[email protected]>
Co-authored-by: Jerry the Martian <[email protected]>
Co-authored-by: HarveyV <[email protected]>
Co-authored-by: Michael Yu <[email protected]>
Co-authored-by: lifofifo <[email protected]>
Co-authored-by: Eloc <[email protected]>
Co-authored-by: Sitt Guruvanich <[email protected]>
Co-authored-by: bingryan <[email protected]>
Co-authored-by: Andrew <[email protected]>
Co-authored-by: Arik <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants