forked from MetaMask/bdk-wasm
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
P3Low priorityLow priority
Description
Summary
Each BDK type wrapper requires ~50-100 lines of repetitive boilerplate (struct definition, From/Into impls, wasm_bindgen getters/setters). Investigate if procedural or declarative macros can reduce this.
Current Pattern
#[wasm_bindgen]
pub struct WasmType(BdkType);
impl From<BdkType> for WasmType { ... }
impl From<WasmType> for BdkType { ... }
#[wasm_bindgen]
impl WasmType {
#[wasm_bindgen(getter)]
pub fn field(&self) -> ... { self.0.field.into() }
// ... repeat for every field
}Tasks
- Analyze which parts of the pattern are truly repetitive
- Prototype a declarative macro for simple field-forwarding wrappers
- Evaluate if a proc macro is worth the complexity
- Ensure generated code still produces clean TypeScript bindings
- Refactor existing types to use the macro where beneficial
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3Low priorityLow priority