Virto Signer API / authenticators/substrate/src / SubstrateKey
Class: SubstrateKey
Defined in: authenticators/substrate/src/index.ts:36
Implements
Authenticator<number>
Constructors
Constructor
new SubstrateKey(
userId,signer,getChallenge,addressGenerator?):SubstrateKey
Defined in: authenticators/substrate/src/index.ts:43
Parameters
userId
string
signer
getChallenge
Challenger<number>
addressGenerator?
AddressGenerator = kreivoPassDefaultAddressGenerator
Returns
SubstrateKey
Properties
addressGenerator
readonlyaddressGenerator:AddressGenerator=kreivoPassDefaultAddressGenerator
Defined in: authenticators/substrate/src/index.ts:47
Implementation of
Authenticator.addressGenerator
getChallenge
readonlygetChallenge:Challenger<number>
Defined in: authenticators/substrate/src/index.ts:46
Implementation of
Authenticator.getChallenge
hashedUserId
hashedUserId:
Uint8Array
Defined in: authenticators/substrate/src/index.ts:41
SHA‑256 hash of userId. Filled once by setup and reused for all WebAuthn operations.
Implementation of
Authenticator.hashedUserId
userId
readonlyuserId:string
Defined in: authenticators/substrate/src/index.ts:44
Methods
authenticate()
authenticate(
context,xtc):Promise<TPassAuthenticate>
Defined in: authenticators/substrate/src/index.ts:100
Signs an arbitrary challenge with the substrate key and produces a TPassAuthenticate payload understood by PassSigner.
Parameters
context
number
Block number (or any numeric context expected by the pallet).
xtc
Uint8Array
Returns
Promise<TPassAuthenticate>
SCALE‑encoded authentication payload.
Throws
Error If no credential id is available.
Implementation of
Authenticator.authenticate
register()
register(
context):Promise<TKeyRegistration<number>>
Defined in: authenticators/substrate/src/index.ts:67
Parameters
context
number
Returns
Promise<TKeyRegistration<number>>
setup()
setup():
Promise<SubstrateKey>
Defined in: authenticators/substrate/src/index.ts:56
Pre‑computes hashedUserId.
Must be awaited once before any other interaction. Returns this for fluent chaining.
Returns
Promise<SubstrateKey>