feat(magma,lndg): migrate to modern Amboss Magma GraphQL API and add test suites - #44
Open
TrezorHannes wants to merge 5 commits into
Open
feat(magma,lndg): migrate to modern Amboss Magma GraphQL API and add test suites#44TrezorHannes wants to merge 5 commits into
TrezorHannes wants to merge 5 commits into
Conversation
…suites - Migrated magma_sale_process.py and magma_market_fee.py to target https://magma.amboss.tech/graphql - Replaced legacy queries/mutations with user.market.orders.sales, market.order.seller.accept/reject/add_transaction, and market.offer.offers/create/update/toggle - Added extract_order_info and extract_market_offer_info normalizers supporting nested SatoshiValue objects with backward compatibility - Expanded unit test suites for magma_sale_process and magma_market_fee with full mock coverage - Updated GitHub Actions CI test workflow with Python 3.10/3.11/3.12 matrix - Added .agents/agents.md architecture guide and overhauled README.md Tests passing: 29/29
…L schema - Verified schema directly against live https://magma.amboss.tech/graphql endpoint - Adjusted GetPublicOffers to query SimpleMarketOffer node, total_amount, and locked_amount - Adjusted GetSales to use OrderInput and SimpleMarketOrder fields - Corrected mutation input types to SellerAcceptOrdersInput and SellerRejectOrdersInput - Updated unit test suites to assert live-validated field shapes Tests passing: 29/29
…SCID fallback - Migrated Magma orders query from legacy monolithic getUser.market.offer_orders to https://magma.amboss.tech/graphql (sales and purchases) - Maintained https://api.amboss.space/graphql for getEdgeInfoBatch bulk channel ID conversions - Implemented deterministic mathematical bit-shift conversion fallback for Lightning SCIDs (block << 40 | tx << 16 | out) - Refactored into modular, testable units with robust error handling and fail-safe file persistence - Added complete unit test suite in tests/LNDg/test_amboss_pull.py Tests passing: 38/38
TrezorHannes
force-pushed
the
feat/magma-api-migration-and-tests
branch
from
August 27, 2026 19:43
f0ca566 to
a6d8f62
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
1. Amboss Magma API Migration
Magma/magma_sale_process.py,Magma/magma_market_fee.py, andLNDg/amboss_pull.pyfrom legacy monolithic endpoints to the dedicatedhttps://magma.amboss.tech/graphqlandhttps://api.amboss.space/graphqlendpoints.market.offer.offers(SimpleMarketOfferwithnode { pubkey, alias },total_amount,locked_amount, and fee details).user.market.orders.salesanduser.market.orders.purchasesusingOrderInputandSimpleMarketOrderfields.user.market.orders.get_order(order_id: ...)with fullMarketOrderand promises.SellerAcceptOrdersInput!,SellerRejectOrdersInput!,SellerAddTransactionInput!,CreateOfferInput!,UpdateOfferInput!,ToggleOfferInput!.2. Deterministic Mathematical SCID Fallback
LNDg/amboss_pull.py((block << 40) | (tx << 16) | out) ensuring channel clustering succeeds even during Amboss Space API downtime.3. Unit Test Suites & CI/CD
tests/Magma/test_magma_sale_process.py(17 tests)tests/Magma/test_magma_market_fee.py(8 tests)tests/LNDg/test_amboss_pull.py(9 tests)tests/test_fee_adjuster.py(4 tests).github/workflows/tests.ymlmatrix for Python 3.10, 3.11, and 3.12.4. Architecture & Documentation
.agents/agents.mddocumenting script architecture and API mappings.README.md.