Documentation Index
Fetch the complete documentation index at: https://docs.crossmint.com/llms.txt
Use this file to discover all available pages before exploring further.
Defined in: packages/wallets/src/utils/device-signers/DeviceSignerKeyStorage.ts:7
Extended by
Constructors
new DeviceSignerKeyStorage()
new DeviceSignerKeyStorage(apiKey): DeviceSignerKeyStorage
Defined in: packages/wallets/src/utils/device-signers/DeviceSignerKeyStorage.ts:8
Parameters
| Parameter | Type |
|---|
apiKey | string |
Returns
DeviceSignerKeyStorage
Methods
deleteKey()
abstract deleteKey(address): Promise<void>
Defined in: packages/wallets/src/utils/device-signers/DeviceSignerKeyStorage.ts:66
Delete the key pair associated with the given wallet address.
Parameters
| Parameter | Type | Description |
|---|
address | string | The wallet address whose key pair to remove. |
Returns
Promise<void>
generateKey()
Call Signature
abstract generateKey(params): Promise<string>
Defined in: packages/wallets/src/utils/device-signers/DeviceSignerKeyStorage.ts:17
Generate a new P-256 key pair and persist it.
Parameters
| Parameter | Type | Description |
|---|
params | { address: string; biometricPolicy: "always" | "none"; } | Key generation parameters. |
params.address? | string | Optional wallet address to associate the key with. If omitted, the key should be stored under a temporary identifier until mapAddressToKey is called. |
params.biometricPolicy? | "always" | "none" | - |
Returns
Promise<string>
The uncompressed public key encoded as a base64 string.
Call Signature
abstract generateKey(params): Promise<string>
Defined in: packages/wallets/src/utils/device-signers/DeviceSignerKeyStorage.ts:21
Generate a new P-256 key pair and persist it.
Parameters
| Parameter | Type | Description |
|---|
params | { address: string; biometricExpirationTime: number; biometricPolicy: "session"; } | Key generation parameters. |
params.address? | string | Optional wallet address to associate the key with. If omitted, the key should be stored under a temporary identifier until mapAddressToKey is called. |
params.biometricExpirationTime | number | - |
params.biometricPolicy | "session" | - |
Returns
Promise<string>
The uncompressed public key encoded as a base64 string.
Call Signature
abstract generateKey(params): Promise<string>
Defined in: packages/wallets/src/utils/device-signers/DeviceSignerKeyStorage.ts:26
Generate a new P-256 key pair and persist it.
Parameters
| Parameter | Type | Description |
|---|
params | { address: string; biometricExpirationTime: number; biometricPolicy: BiometricPolicy; } | Key generation parameters. |
params.address? | string | Optional wallet address to associate the key with. If omitted, the key should be stored under a temporary identifier until mapAddressToKey is called. |
params.biometricExpirationTime? | number | - |
params.biometricPolicy? | BiometricPolicy | - |
Returns
Promise<string>
The uncompressed public key encoded as a base64 string.
getDeviceName()
abstract getDeviceName(): string
Defined in: packages/wallets/src/utils/device-signers/DeviceSignerKeyStorage.ts:73
Get a human-readable name for this device (e.g. “MacBook Pro”, “iPhone 15”).
Used to label device signers in the API for identification purposes.
Returns
string
A descriptive name for the current device.
getKey()
abstract getKey(address): Promise<string | null>
Defined in: packages/wallets/src/utils/device-signers/DeviceSignerKeyStorage.ts:45
Retrieve the public key for a given wallet address.
Parameters
| Parameter | Type | Description |
|---|
address | string | The wallet address whose public key to look up. |
Returns
Promise<string | null>
The base64-encoded public key, or null if no key is found for the address.
hasKey()
abstract hasKey(publicKeyBase64): Promise<boolean>
Defined in: packages/wallets/src/utils/device-signers/DeviceSignerKeyStorage.ts:52
Check if a key with the given public key exists on this device.
Parameters
| Parameter | Type | Description |
|---|
publicKeyBase64 | string | The base64-encoded public key to look for. |
Returns
Promise<boolean>
true if the key exists on the device, false otherwise.
mapAddressToKey()
abstract mapAddressToKey(address, publicKeyBase64): Promise<void>
Defined in: packages/wallets/src/utils/device-signers/DeviceSignerKeyStorage.ts:38
Associate an already-generated key pair with a wallet address.
Used when the wallet address is not yet known at the time of key generation.
Parameters
| Parameter | Type | Description |
|---|
address | string | The wallet address to map the key to. |
publicKeyBase64 | string | The base64-encoded public key returned by generateKey. |
Returns
Promise<void>
signMessage()
abstract signMessage(address, message): Promise<{ r: string; s: string; }>
Defined in: packages/wallets/src/utils/device-signers/DeviceSignerKeyStorage.ts:60
Sign a message using the private key associated with the given wallet address.
Parameters
| Parameter | Type | Description |
|---|
address | string | The wallet address whose private key to sign with. |
message | string | The message string to sign. |
Returns
Promise<{ r: string; s: string; }>
The ECDSA signature split into its r and s components, each as a hex string.