Description
The SDK says whether a person may claim a bare name (canClaimFullUsername, packages/individuality/src/username.ts:162, from #311 closing #302) and has nothing that claims one. The person origin ships (withAsPerson({ tag: "AliasWithAccount" }), as-person-signer.ts:126) and @parity/product-sdk-tx submits. Only the middle is missing.
The proof is out of scope: no signBytes path here can produce the call's lite_identity_proof, because the host wraps every raw payload in <Bytes>...</Bytes>. That is paritytech/host-rust-core#612, which blocks claiming today and owns that API. With the call and the gates here, adopting it changes one input.
Deliverable
Three exports, as signup-lite.ts and register.ts do for a gated write:
- A pure validator, minimum as a parameter since pure helpers read no chain: at least
MinUsernameLength bytes, every byte is_ascii_lowercase() so digits and hyphens fail too, at most 32 (the Username BoundedVec bound) checked before the encode. Nobody reads that constant: polkadot-ios-community alone carries (6, 30) and (7, 32) (ClaimUsernameModels.swift:8, Username.swift:33), where 30 refuses valid names and 7 is the pallet mock's value.
- A pinned eligibility read returning
Result with { canClaim, blockers, minLength, aliasToSign }. Gates are blockers carrying the offending value (LiteSignUpBlocker, signup-types.ts:125), never errors and never display copy.
- A call builder for the
Standalone arm, structurally typed, proof as opaque caller-supplied bytes as in registerPersonhoodTx. One arm because no TypeScript caller needs Reservation, not because it is unimplemented: iOS builds both.
Chain rules, individuality-community pallets/resources/src/lib.rs: validation :1680, gates :1370-1386, proof :1433, Reservation :1402.
How to test
Validator boundaries driven off the constant, blockers against a structural double, the encoded call against a fixture, and the call shape proved offline against the three pinned descriptors. No live run: #612 records this call finalizing on Preview with a patched host.
Description
The SDK says whether a person may claim a bare name (
canClaimFullUsername,packages/individuality/src/username.ts:162, from #311 closing #302) and has nothing that claims one. The person origin ships (withAsPerson({ tag: "AliasWithAccount" }),as-person-signer.ts:126) and@parity/product-sdk-txsubmits. Only the middle is missing.The proof is out of scope: no
signBytespath here can produce the call'slite_identity_proof, because the host wraps every raw payload in<Bytes>...</Bytes>. That isparitytech/host-rust-core#612, which blocks claiming today and owns that API. With the call and the gates here, adopting it changes one input.Deliverable
Three exports, as
signup-lite.tsandregister.tsdo for a gated write:MinUsernameLengthbytes, every byteis_ascii_lowercase()so digits and hyphens fail too, at most 32 (theUsernameBoundedVecbound) checked before the encode. Nobody reads that constant:polkadot-ios-communityalone carries(6, 30)and(7, 32)(ClaimUsernameModels.swift:8,Username.swift:33), where 30 refuses valid names and 7 is the pallet mock's value.Resultwith{ canClaim, blockers, minLength, aliasToSign }. Gates are blockers carrying the offending value (LiteSignUpBlocker,signup-types.ts:125), never errors and never display copy.Standalonearm, structurally typed, proof as opaque caller-supplied bytes as inregisterPersonhoodTx. One arm because no TypeScript caller needsReservation, not because it is unimplemented: iOS builds both.Chain rules,
individuality-communitypallets/resources/src/lib.rs: validation:1680, gates:1370-1386, proof:1433,Reservation:1402.How to test
Validator boundaries driven off the constant, blockers against a structural double, the encoded call against a fixture, and the call shape proved offline against the three pinned descriptors. No live run: #612 records this call finalizing on Preview with a patched host.