Summary
The TypeScript declarations generated by packages/wasm-sdk contain three documentation/type-name inconsistencies. These propagate into downstream generated API references, including the Evo SDK website using @dashevo/wasm-sdk@4.0.0.
Issues
1. ResourceVoteChoice usage uses the wrong method casing
Source: packages/wasm-sdk/src/state_transitions/identity.rs
The JSDoc recommends:
ResourceVoteChoice.towardsIdentity()
ResourceVoteChoice.abstain()
ResourceVoteChoice.lock()
The generated class actually exports:
ResourceVoteChoice.TowardsIdentity()
ResourceVoteChoice.Abstain()
ResourceVoteChoice.Lock()
Update the JSDoc to use the exported method names.
2. Voting pagination documentation contradicts the inclusive default
Source: packages/wasm-sdk/src/queries/voting/votes.rs
startAtVoteId is described as "exclusive by default," while startAtIncluded documents @default true. The implementation confirms the inclusive default:
Some((identifier.to_buffer(), start_at_included.unwrap_or(true)))
Update the startAtVoteId prose and related pagination JSDoc to consistently describe the inclusive default behavior. The analogous voting query implementations in state.rs and voters.rs also use unwrap_or(true) and should remain consistent.
3. Address withdrawal options reference a non-exported Pooling symbol
Source: packages/wasm-sdk/src/state_transitions/addresses.rs
AddressFundsWithdrawOptions currently documents and declares:
Pooling.Never
Pooling.IfAvailable
Pooling.Standard
pooling: Pooling
The generated package exports PoolingWasm, not Pooling. Update the examples and property type to consistently use the actual exported symbol:
PoolingWasm.Never
PoolingWasm.IfAvailable
PoolingWasm.Standard
pooling: PoolingWasm
Downstream impact
The Evo SDK website generates its type reference directly from the published declarations. It currently needs a local Pooling -> PoolingWasm resolution alias so documentation generation does not fail, which produces a mismatched Pooling heading containing an export enum PoolingWasm declaration.
Acceptance criteria
- Generated declarations recommend
ResourceVoteChoice.TowardsIdentity, .Abstain, and .Lock.
- Voting pagination prose and
@default annotations consistently describe the inclusive default implemented by unwrap_or(true).
- Address withdrawal declarations and examples consistently use an exported pooling symbol.
- Regenerated TypeScript declarations contain no references to the nonexistent
Pooling type.
Summary
The TypeScript declarations generated by
packages/wasm-sdkcontain three documentation/type-name inconsistencies. These propagate into downstream generated API references, including the Evo SDK website using@dashevo/wasm-sdk@4.0.0.Issues
1.
ResourceVoteChoiceusage uses the wrong method casingSource:
packages/wasm-sdk/src/state_transitions/identity.rsThe JSDoc recommends:
The generated class actually exports:
Update the JSDoc to use the exported method names.
2. Voting pagination documentation contradicts the inclusive default
Source:
packages/wasm-sdk/src/queries/voting/votes.rsstartAtVoteIdis described as "exclusive by default," whilestartAtIncludeddocuments@default true. The implementation confirms the inclusive default:Update the
startAtVoteIdprose and related pagination JSDoc to consistently describe the inclusive default behavior. The analogous voting query implementations instate.rsandvoters.rsalso useunwrap_or(true)and should remain consistent.3. Address withdrawal options reference a non-exported
PoolingsymbolSource:
packages/wasm-sdk/src/state_transitions/addresses.rsAddressFundsWithdrawOptionscurrently documents and declares:The generated package exports
PoolingWasm, notPooling. Update the examples and property type to consistently use the actual exported symbol:Downstream impact
The Evo SDK website generates its type reference directly from the published declarations. It currently needs a local
Pooling -> PoolingWasmresolution alias so documentation generation does not fail, which produces a mismatchedPoolingheading containing anexport enum PoolingWasmdeclaration.Acceptance criteria
ResourceVoteChoice.TowardsIdentity,.Abstain, and.Lock.@defaultannotations consistently describe the inclusive default implemented byunwrap_or(true).Poolingtype.