era_connect 0.2.0
era_connect: ^0.2.0 copied to clipboard
Air-gapped ERA hardware wallet SDK: UR/QR linking and signing for EVM, Bitcoin (+ LTC/DOGE/DASH/BCH), Solana, Tron, TON, Cardano, Sui, Cosmos and XRP. Headless, zero-I/O.
0.2.0 #
Behaviour change — EraAccounts.btc(testnet: true) now selects an account.
0.1.0 used the flag only to pick an address encoding, never to choose an entry,
and 0.1.0 is published: on an export carrying both coin types it returned the
mainnet account rendered under a testnet HRP, while the account path, the
xfp a sign request would carry and the extended key all stayed mainnet; on a
testnet-only export it returned null. The view now selects the first entry
whose first two levels are m/<purpose>'/1'/… — SLIP-44 coin type 1 — and
everything it reports comes from that one entry.
- Selection reads the purpose and the coin type and nothing below them, on
either network, and takes the FIRST entry that matches. An export whose only
BIP-84 testnet entry is
m/84'/1'/2'answers with that one, and a five-level leaf such asm/84'/1'/0'/0/0matches too, so readaccountPathrather than assuming a0'account index. Both levels must be hardened: acrypto-keypathcan spell a soft level, andm/84'/1/0'is a different key, not a testnet account. - There is no fallback between the networks.
btc(testnet: true)returnsnullwhen the export carries no coin-type-1' account. ERA wallets export Bitcoin accounts at coin type 0' only, so that isnullfor every current ERA export — the truthful answer, where 0.1.0 handed back a mainnet key wearing a testnet address. - Mainnet is unchanged, precisely: for purposes 44, 49, 84 and 86
btc()selects the same entry it always did, on every export. For a purpose OUTSIDE that set it still returnsnull, as 0.1.0 did — 0.1.0 got that bound as a side effect of classifying the path as Bitcoin, and it now lives in the selector itself, so the network change could not quietly widen it. xpub()andzpub()follow the selected account instead of always emitting mainnet version bytes, so a testnet account serialises astpub…(0x043587cf) andvpub…(0x045f1cf6) — the SLIP-132 forms.zpub()keeps its name and its BIP-84-only rule; on testnet it is thevpubform.- Path classification is deliberately NOT widened. Coin type 1 is SLIP-44's
"Testnet (all coins)", so
m/84'/1'/0'is as much a Litecoin testnet account as a Bitcoin one and staysAccountChain.unknowninaccounts.keys.btc(testnet: true)may resolve it only because the caller named the chain. BtcAccountView's constructor no longer takes atestnetboolean: the network is read off the selected entry's own coin type. The parameter made it possible to reconstruct by hand the exact wrong answer this release removes — a mainnet entry wearing a testnet address. This is a source break, and 0.1.0 did put the constructor within reach: it exportedBtcAccountViewwholesale andRawAccountEntryby name, and the latter's const constructor takes named parameters, so the view was already constructible without any of this release's additions. What makes the break acceptable is its shape rather than an absence of callers: under pub's caret^0.1.0does not resolve to 0.2.0, so no one meets it by upgrading in place, and the dropped parameter was POSITIONAL — every 0.1.0 call site fails to compile against 0.2.0 instead of quietly changing behaviour.
Added exports. The entry libraries gate their surface with hand-written
show clauses, and symbols an integrator has to name had drifted off them.
Nothing was removed.
package:era_connect/era_connect.dart—randomRequestId,uuidStringify,bytesToHex,hexToBytes,walletUrTypes,parseMultiAccountsUr,pathEqualsanddefaultOrigin.parseMultiAccountsUris the only producer ofRawMultiAccountsandRawAccountEntry, which the library already exported and which were therefore impossible to obtain.package:era_connect/verify.dart— every type its argument objects declare, so an app that imports this library alone can name what it hands the verifiers:CardanoWitness(VerifyCardanoSignatureArgs.witnesses),EvmDataTypeandTonDataType(thedataTypefields),TronLatestBlockandSignedTronTx(VerifyTronSignatureArgs) — plusEraSdkError, which the exportedparsePsbtandbocRootHashthrow and whichon EraSdkError catchcould not otherwise name.- The per-chain libraries —
defaultOrigin, the value their already-exportedEraConnectConfig.origindefaults to.
0.1.0 #
First release.
Account linking and air-gapped transaction signing over animated QR codes (BC-UR / Keystone-compatible registry) for eleven chain families: EVM, Bitcoin (plus Litecoin, Dogecoin and Dash through the same PSBT flow), Bitcoin Cash, Solana, Tron, TON, Cardano, Sui, Cosmos and XRP.
EraConnectfacade with per-chain modules, plus narrow per-chain libraries for apps that only need one.- Linking parses the device's
crypto-multi-accountsexport into typed account views that derive addresses locally, with no device round-trip. package:era_connect/verify.dartproves the device signed exactly what was sent — mandatory on the two paths that carry no request id (Bitcoin PSBT and XRP).- Hardened transport: bounds before allocations, hostile-frame refusal in the scanner, a request-id echo on every reply that carries one, and a hard ceiling on compressed replies.
- Pure Dart: no plugins, no
dart:ioin the library, no network calls.