Skip to content

Commit 6c1fb52

Browse files
authored
Merge pull request ava-labs#156 from ava-labs/dev
Master Update
2 parents 3dca5f9 + c2677ec commit 6c1fb52

35 files changed

+1691
-582
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ on: [push]
33

44
jobs:
55
build:
6-
runs-on: ubuntu-latest
6+
runs-on: macos-latest
77

88
strategy:
99
matrix:
1010
# The node version, you can put one or many versions in here to test with
11-
node: [12.14.1]
11+
node: [15.6.0]
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v1
@@ -28,10 +28,15 @@ jobs:
2828
- run: sudo npm install -g yarn
2929

3030
- run: yarn install
31+
env:
32+
CYPRESS_CACHE_FOLDER: ~/.cache/Cypress
3133

3234
- name: linting
3335
run: yarn run lint
3436

37+
- name: jest-run
38+
run: yarn test
39+
3540
- name: cypress-run
3641
uses: cypress-io/github-action@v2
3742
env:

.release-it.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"git": {
3+
"requireCleanWorkingDir": false,
4+
"commitMessage": "chore(release): v${version}"
5+
},
6+
"github": {
7+
"release": true,
8+
"tokenRef": "RELEASE_IT_GITHUB_TOKEN"
9+
},
10+
"npm": {
11+
"publish": false
12+
}
13+
}

README.md

Lines changed: 62 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,64 @@
1-
21
# Avalanche (AVAX) Wallet
32

4-
This is the frontend Vue.js application for the Avalanche (AVAX) Wallet.
5-
3+
This is the frontend Vue.js application for the Avalanche (AVAX) Wallet.
64

75
## Prerequisites
86

9-
- Yarn (https://classic.yarnpkg.com/en/docs/install/)
10-
- Recent version of npm (6.13.4)
11-
- Node v12.14.1
12-
- Gecko, Avalanche client in Golang (https://github.com/ava-labs/gecko)
7+
- Yarn (https://classic.yarnpkg.com/en/docs/install/)
8+
- Recent version of npm (6.13.4)
9+
- Node v12.14.1
10+
- Gecko, Avalanche client in Golang (https://github.com/ava-labs/gecko)
1311

1412
## Installation
1513

16-
1) Clone the repo ``git clone https://github.com/ava-labs/avalanche-wallet.git``
17-
2) Go to root of the project ``cd avalanche-wallet``
18-
3) Install javascript dependencies with ``yarn install``.
14+
1. Clone the repo `git clone https://github.com/ava-labs/avalanche-wallet.git`
15+
2. Go to root of the project `cd avalanche-wallet`
16+
3. Install javascript dependencies with `yarn install`.
1917

2018
## Running The Project
2119

2220
In order for the wallet to work, it needs the Avalanche network to operate on. By default the wallet will connect to the Avalanche test network.
2321

24-
1) If you want to connect to a local network, make sure you have installed and able to run a Gecko node properly.
25-
2) Run the project with hot reloading ``yarn serve``
22+
1. If you want to connect to a local network, make sure you have installed and able to run a Gecko node properly.
23+
2. Run the project with hot reloading `yarn serve`
2624

27-
When you go to the website on your browser, you might get a warning saying
25+
When you go to the website on your browser, you might get a warning saying
2826
"Site is not secure". This is because we are signing our own SSL Certificates. Please ignore and continue to the website.
2927

3028
## Deployment
3129

32-
1) Compile and minify to have a production ready application with ``yarn build``.
33-
2) Serve from the ``/dist`` directory.
34-
35-
## Changing the Network
36-
37-
By default the wallet will connect to the Avalanche test network. You can change to another network by clicking the button labeled `TestNet` on the navigation bar and selecting another network, or add a custom network.
30+
<<<<<<< HEAD
31+
32+
1. Compile and minify to have a production ready application with `yarn build`.
33+
2. # Serve from the `/dist` directory.
34+
35+
1) Compile and minify to have a production ready application with `yarn build`.
36+
2) Serve from the `/dist` directory.
37+
38+
## Releases
39+
40+
1. Generate a [personal access token](https://github.com/settings/tokens/new?scopes=repo&description=release-it)
41+
2. Save it in your local env as RELEASE_IT_GITHUB_TOKEN
42+
3. Run `yarn release`
43+
44+
## Changing the Network
45+
46+
By default the wallet will connect to the Avalanche test network. You can change to another network by clicking the button labeled `TestNet` on the navigation bar and selecting another network, or add a custom network.
47+
48+
> > > > > > > dev
49+
50+
## Changing the Network
51+
52+
<<<<<<< HEAD
53+
By default the wallet will connect to the Avalanche test network. You can change to another network by clicking the button labeled `TestNet` on the navigation bar and selecting another network, or add a custom network.
3854

3955
## Explorer API
4056

57+
# The wallet uses the Avalanche Explorer API to display wallet transaction history.
4158

42-
The wallet uses the Avalanche Explorer API to display wallet transaction history.
59+
The wallet uses the Avalanche Explorer API to display wallet transaction history.
60+
61+
> > > > > > > dev
4362
4463
WARNING: This history might be out of order and incomplete.
4564

@@ -49,8 +68,12 @@ We suggest using Google Chrome to view the Avalanche Wallet website.
4968

5069
### Firefox and https
5170

71+
<<<<<<< HEAD
72+
Firefox does not allow https requests to localhost. But the Avalanche Wallet uses https by default, so we will need to change this to http. Make this switch by editing the `vue.config.js` file in the root directory and change
73+
=======
74+
Firefox does not allow https requests to localhost. But the Avalanche Wallet uses https by default, so we will need to change this to http. Make this switch by editing the `vue.config.js` file in the root directory and change
5275

53-
Firefox does not allow https requests to localhost. But the Avalanche Wallet uses https by default, so we will need to change this to http. Make this switch by editing the `vue.config.js` file in the root directory and change
76+
> > > > > > > dev
5477
5578
```
5679
devServer: {
@@ -68,125 +91,48 @@ devServer: {
6891

6992
and run `yarn serve` to reflect the change.
7093

71-
# Keystore File Spec
72-
73-
### v1.0.0 (initial)
74-
75-
```typescript
76-
interface IKeystoreFile{
77-
salt
78-
pass_hash
79-
keys: [
80-
{
81-
key,
82-
nonce,
83-
address
84-
}
85-
]
86-
}
87-
```
88-
89-
### v2.0.0
90-
91-
```typescript
92-
interface IKeystoreFile{
93-
version
94-
salt
95-
pass_hash
96-
warnings
97-
keys: [
98-
{
99-
key
100-
iv
101-
address
102-
}
103-
]
104-
}
105-
```
106-
107-
### v3.0.0
108-
Underlying encryption changed.
109-
```typescript
110-
interface IKeystoreFile{
111-
version
112-
salt
113-
pass_hash
114-
warnings
115-
keys: [
116-
{
117-
key
118-
iv
119-
address
120-
}
121-
]
122-
}
123-
```
124-
125-
### v4.0.0
126-
Avalanche uses bech32 addresses. Removed address field from keys and the warning message.
127-
```typescript
128-
interface IKeystoreFile{
129-
version
130-
salt
131-
pass_hash
132-
keys: [
133-
{
134-
key
135-
iv
136-
}
137-
]
138-
}
139-
```
140-
141-
142-
### v5.0.0
143-
Encodes mnemonic phrase as the key.
144-
```typescript
145-
interface IKeystoreFile{
146-
version
147-
salt
148-
pass_hash
149-
keys: [
150-
{
151-
key
152-
iv
153-
}
154-
]
155-
}
156-
```
157-
158-
159-
16094
# Local Storage Remember Wallet Spec
95+
16196
Basically same as storing the keystore file in the browser localstorage.
16297

16398
If there is a remembered wallet it will be the Keystore JSON format.
16499

165100
```json
166101
{
167-
"w": IKeystoreFile | undefined
102+
"w": IKeystoreFile | undefined
168103
}
169104
```
170105

171106
# Language Setting
107+
172108
Saved into local storage as a 2 letter code.
109+
173110
```
174111
"lang": "en"
175112
```
176113

177114
# Dependencies
115+
178116
##### Avalanche Node (https://github.com/ava-labs/avalanchego)
117+
179118
To get utxos and to send transactions.
119+
180120
#### Explorer API Node (https://github.com/ava-labs/ortelius)
121+
181122
To check if an address was used before, and to get activity history.
182123

183124
# Default Connections
125+
184126
The wallet needs to connect to an Avalanche node, and an explorer node to operate properly.
185127

186-
By default, there are two network options to connect to: `Mainnet` and `Fuji`.
128+
By default, there are two network options to connect to: `Mainnet` and `Fuji`.
129+
187130
##### Mainnet
188-
- Avalanche API: `https://api.avax.network:443`
189-
- Explorer API: `https://explorerapi.avax.network`
131+
132+
- Avalanche API: `https://api.avax.network:443`
133+
- Explorer API: `https://explorerapi.avax.network`
134+
190135
##### Fuji (Testnet)
191-
- Avalanche API: `https://api.avax-test.network:443`
192-
- Explorer API: `https://explorerapi.avax-test.network`
136+
137+
- Avalanche API: `https://api.avax-test.network:443`
138+
- Explorer API: `https://explorerapi.avax-test.network`

jest.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
// crypto = require('@trust/webcrypto')
2-
31
module.exports = {
42
moduleFileExtensions: ['js', 'ts', 'json', 'vue'],
53
transform: {
64
'.*\\.(vue)$': 'vue-jest',
7-
'^.+\\.tsx?$': 'ts-jest',
5+
'^.+\\.ts?$': 'ts-jest',
6+
'^.+\\.js?$': 'babel-jest',
87
},
98
moduleNameMapper: {
109
'@/(.*)$': '<rootDir>/src/$1',
1110
},
11+
setupFilesAfterEnv: ['./jest.setup.js'],
1212
testURL: 'https://localhost/',
1313
testEnvironment: 'jsdom',
1414
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',

jest.setup.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const crypto = require('crypto')
2+
3+
window.crypto = crypto.webcrypto

package.json

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,21 @@
11
{
22
"name": "wallet",
3-
"version": "0.1.0",
3+
"private": true,
4+
"version": "0.1.4",
45
"engines": {
5-
"node": "12.14.1"
6+
"node": ">=15.6.0"
67
},
7-
"private": true,
88
"scripts": {
99
"build": "vue-cli-service build",
1010
"cypress": "cypress run",
1111
"format": "prettier '**/*.{js,ts,vue}' --write",
1212
"lint": "vue-cli-service lint",
13+
"release": "release-it",
1314
"serve": "vue-cli-service serve",
1415
"test_watch": "jest --verbose --watch ./tests",
16+
"test_debug": "node --inspect-brk node_modules/.bin/jest ./tests --runInBand",
1517
"test": "jest --verbose ./tests"
1618
},
17-
"jest": {
18-
"moduleFileExtensions": [
19-
"js",
20-
"ts",
21-
"json",
22-
"vue"
23-
],
24-
"transform": {
25-
".*\\.(vue)$": "vue-jest",
26-
"^.+\\.tsx?$": "ts-jest"
27-
},
28-
"moduleNameMapper": {
29-
"@/(.*)$": "<rootDir>/src/$1"
30-
},
31-
"testURL": "https://localhost/",
32-
"testEnvironment": "jsdom",
33-
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$"
34-
},
3519
"dependencies": {
3620
"@avalabs/vue_components": "0.7.4",
3721
"@fortawesome/fontawesome-svg-core": "1.2.26",
@@ -82,8 +66,10 @@
8266
"qrcode": "1.4.4",
8367
"reflect-metadata": "0.1.13",
8468
"register-service-worker": "1.6.2",
69+
"release-it": "^14.2.2",
8570
"roboto-fontface": "0.10.0",
8671
"serve": "11.3.2",
72+
"uniqid": "^5.2.0",
8773
"uuid": "3.4.0",
8874
"vue": "2.6.12",
8975
"vue-class-component": "7.2.3",
@@ -113,7 +99,6 @@
11399
"@vue/eslint-config-typescript": "^4.0.0",
114100
"@vue/test-utils": "^1.0.3",
115101
"babel-core": "^7.0.0-bridge.0",
116-
"canvas": "^2.6.1",
117102
"cypress": "^4.12.1",
118103
"cypress-file-upload": "^4.0.7",
119104
"deepmerge": "^4.2.2",

0 commit comments

Comments
 (0)