index/functions/withGalaWalletIdentity.md
withGalaWalletIdentity<
T>(wallet,identity,signWith):Promise<T>
Runs signWith with identity selected on a Gala Wallet that supports setAddress. Gala
Wallet holds ONE current account, so two signatures for different identities in flight at once
would sign as whichever selection came last; the pair (select, sign) is therefore serialized
per wallet object, across every signer and provider that signs through it
(GalaWalletSigner, ./providers' GalaWalletProvider). A failed selection fails the
signature (nothing is requested). Without an identity, or on a wallet without setAddress, it
just runs signWith.
sign with set address gala wallet signer provider
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
wallet | GalaWalletApi |
identity | string | undefined |
signWith | () => Promise<T> |
gala wallet api sign with
Returns
Promise<T>
Example
const signature = await withGalaWalletIdentity(window.gala, 'eth|70997970C51812dc3A010C7d01b50e0d17dc79C8', () =>
window.gala.request({ method: 'personal_sign', params: [hexMessage, address] }),
);