Skip to content

Conversation

@lcovar
Copy link
Contributor

@lcovar lcovar commented Feb 6, 2026

- Remove ensureWasmInitialized() pattern (WASM loads synchronously in Node.js)
- Fix import paths from ../pkg/wasm_dot to ./wasm/wasm_dot
- Add fromInner() static method to DotTransaction for builder usage

BTC-0
- Remove manual SCALE encoding fallback, always use metadata
- Add clean call encoding via subxt dynamic API (calls.rs)
- Implement batch support matching txwrapper-polkadot pattern
- Make metadataHex required in Material type
- Add builder tests with westend metadata fixture
- Verify batch encoding matches standalone call encoding

BTC-0
Replace manual base58 implementation with official bs58 crate for SS58
address encoding/decoding. This reduces code complexity and improves
reliability by using a well-tested library matching the Substrate ecosystem.
Align field naming with BitGoJS Material interface so material objects
can be passed directly without field mapping.
Replace manual byte concatenation with subxt-core APIs:
- Add PreEncodedPayload wrapper implementing Payload trait
- Use tx::create_partial_signed() + partial.signer_payload() for
  signable payload construction
- Use partial.sign_with_address_and_signature() for signed tx creation
- Use subxt_core::utils::Era for era encoding
- Use PolkadotExtrinsicParamsBuilder for extrinsic params

This ensures correct SCALE encoding and signed extension handling
by leveraging the official substrate crate instead of custom code.

BTC-0
- Add setNonce and setTip methods to DotTransaction JS bindings
- Include era/nonce/tip in unsigned extrinsic bytes for roundtrip parsing
- Enhance parser to extract era/nonce/tip from serialized unsigned txs
- Update builder to encode era/nonce/tip inline in unsigned bytes
- Rebuild tgz artifact
Replace instruction-based Transaction class design (copied from Solana)
with DOT-specific DotTransaction class that models extrinsic structure:
call data + envelope (nonce, tip, era). Add guidance that DOT uses
extrinsic calls, not instructions. Update parse API reference to
DotParser.parseTransactionHex() which is the actual implementation.

BTC-0
Adds toBroadcastFormat() method to DotTransaction class, matching the
standard BitGo convention used across all coins (e.g. wasm-solana).
Delegates to toHex() since DOT broadcast format is hex-encoded SCALE.

BTC-0
…saction()

Export a standalone parseTransaction() function matching the pattern used
by wasm-solana. Accepts Uint8Array, hex string, or DotTransaction object.
Removes the DotParser class pattern.

BTC-0
The WASM wrapper's addSignature(signature, pubkey) was passing args
to the inner add_signature(pubkey, signature) without swapping order,
causing "Public key must be 32 bytes, got 64" errors when the 64-byte
signature was interpreted as the pubkey.

Also adds DotParser as an alias for ParserNamespace to maintain
backwards compatibility with consumers using the old export name.

BTC-0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant