@slide-computer/signer-web
v3.6.4
Published
JavaScript and TypeScript library to communicate with web signers on the Internet Computer
Downloads
829
Maintainers
Readme
@slide-computer/signer-web
JavaScript and TypeScript library to communicate with web signers on the Internet Computer.
Installation
Using signer web:
npm i --save @slide-computer/signer-web
In the browser:
import { PostMessageTransport } from "@slide-computer/signer-web";
To create an ICRC-29 post message transport, run
const transport = new PostMessageTransport({
openWindow: () => window.open(SIGNER_RPC_URL, SIGNER_WINDOW_NAME)
});
Either use with @slide-computer/signer
const signer = new Signer({transport});
Or directly in your custom implementation
const channel = await transport.establishChannel();
const listener = channel.registerListener((response) => {
// Process incoming responses
});
// Send outgoing requests
channel.send(JSON_RPC_REQUEST);