Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request #421 from PureStake/develop
Browse files Browse the repository at this point in the history
Patch 1.9.2
  • Loading branch information
PureBrent authored Jul 7, 2022
2 parents fb7d9c7 + 26bdcc7 commit deabe4f
Show file tree
Hide file tree
Showing 19 changed files with 298 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
template: |
## Patch X.Y.Z
## Updates
$CHANGES
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.15
16.15
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Developers working with dApps may also install directly from the release package

An interactive transition guide is available [here](https://purestake.github.io/algosigner-dapp-example/v1v2TransitionGuide.html).

## 1.9.1 Release
## 1.9.2 Release

### Main updates
This update adds supports for easier transfers with the new autocomplete feature. Start typing an account, contact name or name service alias on the destination field when sending Algos or ASAs and you'll be able to select the desired address from a dropdown. This also marks the end of the support of the older signing methods that were previously available.
Expand All @@ -24,6 +24,9 @@ This update adds supports for easier transfers with the new autocomplete feature
- External name services (NFDomains and Algorand Namespace Service)
- `AlgoSigner.sign()` and `AlgoSigner.signMultisig()` have been deprecated

### Other updates
- Improved Account Importing and Cache Clearing

## New Users

- Watch [Getting Started with AlgoSigner](https://youtu.be/tG-xzG8r770)
Expand Down
4 changes: 0 additions & 4 deletions docs/connection-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,19 @@ Find and press any disconnect button present on the dApp.

<img src="./connection_images/disconnect.png" width="300" />
<br />
<br />

Open the config menu and log out of AlgoSigner.

<img src="./connection_images/open-config.png" height="400" />
<img src="./connection_images/logout.png" height="400" />
<br />
<br />

Reload the tab/window where the dApp is open and attempt to connect again.

<img src="./connection_images/reload.png" height="80" />
<img src="./connection_images/connect.png" height="80" />

<br />
<hr />
<br />

## Additional steps

Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algosigner/common",
"version": "1.9.1",
"version": "1.9.2",
"author": "https://developer.purestake.io",
"description": "Common library functions for AlgoSigner.",
"repository": "https://github.com/PureStake/algosigner",
Expand Down
1 change: 1 addition & 0 deletions packages/common/src/messaging/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export enum JsonRpcMethod {
GetSession = 'get-session',
Login = 'login',
Logout = 'logout',
ClearCache = 'clear-cache',
AccountDetails = 'account-details',
Transactions = 'transactions',
AssetDetails = 'asset-details',
Expand Down
4 changes: 2 additions & 2 deletions packages/crypto/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "algosigner-crypto",
"version": "1.9.1",
"version": "1.9.2",
"author": "https://developer.purestake.io",
"description": "Cryptographic wrapper for saving and retrieving extention information in Algosigner.",
"description": "Cryptographic wrapper for saving and retrieving extention information in AlgoSigner.",
"repository": {
"type": "git",
"url": "https://github.com/PureStake/algosigner/packages/crypto.git"
Expand Down
2 changes: 1 addition & 1 deletion packages/dapp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algosigner/dapp",
"version": "1.9.1",
"version": "1.9.2",
"author": "https://developer.purestake.io",
"repository": "https://github.com/PureStake/algosigner",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "AlgoSigner",
"author": "https://developer.purestake.io",
"version": "1.9.1",
"version": "1.9.2",
"description": "Algorand Wallet Extension | Send & Receive ALGOs | Sign dApp Transactions",
"icons": {
"48": "icon.png"
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "algosigner-extension",
"version": "1.9.1",
"version": "1.9.2",
"author": "https://developer.purestake.io",
"repository": "https://github.com/PureStake/algosigner",
"license": "MIT",
Expand Down
24 changes: 19 additions & 5 deletions packages/extension/src/background/messaging/internalMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,21 @@ export class InternalMethods {
return true;
}

public static [JsonRpcMethod.Logout](request: any, sendResponse: Function) {
InternalMethods.clearSession();
Task.clearPool();
sendResponse(true);
return true;
}

public static [JsonRpcMethod.ClearCache](request: any, sendResponse: Function) {
const extensionStorage = new ExtensionStorage();
extensionStorage.setStorage('cache', initializeCache(), (isSuccessful) =>
sendResponse(isSuccessful)
);
return true;
}

public static [JsonRpcMethod.CreateAccount](request: any, sendResponse: Function) {
var keys = algosdk.generateAccount();
var mnemonic = algosdk.secretKeyToMnemonic(keys.sk);
Expand Down Expand Up @@ -583,20 +598,19 @@ export class InternalMethods {

// Check for asset details saved in storage, if needed
if ('assets' in res && res.assets.length > 0) {
const missingAssets = [];
const assetDetails = [];
for (var i = res.assets.length - 1; i >= 0; i--) {
const assetId = res.assets[i]['asset-id'];
if (assetId in cache.assets[ledger]) {
res.assets[i] = {
...res.assets[i],
...cache.assets[ledger][assetId],
...res.assets[i],
};
} else {
missingAssets.push(assetId);
}
assetDetails.push(assetId);
}

if (missingAssets.length > 0) AssetsDetailsHelper.add(missingAssets, ledger);
if (assetDetails.length > 0) AssetsDetailsHelper.add(assetDetails, ledger);

res.assets.sort((a, b) => a['asset-id'] - b['asset-id']);
}
Expand Down
8 changes: 4 additions & 4 deletions packages/extension/src/background/messaging/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1275,11 +1275,11 @@ export class Task {
[JsonRpcMethod.Login]: (request: any, sendResponse: Function) => {
return InternalMethods[JsonRpcMethod.Login](request, sendResponse);
},
/* eslint-disable-next-line no-unused-vars */
[JsonRpcMethod.Logout]: (request: any, sendResponse: Function) => {
InternalMethods.clearSession();
Task.clearPool();
sendResponse(true);
return InternalMethods[JsonRpcMethod.Logout](request, sendResponse);
},
[JsonRpcMethod.ClearCache]: (request: any, sendResponse: Function) => {
return InternalMethods[JsonRpcMethod.ClearCache](request, sendResponse);
},
[JsonRpcMethod.GetSession]: (request: any, sendResponse: Function) => {
return InternalMethods[JsonRpcMethod.GetSession](request, sendResponse);
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/src/background/utils/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function getIndexer(ledger: string) {

// Helper function to initialize Cache
export function initializeCache(
c: Cache | undefined,
c: Cache | undefined = undefined,
ledger: Ledger | undefined = undefined
): Cache {
let cache: Cache;
Expand Down
4 changes: 2 additions & 2 deletions packages/storage/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "algosigner-storage",
"version": "1.9.1",
"version": "1.9.2",
"author": "https://developer.purestake.io",
"repository": "https://github.com/PureStake/algosigner",
"license": "MIT",
"description": "Storage wrapper for saving and retrieving extention information in Algosigner.",
"description": "Storage wrapper for saving and retrieving extention information in AlgoSigner.",
"devDependencies": {
"ts-loader": "^9.2.6",
"typescript": "^4.4.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/test-project/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "algorand-test-project",
"version": "1.9.1",
"version": "1.9.2",
"repository": "https://github.com/PureStake/algosigner",
"license": "MIT",
"description": "Repository for tests",
Expand Down
7 changes: 6 additions & 1 deletion packages/test-project/tests/common/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ function ImportAccount(account) {
await extensionPage.click('#importAccount');
await extensionPage.waitForSelector('#accountName');
await extensionPage.type('#accountName', account.name);
await extensionPage.type('#enterMnemonic', account.mnemonic);
const accountMnemonic = account.mnemonic.split(' ');
for (let i = 0; i < accountMnemonic.length; i++) {
const mnemonicWordId = '#mnemonicWord' + i;
await extensionPage.type(mnemonicWordId, accountMnemonic[i]);
}
await extensionPage.waitForTimeout(200);
await extensionPage.click('#nextStep');
await inputPassword();
await extensionPage.waitForTimeout(2000);
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "algosigner-ui",
"version": "1.9.1",
"version": "1.9.2",
"author": "https://developer.purestake.io",
"repository": "https://github.com/PureStake/algosigner",
"license": "MIT",
Expand Down
8 changes: 5 additions & 3 deletions packages/ui/src/components/SettingsMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ const SettingsMenu: FunctionalComponent = () => {
};

const clearCache = () => {
store.clearCache(() => {
route('/wallet');
flip();
sendMessage(JsonRpcMethod.ClearCache, {}, function () {
store.clearCache(() => {
route('/wallet');
flip();
});
});
};

Expand Down
Loading

0 comments on commit deabe4f

Please sign in to comment.