Skip to content

Commit

Permalink
Support Signer's disconnectFromSite
Browse files Browse the repository at this point in the history
  • Loading branch information
zie1ony committed Apr 28, 2021
1 parent 2509ebf commit fa1f3f8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to casper-client-sdk.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 1.0.44

### Added

- Support `disconnectFromSite` method from the Signer.

## 1.0.43

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "casper-client-sdk",
"version": "1.0.43",
"version": "1.0.44",
"license": "Apache 2.0",
"description": "SDK to interact with the Casper blockchain",
"main": "dist/lib.node.js",
Expand Down
7 changes: 6 additions & 1 deletion src/@types/casperlabsSigner.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ interface CasperLabsHelper {
* Retrieve the active public key.
* @returns {string} Hex-encoded public key with algorithm prefix.
*/
getActivePublicKey: () => Promise<string>;
getActivePublicKey: () => Promise<string>;

/*
* Forces Signer to disconnect from the currently open site.
*/
disconnectFromSite: () => void;
}

interface SignerTestingHelper {
Expand Down
7 changes: 7 additions & 0 deletions src/lib/Signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ export const sign: (
return window.casperlabsHelper!.sign(messageBase16, publicKeyBase64);
};

/*
* Forces Signer to disconnect from the currently open site.
*/
export const disconnectFromSite: () => void = () => {
return window.casperlabsHelper!.disconnectFromSite();
};

export const forceConnection: () => void = () => {
return window.signerTestingHelper!.forceConnection();
};
Expand Down

0 comments on commit fa1f3f8

Please sign in to comment.