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 #402 from PureStake/master
Browse files Browse the repository at this point in the history
Release 1.9.0
  • Loading branch information
PureBrent authored May 24, 2022
2 parents 4651fba + f23f974 commit ae81eea
Show file tree
Hide file tree
Showing 60 changed files with 855 additions and 3,230 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: |
## Updates
## Patch X.Y.Z
$CHANGES
2 changes: 1 addition & 1 deletion .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
with:
path-to-signatures: 'signatures/cla.v0.json'
path-to-document: 'https://github.com/PureStake/algosigner-cla/blob/main/CLA.md' # e.g. a CLA or a DCO document
path-to-document: 'https://github.com/PureStake/algosigner-cla/blob/main/CLA.md#algosigner-individual-contributor-license-agreement' # e.g. a CLA or a DCO document
# branch should not be protected
branch: 'main'
allowlist: janmarcano,fxgamundi,purestaketdb,PureBrent,mmaurello,ekenigs
Expand Down
29 changes: 6 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,15 @@ _This is the preferred solution for end-users, updates will be automatically ins

Developers working with dApps may also install directly from the release package, or by downloading the project and building it.

# `AlgoSigner.sign()` and `AlgoSigner.signMultisig()` will be deprecated mid April.
# `AlgoSigner.sign()` and `AlgoSigner.signMultisig()` have been officially deprecated.

## Since v1.7.0, AlgoSigner no longer supports incomplete atomic groups signing.
## 1.8.0 Release
## 1.9.0 Release

### Functionality updates
This update is focused around rekey and changes to accommodate it. Both normal accounts and new reference accounts can be used directly in the UI and used by dApps if the proper authAddr is provided in the transaction.
- Rekeying transactions now available
- Transactions with rekeyed accounts now accepted
- Reference accounts can now be imported with public key only
### Main updates
This update adds supports for easier transfers with the new autocomplete feature. Start typing an account or contact name 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.
- Autocomplete support for UI-made transfers
- `AlgoSigner.sign()` and `AlgoSigner.signMultisig()` have been deprecated

### Patch 1.8.4

Dependency updates.

### Patch 1.8.3

Fix for transaction notes created in the UI and signed with a Ledger device.

### Patch 1.8.2

Fix for Ledger transactions created in the UI with transfer amounts set to 0.

### Patch 1.8.1

UI Improvements for rekey transactions and reference accounts.

## New Users

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": "algosigner",
"version": "1.8.4",
"version": "1.9.0",
"author": "https://developer.purestake.io",
"description": "Sign Algorand transactions in your browser with PureStake.",
"repository": "https://github.com/PureStake/algosigner",
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.8.4",
"version": "1.9.0",
"author": "https://developer.purestake.io",
"description": "Common library functions for AlgoSigner.",
"repository": "https://github.com/PureStake/algosigner",
Expand Down
42 changes: 42 additions & 0 deletions packages/common/src/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { Namespace } from './types';

interface ConfigTemplate {
name: string; // Formatted name, used for titles
ledgers: Array<string> | null; // Ledgers supported, null if there's no restriction
api: string; // Templated URL to call for uncached aliases
findAliasedAddresses: Function; // How to process the API response to get the aliased address
// @TODO: add caching/expiry
}

const noop = (): void => {
/* no-op */
};

export class AliasConfig {
static [Namespace.AlgoSigner_Contacts]: ConfigTemplate = {
name: 'AlgoSigner Contact',
ledgers: null,
api: '',
findAliasedAddresses: noop,
};

static [Namespace.AlgoSigner_Accounts]: ConfigTemplate = {
name: 'AlgoSigner Account',
ledgers: null,
api: '',
findAliasedAddresses: noop,
};

public static getMatchingNamespaces(ledger: string): Array<any> {
const matchingNamespaces: Array<string> = [];
for (const n in Namespace) {
if (
AliasConfig[n] &&
(AliasConfig[n].ledgers === null || AliasConfig[n].ledgers.includes(ledger))
) {
matchingNamespaces.push(n);
}
}
return matchingNamespaces;
}
}
3 changes: 1 addition & 2 deletions packages/common/src/messaging/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ export enum JsonRpcMethod {
SignAllowMultisig = 'sign-allow-multisig',
SignAllowWalletTx = 'sign-allow-wallet-tx',
SignDeny = 'sign-deny',
SignTransaction = 'sign-transaction',
SignMultisigTransaction = 'sign-multisig-transaction',
SignWalletTransaction = 'sign-wallet-transaction',
SendTransaction = 'send-transaction',
Algod = 'algod',
Expand Down Expand Up @@ -46,6 +44,7 @@ export enum JsonRpcMethod {
GetContacts = 'get-contacts',
SaveContact = 'save-contact',
DeleteContact = 'delete-contact',
GetAliasedAddresses = 'get-aliased-addresses',

// Ledger Device Methods
LedgerSaveAccount = 'ledger-save-account',
Expand Down
13 changes: 9 additions & 4 deletions packages/common/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ export type Transaction = {
readonly to: TAccount;
};

export type MultisigTransaction = {
readonly msig: any;
readonly txn: Transaction;
};
export enum Ledger {
TestNet = 'TestNet',
MainNet = 'MainNet',
}

export type WalletMultisigMetadata = {
readonly version: number;
Expand All @@ -70,3 +70,8 @@ export type WalletTransaction = {
readonly msig?: WalletMultisigMetadata;
readonly authAddr?: string;
};

export enum Namespace {
AlgoSigner_Contacts = 'AlgoSigner_Contacts',
AlgoSigner_Accounts = 'AlgoSigner_Accounts',
}
10 changes: 10 additions & 0 deletions packages/common/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,14 @@ export function removeEmptyFields(obj: { [index: string]: any }): any {
*/
export function isLedgerBaseSupported(ledger: string): boolean {
return getBaseSupportedLedgers().map((l) => l.name.toLowerCase()).includes(ledger.toLowerCase());
}

/**
* Converts full addresses into a shorter format:
* AAAAAAAAAA.....AAAAAAAAAA
* @param address
* @returns string
*/
export function obfuscateAddress(address: string): string {
return `${address.slice(0, 10)}.....${address.slice(-10)}`;
}
2 changes: 1 addition & 1 deletion packages/crypto/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "algosigner-crypto",
"version": "1.8.4",
"version": "1.9.0",
"author": "https://developer.purestake.io",
"description": "Cryptographic wrapper for saving and retrieving extention information in Algosigner.",
"repository": {
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.8.4",
"version": "1.9.0",
"author": "https://developer.purestake.io",
"repository": "https://github.com/PureStake/algosigner",
"license": "MIT",
Expand Down
2 changes: 0 additions & 2 deletions packages/dapp/src/algosigner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ class Wrapper {
};

public connect: Function = this.task.connect;
public sign: Function = this.task.sign;
public signMultisig: Function = this.task.signMultisig;
public send: Function = this.task.send;
public accounts: Function = this.task.accounts;
public algod: Function = this.task.algod;
Expand Down
8 changes: 5 additions & 3 deletions packages/dapp/src/fn/interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { RequestError, Transaction, MultisigTransaction } from '@algosigner/common/types';
import { RequestError, WalletTransaction } from '@algosigner/common/types';
import { JsonPayload } from '@algosigner/common/messaging/types';

/* eslint-disable no-unused-vars */
export interface ITask {
sign(p: Transaction, e: RequestError): Promise<JsonPayload>;
signMultisig(p: MultisigTransaction, e: RequestError): Promise<JsonPayload>;
signTxn(
transactionsOrGroups: Array<WalletTransaction>,
error: RequestError
): Promise<JsonPayload>;
}
4 changes: 2 additions & 2 deletions packages/dapp/src/fn/task.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ describe('task tests', () => {
};
const error = RequestError.None;
const task = new Task();
task.sign(transaction, error);
task.send(transaction, error);
expect(MessageBuilder.promise).toHaveBeenLastCalledWith(
JsonRpcMethod.SignTransaction,
JsonRpcMethod.SendTransaction,
transaction,
error
);
Expand Down
12 changes: 0 additions & 12 deletions packages/dapp/src/fn/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { MessageBuilder } from '../messaging/builder';
import {
Transaction,
RequestError,
MultisigTransaction,
WalletTransaction,
} from '@algosigner/common/types';
import { JsonRpcMethod, JsonPayload } from '@algosigner/common/messaging/types';
Expand All @@ -22,17 +21,6 @@ export class Task extends Runtime implements ITask {
return MessageBuilder.promise(JsonRpcMethod.Accounts, params as JsonPayload, error);
}

sign(params: Transaction, error: RequestError = RequestError.None): Promise<JsonPayload> {
return MessageBuilder.promise(JsonRpcMethod.SignTransaction, params, error);
}

signMultisig(
params: MultisigTransaction,
error: RequestError = RequestError.None
): Promise<JsonPayload> {
return MessageBuilder.promise(JsonRpcMethod.SignMultisigTransaction, params, error);
}

send(params: Transaction, error: RequestError = RequestError.None): Promise<JsonPayload> {
return MessageBuilder.promise(JsonRpcMethod.SendTransaction, params, error);
}
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.8.4",
"version": "1.9.0",
"description": "Algorand Wallet Extension | Send & Receive ALGOs | Sign dApp Transactions",
"icons": {
"48": "icon.png"
Expand Down
4 changes: 2 additions & 2 deletions packages/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "algosigner-extension",
"version": "1.8.4",
"version": "1.9.0",
"author": "https://developer.purestake.io",
"repository": "https://github.com/PureStake/algosigner",
"license": "MIT",
Expand All @@ -20,7 +20,7 @@
"webpack-cli": "^4.9.0"
},
"dependencies": {
"algosdk": "1.15.0",
"algosdk": "1.16.0",
"buffer": "^6.0.3"
},
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion packages/extension/src/background/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging from '@algosigner/common/logging';
import { LedgerTemplate } from '@algosigner/common/types/ledgers';
import { Ledger, Backend, API } from './messaging/types';
import { Ledger } from '@algosigner/common/types';
import { Backend, API } from './messaging/types';
import { parseUrlServerAndPort } from './utils/networkUrlParser';

export class Settings {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { JsonRpcMethod } from '@algosigner/common/messaging/types';
import { Ledger } from './types';
import { Ledger } from '@algosigner/common/types';
import encryptionWrap from '../encryptionWrap';
import { InternalMethods } from './internalMethods';
import algosdk from 'algosdk';
Expand Down
Loading

0 comments on commit ae81eea

Please sign in to comment.