Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: master update #136

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
c6278f4
feat: add support for semantic releases on dev and master (#124)
kanatliemre Jan 25, 2023
f3dae5d
fix(CI): remove redundant build step
kanatliemre Jan 25, 2023
bbec93a
fix: add github semantic-release module
kanatliemre Jan 26, 2023
9a71f05
fix(CI): reove publish email
kanatliemre Jan 26, 2023
1511660
fix: bump bip32 and bitcoinjs libraries (#126)
kanatliemre Mar 24, 2023
6913592
chore(release): 0.20.0-alpha.1 [skip ci]
semantic-release-bot Mar 28, 2023
2e12d46
fix: attempting redeploy with semantic release
kanatliemre Mar 28, 2023
3600dfd
chore(release): 0.20.0-alpha.2 [skip ci]
semantic-release-bot Mar 28, 2023
6abd38b
fix: attempting semantic release with readme change
kanatliemre Mar 28, 2023
668d67b
chore(release): 0.20.0-alpha.3 [skip ci]
semantic-release-bot Mar 28, 2023
b6e84e0
fix: publish with semantic release
kanatliemre Mar 28, 2023
52b5a21
chore(release): 0.20.0-alpha.4 [skip ci]
semantic-release-bot Mar 28, 2023
dcbd1bd
fix: rename semantic release tag to alpha
kanatliemre Mar 28, 2023
342c184
fix: revert branch name to dev
kanatliemre Mar 28, 2023
848a65b
chore(release): 0.20.0-alpha.5 [skip ci]
semantic-release-bot Mar 28, 2023
8dc6dbd
feat: support glacier (#128)
kanatliemre May 1, 2023
eaec548
fix: add npm token to release actions
kanatliemre May 1, 2023
f1333e2
chore(release): 0.20.0-alpha.6 [skip ci]
semantic-release-bot May 1, 2023
f7ca44c
chore: empty commit
kanatliemre May 1, 2023
cd492fe
Merge branch 'dev' of https://github.com/ava-labs/avalanche-wallet-sd…
kanatliemre May 1, 2023
1400c38
fix: dev release action
kanatliemre May 1, 2023
c75ec0d
chore(release): 0.20.0-alpha.7 [skip ci]
semantic-release-bot May 1, 2023
219e4fd
fix: lower bitcoinjslib version and remove ECPair package (#129)
kanatliemre May 4, 2023
ce4d24e
chore(release): 0.20.0-alpha.8 [skip ci]
semantic-release-bot May 4, 2023
227122a
Fix/tinysecp (#131)
kanatliemre May 4, 2023
1401382
feat: switch hd scan algo to glacier (#130)
kanatliemre May 4, 2023
0df93b6
chore(release): 0.20.0-alpha.9 [skip ci]
semantic-release-bot May 4, 2023
027a192
fix: release token
kanatliemre May 4, 2023
35b804a
chore(release): 0.20.0-alpha.10 [skip ci]
semantic-release-bot May 4, 2023
f902e43
fix: downgrade web3.js
kanatliemre May 4, 2023
dd3e7b6
Merge branch 'dev' of https://github.com/ava-labs/avalanche-wallet-sd…
kanatliemre May 4, 2023
498dd0b
chore(release): 0.20.0-alpha.11 [skip ci]
semantic-release-bot May 4, 2023
0ab3390
chore(deps): bump semver from 5.7.1 to 5.7.2 (#134)
dependabot[bot] Aug 9, 2023
a8f6c76
chore(deps): bump @openzeppelin/contracts from 4.8.3 to 4.9.2 (#133)
dependabot[bot] Aug 9, 2023
f2eb51c
chore(deps): bump decode-uri-component from 0.2.0 to 0.2.2 (#117)
dependabot[bot] Aug 9, 2023
07b9963
chore(deps): bump http-cache-semantics from 4.1.0 to 4.1.1 (#125)
dependabot[bot] Aug 9, 2023
23c894c
chore(deps): bump qs from 6.5.2 to 6.5.3 (#118)
dependabot[bot] Aug 9, 2023
b585201
chore(deps): bump express from 4.17.1 to 4.18.2 (#119)
dependabot[bot] Aug 9, 2023
c32b11b
fix: bump web3 libs
kanatliemre Aug 9, 2023
138f581
chore(release): 0.20.0-alpha.12 [skip ci]
semantic-release-bot Aug 9, 2023
c3dde45
chore(deps): bump word-wrap from 1.2.3 to 1.2.5 (#135)
dependabot[bot] Aug 9, 2023
e21d09c
chore(deps): bump @babel/traverse from 7.14.7 to 7.23.2
dependabot[bot] Oct 17, 2023
e6ca6f0
chore(deps): bump crypto-js from 4.1.1 to 4.2.0
dependabot[bot] Oct 25, 2023
2960d37
fix: Resolve build error
iknowhtml Nov 16, 2023
db5503f
Merge pull request #139 from ava-labs/dependabot/npm_and_yarn/crypto-…
iknowhtml Nov 16, 2023
222a6d7
chore(release): 0.20.0-alpha.13 [skip ci]
semantic-release-bot Nov 16, 2023
d85eacb
Merge pull request #138 from ava-labs/dependabot/npm_and_yarn/babel/t…
iknowhtml Nov 16, 2023
0809b63
chore(deps): bump browserify-sign from 4.2.1 to 4.2.2 (#140)
dependabot[bot] Nov 16, 2023
2dca8a5
fix(deps): bump @openzeppelin/contracts from 4.9.2 to 4.9.3 (#137)
dependabot[bot] Nov 16, 2023
267f8dc
chore(release): 0.20.0-alpha.14 [skip ci]
semantic-release-bot Nov 16, 2023
35260ca
fix: Trigger manual release
iknowhtml Nov 16, 2023
47a666d
chore(release): 0.20.0-alpha.15 [skip ci]
semantic-release-bot Nov 16, 2023
4e5959a
fix: Trigger manual release
iknowhtml Nov 16, 2023
b37b908
chore(release): 0.20.0-alpha.16 [skip ci]
semantic-release-bot Nov 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,38 @@ on:
- dev
pull_request:

env:
node_version: 16

jobs:
Test:
runs-on: ${{ matrix.os }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_READONLY }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
os: [ubuntu-latest]
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
cache: yarn
node-version: ${{ env.node_version }}
node-version: ${{ matrix.node-version }}
- run: echo '//registry.npmjs.org/:_authToken= ${{ secrets.NPM_TOKEN_READONLY }}' >> .npmrc
- run: yarn --frozen-lockfile --network-timeout 1000000
- run: yarn test --ci --coverage --maxWorkers=2
Lint:
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_READONLY }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
cache: yarn
node-version: ${{ env.node_version }}
node-version: ${{ matrix.node-version }}
- run: echo '//registry.npmjs.org/:_authToken= ${{ secrets.NPM_TOKEN_READONLY }}' >> .npmrc
- run: yarn --frozen-lockfile
- run: yarn lint
33 changes: 33 additions & 0 deletions .github/workflows/dev-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release dev branch (alpha)
on:
push:
branches:
- dev
jobs:
release:
name: Release Dev Branch
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v2
with:
cache: yarn
node-version: 18.x
- name: add .npmrc
run: echo '//registry.npmjs.org/:_authToken= ${{ secrets.NPM_TOKEN_READONLY }}' >> .npmrc
- name: Install dependencies
run: yarn install
- name: add publishing .npmrc
run: echo '//registry.npmjs.org/:_authToken= ${{ secrets.NPM_TOKEN }}' >> .npmrc
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_BRANCH: dev
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn run semantic-release
35 changes: 35 additions & 0 deletions .github/workflows/master-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release master branch
on:
push:
branches:
- master
jobs:
release:
name: Release Master Branch
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 18.x
- name: add .npmrc
run: echo '//registry.npmjs.org/:_authToken= ${{ secrets.NPM_TOKEN_READONLY }}' >> .npmrc
- name: Install dependencies
run: yarn install
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_BRANCH: master
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn run semantic-release
- name: Rebase dev branch
run: |
git checkout dev &&
git rebase master &&
git push origin dev
91 changes: 91 additions & 0 deletions .releaserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/*
This file contains the configuration for semantic release, the library we use to tag the correct
semantic version numbers onto releases. We have two release paths, one on master and one on dev branch.

In the code below we check the env variable RELEASE_BRANCH to decide what we should do. As of
the time of this file semantic release does not support specifying a config file from their CLI,
so this is the only we can have dynamic configs based on branch.

To test run this file, first get a github token at https://github.com/settings/tokens
and add it to the GITHUB_TOKEN env variable then specify what branch you want to run (master or dev) under RELEASE_BRANCH

$ export GITHUB_TOKEN=<token>
$ export RELEASE_BRANCH=<main or release>
$ run yarn run semantic-release -d


*/

const commitAnalyzerSetting = [
'@semantic-release/commit-analyzer',
{
preset: 'angular',
releaseRules: [
{
type: 'feat',
release: 'minor',
},
{
type: '*',
release: 'patch',
},
],
parserOpts: {
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES'],
},
},
];

const githubSetting = [
'@semantic-release/github',
{
assets: [],
failTitle: false,
successComment: false,
failComment: false,
labels: false,
},
];

const gitSetting = [
'@semantic-release/git',
{
assets: ['package.json'],
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
},
];

/**
* This is used to publish to npm
*/
const npmRelease = [
'@semantic-release/npm',
{
npmPublish: true,
pkgRoot: '.',
},
];

const changelogGen = ['@semantic-release/changelog', {}];

const releaseNotesGen = ['@semantic-release/release-notes-generator', {}];

let plugins;
if (process.env && process.env.RELEASE_BRANCH === 'master') {
plugins = [commitAnalyzerSetting, githubSetting, changelogGen, releaseNotesGen, npmRelease, gitSetting];
} else {
plugins = [githubSetting, npmRelease, gitSetting];
}

module.exports = {
branches: [
{
name: 'master',
},
{
name: 'dev',
prerelease: 'alpha',
},
],
plugins,
};
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

# Avalanche Wallet SDK (Beta)

Avalanche wallet SDK is a typescript library for creating and managing decentralized wallets.
Avalanche Wallet SDK is a Typescript library for creating and managing decentralized wallets.

It provides high level methods to transact on Avalanche's primary networks: X, P and C.
It provides high level methods to transact on Avalanche's primary networks: X, P and C chain.

Wallet types supported:

Expand Down Expand Up @@ -44,3 +44,7 @@ or yarn
## Webpack

For Webpack version 5 and above you must use this plugin with it. https://www.npmjs.com/package/node-polyfill-webpack-plugin

## Docs

Can generate documentation with `yarn docs` and open `docs/index.html` in a browser.
36 changes: 23 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.19.1",
"version": "0.20.0-alpha.16",
"license": "BSD-3",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand All @@ -18,14 +18,14 @@
"lint": "eslint .",
"prepare": "husky install && yarn build:prod",
"start": "rollup -c --watch",
"test:watch": "jest --watch",
"test": "jest"
"test:watch": "NODE_OPTIONS=--openssl-legacy-provider jest --watch",
"test": "NODE_OPTIONS=--openssl-legacy-provider jest"
},
"lint-staged": {
"**/*": "prettier --write --ignore-unknown"
},
"name": "@avalabs/avalanche-wallet-sdk",
"author": "AVA Labs",
"author": "Ava Labs",
"repository": {
"type": "git",
"url": "https://github.com/ava-labs/avalanche-wallet-sdk"
Expand All @@ -40,61 +40,71 @@
"@rollup/plugin-commonjs": "21.0.3",
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-typescript": "8.3.1",
"@semantic-release/changelog": "6.0.2",
"@semantic-release/commit-analyzer": "9.0.2",
"@semantic-release/git": "10.0.1",
"@semantic-release/github": "8.0.7",
"@semantic-release/npm": "9.0.2",
"@semantic-release/release-notes-generator": "10.0.3",
"@types/big.js": "^6.0.2",
"@types/bn.js": "5.1.0",
"@types/create-hash": "1.2.2",
"@types/crypto-js": "4.1.1",
"@types/hdkey": "2.0.1",
"@types/jest": "27.4.1",
"@types/jest": "29.4.0",
"@types/randomstring": "1.1.8",
"@types/tiny-secp256k1": "1.0.0",
"@typescript-eslint/eslint-plugin": "5.17.0",
"@typescript-eslint/parser": "5.17.0",
"@zerollup/ts-transform-paths": "1.7.18",
"avalanche": "3.15.2",
"babel-jest": "27.5.1",
"babel-jest": "29.4.0",
"babel-plugin-module-resolver": "4.1.0",
"eslint": "8.12.0",
"eslint-config-prettier": "8.5.0",
"husky": "6.0.0",
"jest": "27.5.1",
"jest": "29.4.0",
"lint-staged": "12.3.7",
"prettier": "2.6.2",
"rollup": "2.70.1",
"rollup-plugin-delete": "2.0.0",
"rollup-plugin-typescript2": "0.31.2",
"semantic-release": "20.1.0",
"ts-node": "10.7.0",
"tslib": "2.3.1",
"ttypescript": "1.5.13",
"ttypescript": "1.5.15",
"typedoc": "0.22.13",
"typescript": "4.6.3"
},
"dependencies": {
"@avalabs/glacier-sdk": "2.8.0-alpha.92",
"@avalabs/hw-app-avalanche": "0.6.6",
"@ethereumjs/common": "2.6.0",
"@ethereumjs/tx": "3.4.0",
"@ledgerhq/hw-app-eth": "6.29.6",
"@ledgerhq/hw-transport": "6.27.5",
"@metamask/eth-sig-util": "4.0.0",
"@obsidiansystems/hw-app-avalanche": "0.2.2",
"@openzeppelin/contracts": "4.7.3",
"@openzeppelin/contracts": "4.9.3",
"big.js": "^6.1.1",
"bip32": "2.0.6",
"bip32": "4.0.0",
"bip32-path": "0.4.2",
"bip39": "3.0.4",
"bitcoinjs-lib": "5.2.0",
"bn.js": "5.2.1",
"create-hash": "1.2.0",
"crypto-js": "4.1.1",
"crypto-js": "4.2.0",
"ethereumjs-util": "^7.0.7",
"ethers": "5.6.8",
"hdkey": "2.0.1",
"moment": "2.29.4",
"randomstring": "1.2.2",
"sockette": "2.0.6",
"tiny-secp256k1": "1.1.6",
"typescript-transform-paths": "2.2.3",
"url": "0.11.0",
"web3": "1.8.1",
"web3-eth-contract": "1.8.1",
"web3": "1.10.0",
"web3-eth-contract": "1.10.0",
"xss": "1.0.11"
},
"peerDependencies": {
Expand Down
6 changes: 6 additions & 0 deletions src/Explorer/glacier/Glacier.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Glacier } from '@avalabs/glacier-sdk';

const api = new Glacier({
BASE: 'https://glacier-api-dev.avax.network',
});
export default api;
10 changes: 10 additions & 0 deletions src/Explorer/glacier/filterDuplicateGlacierTxs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { TransactionType } from './models';

export function filterDuplicateGlacierTxs(txs: TransactionType[]) {
const ids: string[] = [];
return txs.filter((tx) => {
if (ids.includes(tx.txHash)) return false;
ids.push(tx.txHash);
return true;
});
}
Loading