Commit graph

28 commits

Author SHA1 Message Date
Hossein Zoda
c7a9e9bea6 ido: replace num-bigint with malachite
Migrate the ido module's arbitrary-precision math from num-bigint to
malachite (already a workspace dependency). BigInt becomes
malachite::Integer throughout; the VM-number byte codec uses
PowerOf2Digits, sign handling uses Integer::sign(), and primitive
conversions use try_from.

Add an IntegerAsStr serde adapter for string-serialized fields, since
malachite's FromStr::Err is () and does not satisfy DisplayFromStr's
Display bound. JSON output is unchanged.

Drop the now-unused num-bigint and num-traits dependencies.

Also fix all clippy warnings in the module surfaced by the migration
(unwrap-after-is_none control flow, a const->static LazyLock bug,
an oversized enum variant boxed, and assorted mechanical lints).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 10:41:39 +00:00
Hossein Zoda
988426e485 ido, compiles, with claude generated unittests 2026-06-21 01:44:39 +03:00
Dagur Valberg Johannsson
dc420424ac Update bitcoincash to 0.32.2 and riftenlabs-defi to 0.4.1
Fixes the indexer crash on chipnet: bitcoincash 0.32.1's
Opcode::classify panicked on BCH re-enabled opcodes (e.g. OP_SPLIT),
which riftenlabs-defi hit while parsing input scriptSigs in
parse_cauldrons_from_tx. bitcoincash 0.32.2 makes classify total and
panic-free (and adds the May 2026 upgrade opcodes); riftenlabs-defi
0.4.1 additionally hardens read_push_from_script to not classify
non-push opcodes at all.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 22:58:53 +02:00
Dagur Valberg Johannsson
1614b84674 Upgrade bitcoincash to 0.32 and add TokenToken AMM pool indexing
Migrate off the deprecated bitcoincash 0.29 API (Amount/Version types,
FromHex -> FromStr/parse, non-exhaustive Network) across the indexer and
tests.

Add indexing of native token-A <-> token-B (TokenToken) AMM pools:

- tokentoken_pool / tokentoken_pool_history_entry tables in cauldron.db,
  created via an always-run idempotent migration (no DB_VERSION bump, so
  existing databases upgrade in place)
- block-path indexing sharing the cauldron write transaction and reorg
  undo, with creation/swap/withdrawal state tracking and reserve deltas
- mempool indexing: electrum mempool.get filters on the tokentoken
  contract code (spends) and the CONJURE op_return hint (creations);
  first_seen_timestamp reconciles with mtp on confirmation
- RPC endpoints /tokentoken/pool/active (pair lookup, order-insensitive)
  and /tokentoken/tokens

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 16:18:35 +02:00
Dagur Valberg Johannsson
4d205cada4
Delphi v2 support
Same API from consumer-standpoint
2026-05-04 15:03:40 +02:00
Dagur Valberg Johannsson
c7eb5bcc36 Added support for indexing Moria contracts 2026-03-30 23:52:29 +02:00
Dagur Valberg Johannsson
527b9ba91c
Bump electrum dep to allow larger websocket msg
We need to allow larger messages to index large blocks via websocket
interface.
2026-02-24 10:33:39 +01:00
Dagur Valberg Johannsson
f421327a5d
Switch to tokio and sqlx
This makes the application fully async; freeing web server threads to
handle new connections when waiting on SQL queries.

Additionally sqlx will allow easier move to a different database if
needed in the future.

Includes some SQL optimizations as well (slow queries more easliy identifiable
with sqlx).
2026-02-18 10:16:51 +01:00
Dagur Valberg Johannsson
bac43bbb98
Make DB read pool size configurable 2026-02-10 14:49:28 +01:00
Dagur Valberg Johannsson
7ad0303209
Add WebSocket support 2026-02-03 09:39:12 +01:00
Dagur Valberg Johannsson
460a1fc7f1
Add arbitrary int support 2025-07-16 09:30:17 +02:00
Dagur Valberg Johannsson
8b16e3d1f3
bump minor deps 2025-06-12 10:08:22 +02:00
Dagur Valberg Johannsson
78e391560f
Added support for delphi oracle
This allows fetching historical asset prices from the blockchain.
2025-05-21 13:33:26 +02:00
Dagur Valberg Johannsson
33aebb0318
bug: Foreign keys not enforced
sqlite was not properly enforcing foreign keys, keeping conflicted
transactions in the database
2024-12-19 13:21:57 +01:00
jakobsn
1248929fb4 Search tokens 2024-10-31 10:55:29 +00:00
Dagur Valberg Johannsson
b4b9bf1eb5
Make rostrum server configurable
New default set to localhost
2024-10-25 15:22:44 +02:00
Dagur Valberg Johannsson
6cfd95dacf
Bump riftenlabs-defi dep 2024-10-24 11:52:11 +02:00
Dagur Valberg Johannsson
5aebe7bdaf
Use package electrum-client-netagnostic
Replace package that pointed at a git repo with
electrum-client-netagnostic.
2024-10-08 22:15:46 +02:00
Dagur Valberg Johannsson
675b3f08f9
rpc: Unique addresses
RPC method to show number of unique addresses interracting with cauldron
2024-09-04 13:25:36 +02:00
Dagur Valberg Johannsson
e38eaaa26c
Add BCMR indexer
This adds BCMR indexer, including downloading and parsing the actual
BCMR files.
2024-05-27 11:56:35 +02:00
Dagur Valberg Johannsson
519c442e34
rename binary 2024-04-02 14:07:30 +02:00
Dagur Valberg Johannsson
b80b1144da
api: current price 2024-04-02 13:17:25 +02:00
Dagur Valberg Johannsson
21a57554f8
Add sqlite connection pool 2024-03-14 12:14:55 +01:00
Dagur Valberg Johannsson
1c817c8cfd
Add support for calculating pool APY 2024-03-14 10:54:33 +01:00
Dagur Valberg Johannsson
cd22aa8d70
Track transactions in the mempool 2024-02-16 14:18:41 +01:00
Dagur Valberg Johannsson
168670c9bf
Support block reorgs 2024-02-14 11:11:16 +01:00
Dagur Valberg Johannsson
b8943fb48d
Add CORS 2024-01-19 14:38:31 +01:00
Dagur Valberg Johannsson
69405d035a
Initial commit 2024-01-05 13:59:11 +01:00