flare_network 0.1.0
flare_network: ^0.1.0 copied to clipboard
Dart client for Flare Network. Read FTSOv2 price feeds, resolve contracts via the Contract Registry, and call any Flare contract over JSON-RPC. Pure Dart.
0.1.0 #
First stable release. The API is unchanged from 0.1.0-dev.2; this exists so
that dart pub add flare_network resolves, which a prerelease does not.
Read-only. Transaction signing is a documented, permanent non-goal: the package builds and prices a transaction, your wallet signs it, and the package decodes what came back.
0.1.0-dev.2 #
Added #
explainRevert, which replays a failed call at its own block to recover the reason. A receipt has no field that carries one.decodeReverton the generated contract bindings. 168 of the custom errors in Flare's published ABIs carry no message, so a node reports them as four opaque bytes.
0.1.0-dev.1 #
First development release. Read-only; transaction signing is a documented non-goal.
Added #
FlareClient, for JSON-RPC reads over Flare's C-chain, with automatic retry (exponential backoff, full jitter), request batching, andverifyChainId()to catch a misconfigured endpoint at startup rather than as a confusing "contract not found" later.FlareChain, with presets for Flare (14), Coston2 (114), Songbird (19) and Coston (16), withwithRpcUrl()for private endpoints.ContractRegistry, for runtime contract resolution with caching and batched lookups. The registry address is the only address this package hardcodes.FtsoV2, for block-latency price feeds:getFeedById,getFeedsById,getFeedIndex,getFeedId,calculateFeeByIds, andwatchFeedsfor a deduplicated live stream.FeedId, the 21-byte feed identifier, with exact-decimal formatting onFtsoFeedValueviatoDecimalString().DaLayerClient, for Scaling anchor feeds with Merkle proofs, plus protocol status. Results are re-ordered to match the request, because the API does not preserve request order. Supports anX-API-KEYfor higher rate limits.FdcClient, for Flare Data Connector reads: per-type attestation fees, voting round timing fromProtocolsV2(cached), round-ID derivation, and on-chain proof verification.AttestationSource.<chain>.forChain(chain)resolves the network-specific source identifier, because testnets usetest-prefixed names (testXRP,testETH) and a mainnet name reverts there with a message that does not explain why.- A complete ABI codec:
AbiType,AbiFunction,ContractAbi,AbiCodec, covering every Solidity type including nested tuples and fixed arrays. EthAddresswith EIP-55 checksum validation enforced by default.- A sealed
FlareExceptionhierarchy for exhaustive error handling.
Verified #
- ABI encoding is cross-checked against Foundry (
cast sig,cast calldata,cast abi-encode) rather than against its own output. - 131 hermetic unit tests, plus 39 integration tests against live Coston2, and 9 widget tests in the reference app.
- Measured, not assumed: FDC fees are 1000 wei on Coston2 and 20 FLR on
mainnet; the public DA Layer serves ~18 requests before returning 429 and
sends no
Retry-After.