Commit 43e43e6
committed
feat(wasm-dot): change encodeSs58 and validateAddress to accept number prefix
Replace AddressFormat enum parameter with plain number in encodeSs58 and
validateAddress. The AddressFormat enum remains exported as a named-constants
convenience; since its members are numeric (Polkadot=0, Kusama=2, Substrate=42),
existing callers passing AddressFormat.Polkadot etc. continue to compile without
change — numeric enum values are assignable to number.
This eliminates the need for callers to import AddressFormat just to satisfy the
type, and avoids as-unknown-as casts when bridging to sdk-core's DotAddressFormat.
Mirrors the pattern used by wasm-utxo, which accepts plain primitives.
Ticket: T1-57
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 19ee5a9 commit 43e43e6
1 file changed
Lines changed: 7 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | | - | |
| 15 | + | |
17 | 16 | | |
18 | 17 | | |
19 | | - | |
20 | | - | |
| 18 | + | |
| 19 | + | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
| |||
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
37 | | - | |
38 | | - | |
| 36 | + | |
| 37 | + | |
39 | 38 | | |
40 | | - | |
41 | | - | |
| 39 | + | |
| 40 | + | |
42 | 41 | | |
0 commit comments