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 #481 from PureStake/develop
Browse files Browse the repository at this point in the history
Release 1.11.0
  • Loading branch information
PureBrent authored Mar 3, 2023
2 parents 626944c + 8590f35 commit 63c45c1
Show file tree
Hide file tree
Showing 82 changed files with 2,174 additions and 1,911 deletions.
2 changes: 2 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name-template: "Patch $NEXT_PATCH_VERSION"
tag-template: "v$NEXT_PATCH_VERSION"
template: |
## Updates
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ on:
types: [opened,closed,synchronize]

jobs:
CLAssistant:
CLA_assistant:
runs-on: ubuntu-latest
steps:
- name: "CLA Assistant"
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
# Beta Release
uses: cla-assistant/github-action@v2.1.3-beta
uses: contributor-assistant/github-action@v2.3.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# the below token should have repo scope and must be manually added by you in the repository's secret
Expand All @@ -24,7 +24,7 @@ jobs:
branch: 'main'
allowlist: janmarcano,fxgamundi,purestaketdb,PureBrent,mmaurello,ekenigs

#below are the optional inputs - If the optional inputs are not given, then default values will be taken
#below are the optional inputs - If the optional inputs are not given, then default values will be taken
remote-organization-name: purestake
remote-repository-name: algosigner-cla
#create-file-commit-message: 'For example: Creating file for storing CLA Signatures'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
env:
CI: 'true'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '12.15'
node-version: '16.15'
- name: Install build dependencies
run: npm run install:extension
- name: Run unit tests
Expand All @@ -26,23 +26,23 @@ jobs:
env:
CI: 'true'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '12.15'
node-version: '16.15'
- name: Install test dependencies
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 'true'
run: npm run postinstall
- name: Build
run: npm run build
- name: Run headful puppeteer tests
uses: djp3/puppeteer-headful@master
uses: mujo-code/puppeteer-headful@16.6.0
with:
args: npm run test:github
- name: Upload screenshots
if: ${{ always() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: screenshot
path: ./packages/test-project/screenshots/*.png
Expand All @@ -53,16 +53,16 @@ jobs:
env:
CI: 'true'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '12.15'
node-version: '16.15'
- name: Install build dependencies
run: npm run install:extension
- name: Build
run: npm run build
- name: Upload build artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: build
path: ./dist/*
21 changes: 9 additions & 12 deletions .github/workflows/zip-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ on:
- released

jobs:
test_zip_upload:
build_zip_upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '12.15'
node-version: '16.15'
- name: Delete all dist
run: npm run clean
- name: Install dependencies
Expand All @@ -22,12 +22,9 @@ jobs:
- name: Zip up release
id: zip_up
run: zip -r AlgoSigner.zip ./dist/*
- name: Upload
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload build as asset
uses: svenstaro/upload-release-action@v2
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./AlgoSigner.zip
asset_name: AlgoSigner.zip
asset_content_type: application/zip
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: AlgoSigner.zip
32 changes: 18 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,28 @@ _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.

## 1.10.1 Release
### Important

### Main updates
As part of the process of supporting the [Algorand Foundations ARCs](https://arc.algorand.foundation/), in 1.10.0, a number of non-breaking additions have been made to support how dApps will work with AlgoSigner. In time, the existing legacy features will be deprecated.

- A new top level object, `window.algorand` is made available and can be accessed by the dapp to make calls to AlgoSigner. The existing `window.AlgoSigner` object remains but will be deprecated over the next year.
- An updated connection flow and address discovery process for dApps is in place, using `algorand.enable()`. **The existing connection flow persists but will be deprecated over the next 3-6 months.**
- Dapps may also now request for AlgoSigner to directly post signed transactions to the network and not return the signed blob to the dApp for handling.
- Additional documentation regarding the use of `authAddr` for signing transactions with rekeyed accounts.
As part of the process of supporting the [Algorand Foundations ARCs](https://arc.algorand.foundation/), in 1.10.0, a number of non-breaking additions have been made to support how dApps will work with AlgoSigner. In time, the existing legacy features will be deprecated.

An interactive transition guide is available [here](https://purestake.github.io/algosigner-dapp-example/arcTransitionGuide.html) to aid in the migration of existing functionalities.

### Other updates (1.10.1):
- Transaction signing with Ledger devices now support signing multiple transactions in a single group at once. Also updated the Ledger libraries.
- Added support for the `boxes` field on application transactions and the `stateProofKey` & `nonParticipation` fields for key registration transactions.
- Various bugfixes:
- Fixed an issue where custom networks weren't working correctly on `algorand.enable()` calls.
- Fixed an issue AlgoSigner becoming unresponsive when trying to sign a transaction with a Reference Account with no `authAddr` provided.
## 1.11.0 Release

### Main updates

- Multiple improvements to Custom Networks including:
- Automatic fetching of genesis ID and hashes for the user.
- Achieved full compatibility with `enable()` calls.
- Other UI/UX changes.
- Updated a lot of error messages and data structures to better communicate the causes of errors.

### Other updates and bugfixes:
- Connecting to a dApp using an `enable()` call while logged out no longer closes the connection window after inputting your password.
- Improved validations for `keyreg` transactions regarding nonParticipation.
- Improved validations for `acfg` transactions regarding the distinctions between 'Create', 'Config' and 'Destroy'.
- Fixed account permission bug on `enable()` calls.
- SDK support updated to v2.0.0.

## New Users

Expand Down
4 changes: 2 additions & 2 deletions docs/dApp-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -582,9 +582,9 @@ Some of the following error codes may be returned when interacting with AlgoSign
| 4000 | An unknown error occured. | N/A |
| 4001 | The user rejected the signature request. | N/A |
| 4100 | The requested operation and/or account has not been authorized by the user. | This is usually due to the connection between the dApp and the wallet becoming stale and the user [needing to reconnect](connection-issues.md). Otherwise, it may signal that you are trying to sign with private keys not found on AlgoSigner. |
| 4200 | The wallet does not support the requested operation. | N/A |
| 4200 | The wallet does not support the requested operation. | Users need to have imported or created an account on AlgoSigner before connecting to dApps, as well as succesfully having configured any custom networks required. |
| 4201 | The wallet does not support signing that many transactions at a time. | The max number of transactions per group is 16. For Ledger devices, they currently can't sign more than one transaction at the same time. |
| 4202 | The wallet was not initialized properly beforehand. | Users need to have imported or created an account on AlgoSigner before connecting to dApps. |
| 4202 | The wallet was not initialized properly beforehand. | The extension user has not authorized requests from this website. |
| 4300 | The input provided is invalid. | AlgoSigner rejected some of the transactions due to invalid fields. |
| 4400 | Some transactions were not sent properly. | Some, but not all of the transactions were able to be posted to the network. The IDs of the succesfully posted transactions as well as information on the failing ones are provided on the error.

Expand Down
8 changes: 4 additions & 4 deletions docs/legacy-dApp-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,8 @@ AlgoSigner.send({
- A non-matching ledger name will result in a error:
- The provided ledger is not supported (Code: 4200).
- An empty request will result with an error:
- Ledger not provided. Please use a base ledger: [TestNet,MainNet] or an available custom one [{"name":"Theta","genesisId":"thetanet-v1.0"}].
- Transaction requests will require a valid matching "genesisId", even for custom networks.
- Ledger not provided. Please use a base ledger: [TestNet,MainNet] or an available custom one [{"name":"Theta","genesisID":"thetanet-v1.0"}].
- Transaction requests will require a valid matching "genesisID", even for custom networks.

## Signature Rejection Messages

Expand All @@ -536,9 +536,9 @@ AlgoSigner may return some of the following error codes when requesting signatur
| 4000 | An unknown error occured. | N/A |
| 4001 | The user rejected the signature request. | N/A |
| 4100 | The requested operation and/or account has not been authorized by the user. | This is usually due to the connection between the dApp and the wallet becoming stale and the user [needing to reconnect](connection-issues.md). Otherwise, it may signal that you are trying to sign with private keys not found on AlgoSigner. |
| 4200 | The wallet does not support the requested operation. | N/A |
| 4200 | The wallet does not support the requested operation. | Users need to have imported or created an account on AlgoSigner before connecting to dApps, as well as succesfully having configured any custom networks required. |
| 4201 | The wallet does not support signing that many transactions at a time. | The max number of transactions per group is 16. For Ledger devices, they can't sign more than one transaction at the same time. |
| 4202 | The wallet was not initialized properly beforehand. | Users need to have imported or created an account on AlgoSigner before connecting to dApps |
| 4202 | The wallet was not initialized properly beforehand. | The extension user has not authorized requests from this website. |
| 4300 | The input provided is invalid. | AlgoSigner rejected some of the transactions due to invalid fields. |

Additional information, if available, would be provided in the `data` field of the error object.
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.10.1",
"version": "1.11.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.10.1",
"version": "1.11.0",
"author": "https://developer.purestake.io",
"description": "Common library functions for AlgoSigner.",
"repository": "https://github.com/PureStake/algosigner",
Expand Down
4 changes: 2 additions & 2 deletions packages/common/src/common.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ test('RequestError - Structure', () => {
code: 4100,
});

expect(RequestError.SigningError(4000, [testError])).toMatchObject({
message: 'There was a problem signing the transaction(s).',
expect(RequestError.SigningValidationError(4000, [testError])).toMatchObject({
message: 'There was a problem validating the transaction(s) to be signed. Please refer to the data property for the reasons behind each transaction.',
code: 4000,
data: [testError],
});
Expand Down
25 changes: 13 additions & 12 deletions packages/common/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Namespace, Ledger, Alias } from './types';
import { Namespace, Alias } from './types';
import { Network } from './types/network';

const MAX_ALIASES_PER_NAMESPACE = 6;

// prettier-ignore
interface ConfigTemplate {
name: string; // Formatted name, used for titles
ledgers: any; // Object holding supported Ledgers as keys, templated API URL as value
networks: any; // Object holding supported networks as keys, templated API URL as value
findAliasedAddresses: Function; // How to process the API response to get the aliased addresses array
apiTimeout: number; // Amount in ms to wait for the API to respond
}
Expand All @@ -17,25 +18,25 @@ const noop = (): void => {
export class AliasConfig {
static [Namespace.AlgoSigner_Contacts]: ConfigTemplate = {
name: 'AlgoSigner Contact',
ledgers: null,
networks: null,
findAliasedAddresses: noop,
apiTimeout: 0,
};

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

static [Namespace.NFD]: ConfigTemplate = {
name: 'NFDomains',
ledgers: {
[Ledger.TestNet]:
networks: {
[Network.TestNet]:
'https://api.testnet.nf.domains/nfd?prefix=${term}&requireAddresses=true' +
`&limit=${MAX_ALIASES_PER_NAMESPACE}`,
[Ledger.MainNet]:
[Network.MainNet]:
'https://api.nf.domains/nfd?prefix=${term}&requireAddresses=true' +
`&limit=${MAX_ALIASES_PER_NAMESPACE}`,
},
Expand All @@ -50,11 +51,11 @@ export class AliasConfig {

static [Namespace.ANS]: ConfigTemplate = {
name: 'Algorand Name Service',
ledgers: {
[Ledger.TestNet]:
networks: {
[Network.TestNet]:
'https://testnet.api.algonameservice.com/names?pattern=${term}' +
`&limit=${MAX_ALIASES_PER_NAMESPACE}`,
[Ledger.MainNet]:
[Network.MainNet]:
'https://api.algonameservice.com/names?pattern=${term}' +
`&limit=${MAX_ALIASES_PER_NAMESPACE}`,
},
Expand All @@ -69,12 +70,12 @@ export class AliasConfig {
apiTimeout: 2000,
};

public static getMatchingNamespaces(ledger: string): Array<Namespace> {
public static getMatchingNamespaces(network: string): Array<Namespace> {
const matchingNamespaces: Array<Namespace> = [];
for (const n in Namespace) {
if (
AliasConfig[n] &&
(AliasConfig[n].ledgers === null || Object.keys(AliasConfig[n].ledgers).includes(ledger))
(AliasConfig[n].networks === null || Object.keys(AliasConfig[n].networks).includes(network))
) {
matchingNamespaces.push(n as Namespace);
}
Expand Down
Loading

0 comments on commit 63c45c1

Please sign in to comment.