@infinex/wallet-sdk
v0.0.1
Published
SDK to set up and communicate with an instance of @infinex/wallet
Downloads
3
Keywords
Readme
@infinex/wallet-sdk
SDK to create and communicate with an instance of the @infinex/wallet
.
Example
const sdk = new WalletSDK("#sdk", {
url: "http://my-key-app/",
});
// Unlock with a JWT
const jwt = "eyJhbG...";
const { address } = await sdk.unlock(jwt);
// Get an ethers wallet/signer
const provider = getEthersProvider();
const signer = sdk.ethersSigner(provider);
// Sign a message string with the wallet
const signature = await signer.signMessage(`A message from ${address}`);
// Lock the wallet
await lock();
console.log(address, signature);