This page has been updated for Wallets SDK V1. If you are using the previous version,
see the previous version docs or the V1 migration guide.
Extended by
Constructors
new DeviceSignerKeyStorage()
new DeviceSignerKeyStorage(Defined in: packages/wallets/src/utils/device-signers/DeviceSignerKeyStorage.ts:8apiKey):DeviceSignerKeyStorage
Parameters
| Parameter | Type |
|---|---|
apiKey | string |
Returns
DeviceSignerKeyStorage
Methods
deleteKey()
Defined in: packages/wallets/src/utils/device-signers/DeviceSignerKeyStorage.ts:66 Delete the key pair associated with the given wallet address.abstractdeleteKey(address):Promise<void>
Parameters
| Parameter | Type | Description |
|---|---|---|
address | string | The wallet address whose key pair to remove. |
Returns
Promise<void>
generateKey()
Call Signature
Defined in: packages/wallets/src/utils/device-signers/DeviceSignerKeyStorage.ts:17 Generate a new P-256 key pair and persist it.abstractgenerateKey(params):Promise<string>
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
Defined in: packages/wallets/src/utils/device-signers/DeviceSignerKeyStorage.ts:21 Generate a new P-256 key pair and persist it.abstractgenerateKey(params):Promise<string>
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
Defined in: packages/wallets/src/utils/device-signers/DeviceSignerKeyStorage.ts:26 Generate a new P-256 key pair and persist it.abstractgenerateKey(params):Promise<string>
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()
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.abstractgetDeviceName():string
Returns
string
A descriptive name for the current device.
getKey()
Defined in: packages/wallets/src/utils/device-signers/DeviceSignerKeyStorage.ts:45 Retrieve the public key for a given wallet address.abstractgetKey(address):Promise<string|null>
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()
Defined in: packages/wallets/src/utils/device-signers/DeviceSignerKeyStorage.ts:52 Check if a key with the given public key exists on this device.abstracthasKey(publicKeyBase64):Promise<boolean>
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()
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.abstractmapAddressToKey(address,publicKeyBase64):Promise<void>
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()
Defined in: packages/wallets/src/utils/device-signers/DeviceSignerKeyStorage.ts:60 Sign a message using the private key associated with the given wallet address.abstractsignMessage(address,message):Promise<{r:string;s:string; }>
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.
