Repository navigation
Conversation
5e26ace to
1b441cc
Compare
2fb7776 to
1d70875
Compare
solidsnakedev
left a comment
There was a problem hiding this comment.
Thanks for this, and for moving it onto the new HTTP layer.
It needs another round before it can merge. A datum-hash output comes back as an inline datum, and no test runs without a BCA token. CI is green, but none of the provider code runs there, and we can't run the live suite ourselves.
Needed:
- Datum-hash outputs: when
/datum/{hash}answers,resolveUtxoturns a hash-only output into anInlineDatum(BlockchainAppliedEffect.ts:84-91). Please returnDatumHashfor these, as Koios, Maestro and Kupmios do. Callers get the datum throughgetDatum. #687 tracks the same bug in Blockfrost. - Offline tests: please add
test/provider/BlockchainApplied.test.tswith fetch stubbed, likeMaestro.test.ts, built from recorded BCA responses. Cover each method, pagination, the 404 paths,/tx/evaluatewithadditional_utxos, and the bearer header. - Reference scripts:
resolveUtxoswallows any/scriptfailure (line 81), so the UTxO comes back without its script. The builder then leaves that script out of the reference script fee, and the node rejects the transaction. Please fail with aProviderErrorinstead. Also,ScriptDetailsrequiresbytesandsize, which the spec marks nullable, and your backend stores no CBOR for native scripts. The provider drops every native reference script that reaches this path. Please build it fromjsonor fail. - Cost models: please decode them strictly as arrays, as Koios does (
Koios.ts:64-67). The object branch innormalizeCostModelkeeps the server's key order, and that order gives a wrong script integrity hash (#303 was this failure in Blockfrost). This also removes the twoRecord<string, unknown>casts. - Protocol parameters: a missing
coins_per_utxo_sizeormin_fee_ref_script_cost_per_bytebecomes 0 (BlockchainApplied.ts:232-241). That gives a minimum ADA of 0 and a reference script fee of 0. It also skips the builder's own fallback for the fee. Please fail instead, as Koios, Maestro and Kupmios do. awaitTx: please retry only on a 404, and decode onlyhash. Today a 401 keeps polling until the 160 s timeout and then fails as a timeout.- Casts:
as Redeemer.RedeemerTag(line 280) andas Provider.Delegation(BlockchainAppliedEffect.ts:217) both compile without the cast. Typing the schema field asRedeemer.RedeemerTagcovers the first.
Questions about the API:
- Is
asset_namehex or text in the UTxO responses? The spec's/tx/{txhash}example shows"USDCx", which the provider can't decode. If it is hex, the example needs fixing. - Which tag strings does
/tx/evaluatereturn for certificate and withdrawal scripts? If it passespublishandwithdrawthrough, please map them as Kupmios and Koios do. - Does
/utxos/{address}accept a payment credential (addr_vkh1...,script1...)? If not, please fail for credentials as Maestro does (MaestroEffect.ts:91-97). If it does, setsupportsCredentialQueries: trueinproviders.test.ts. - Is
reference_script_cborfilled for native scripts?
Smaller:
- Every endpoint needs a token, so please make
tokenrequired in the presets and the config. provider-types.mdx,providers/index.mdxand the README still list four providers. Please update them, or leave the docs to a follow-up PR. In the table, a use case such as "Hosted REST API, bearer token" fits the other rows better.- Please drop the formatting-only changes in
conformance.ts,providers.test.ts,client/internal/Client.tsand the docs, and the**/*.localline in.gitignore. - Please make the changeset a patch.
Signed-off-by: Alexander Diemand <codieplusplus@apax.net>
…xact integers Upstream dropped @effect/platform (IntersectMBO#548) and now hands every JSON number to the response schemas as its source text (IntersectMBO#558). - Detect 404s via HttpUtils.HttpResponseError instead of HttpClientError - Decode integer fields with Schema.BigInt and decimals with Schema.NumberFromString; convert to number only where the public ProtocolParameters / EvalRedeemer types require it - Keep the evaluate request's additional_utxos wire format unchanged via an explicit AdditionalUtxo type - Make total_count / total_pages optional: the API no longer returns them, and pagination only relies on has_next Signed-off-by: Alexander Diemand <codieplusplus@apax.net>
Signed-off-by: Alexander Diemand <codieplusplus@apax.net>
Signed-off-by: Alexander Diemand <codieplusplus@apax.net>
1d70875 to
448275b
Compare
Thank you for this great review. I have addressed all points and describe them below. Needed
API questions
Smaller
Test errorI ran the tests locally against the API and saw one failing: |
This PR adds Blockchain Applied (BCA) as a data provider and tx submit API.
production: https://api.blockchain-applied.com/api_ada/v1/docs/
staging: https://staging.blockchain-applied.com/api_ada/v1/docs/
this API is based on cardano-db-sync
the transaction evalutation and submission API uses Ogmios
tests successfully validated