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

devop: release v1.39 #432

Merged
merged 214 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
214 commits
Select commit Hold shift + click to select a range
ed03d04
Initial commit for Kadena provider
andborges Sep 6, 2023
e39afd0
Added Kadena signer to create account
andborges Sep 8, 2023
84581d5
Adding Kadena SignerType
andborges Sep 8, 2023
b7ac1cc
Added icon to account and link to block explorer
andborges Sep 8, 2023
9f92e32
WIP - Update kadena network to show testnet block explorer
Peixer Sep 8, 2023
f037935
Add getBalance for Kadena network
Peixer Sep 8, 2023
a1be184
update kadena network
Peixer Sep 8, 2023
d285a38
Add getAllActivity to kadena network
Peixer Sep 8, 2023
229ba6f
Adding Kadena testnet network
andborges Sep 8, 2023
d4cff75
Code reuse for decimals format; Config for qrcode scheme
andborges Sep 11, 2023
f05c2ea
Config for activity TTL
andborges Sep 11, 2023
5572ac1
"Add account" feature implementation for Kadena
andborges Sep 12, 2023
0bc6f24
WIP - Add send page
Peixer Sep 12, 2023
1b321ef
WIP - Send page
Peixer Sep 13, 2023
b309c8d
Sign and verify implementation
andborges Sep 13, 2023
f0856b8
Merge branch 'feature/kadena-provider' into add-send-page
andborges Sep 13, 2023
f975bc5
Using kadena crypto utils to sign and verify
andborges Sep 14, 2023
23ea21f
Fix activities tab; Removing coingecko for Kadena testnet
andborges Sep 18, 2023
882c2de
WIP - Update send and verify page
Peixer Sep 18, 2023
f4d4656
Merge branch 'add-send-page' of https://github.com/agencyenterprise/e…
Peixer Sep 18, 2023
474e63e
WIP - Update send page token
Peixer Sep 18, 2023
e33dc29
WIP - Uncomment code and update kda-token
Peixer Sep 18, 2023
30ee987
Adding Kadena providers to some other classes
andborges Sep 18, 2023
aa4d24d
update send transaction page
Peixer Sep 19, 2023
e739d32
update send and verify page
Peixer Sep 19, 2023
9e9f0f4
update kadena ui signer
Peixer Sep 19, 2023
c0a4294
Key generation using hd-keys
andborges Sep 19, 2023
d357377
Merge branch 'add-send-page' into feature/kadena-provider
andborges Sep 19, 2023
01ac5aa
refactor in kadena network
Peixer Sep 19, 2023
f8ccdb0
update decimals digits
Peixer Sep 20, 2023
b144cc8
WIP- get activities formatting value
Peixer Sep 20, 2023
760b1a2
Fixing sign method
andborges Sep 20, 2023
2c45f46
Merge branch 'add-send-page' into feature/kadena-provider
andborges Sep 20, 2023
6ebc4d1
merge from add-send-page branch
andborges Sep 20, 2023
0511d4a
Update buildtransaction
Peixer Sep 20, 2023
8c8128a
add getAccountDetails to kda-token abstract class
Peixer Sep 20, 2023
9aab29d
Merge branch 'add-send-page' into feature/kadena-provider
andborges Sep 20, 2023
83c5f80
Fix account details loading when the account does not exists
andborges Sep 20, 2023
62e2cb1
Fix activities tab
andborges Sep 20, 2023
fae6cf5
WIP - Update Kadena inject
Peixer Sep 21, 2023
878b033
Better error message on UI
andborges Sep 25, 2023
79a2619
Merge branch 'feature/kadena-provider' of github.com:agencyenterprise…
andborges Sep 25, 2023
ab56fd0
update background index
Peixer Sep 25, 2023
4c67de4
add acounts-states for kadena
Peixer Sep 25, 2023
d4e9d93
Creating accounts get UI for Kadena
andborges Sep 25, 2023
45c6acf
WIP - update provider pages
Peixer Sep 25, 2023
b097fc4
Rename Kadena get account method and add Kadena get balance method
andborges Sep 26, 2023
ddd1297
add kdaSignPayload
Peixer Sep 26, 2023
2475b21
remove unused files from Kadena provider
Peixer Sep 26, 2023
9cb706e
add kadena to popular network list
Peixer Sep 26, 2023
f832771
Adding message handler for Kadena provider
andborges Sep 26, 2023
09939f2
Switch network and disconnect
andborges Sep 27, 2023
318fbe5
remove commented code and unused code
Peixer Sep 27, 2023
67d44dc
refactor in network-activity-transaction
Peixer Sep 27, 2023
846364a
add chain id reference in the header-accounts component
Peixer Sep 27, 2023
42cd822
Events from wallet to dapp
andborges Sep 27, 2023
1a70ec1
Merge branch 'feature/kadena-provider' of github.com:agencyenterprise…
andborges Sep 27, 2023
e92ed76
Sending initial state on method
andborges Sep 27, 2023
3ce2ccd
update activity-handlers
Peixer Sep 27, 2023
4d43b25
upgrade size limit for activity-handlers
Peixer Sep 27, 2023
6b5fd87
fix activity-handlers
Peixer Sep 27, 2023
c172fa9
More infor to injected provider and methods
andborges Sep 28, 2023
3b0738d
Merge branch 'feature/kadena-provider' of github.com:agencyenterprise…
andborges Sep 28, 2023
5e75829
Kadena address should contain k:
Peixer Sep 28, 2023
0691d93
fix keyset in the kda-token
Peixer Sep 29, 2023
0e4ae1b
update send transaction page
Peixer Sep 29, 2023
b233680
remove pact-lang-api use on enkrypt source code
Peixer Sep 29, 2023
e4f1e89
update activity-handlers configs
Peixer Sep 29, 2023
85d5697
Merge branch 'main' into feature/kadena-provider
Peixer Sep 29, 2023
c9a11d9
fix some merge conflicts
Peixer Sep 29, 2023
297fa18
remove unnecessary config in tsconfig.json and remove unused function…
Peixer Sep 29, 2023
652cefb
rollback getBalanceAPI function
Peixer Sep 29, 2023
5999cfd
Change events returning k: address to injected provider
andborges Oct 2, 2023
233690b
Merge branch 'feature/kadena-provider' of github.com:agencyenterprise…
andborges Oct 2, 2023
ce47cc3
Some changes after PR review
andborges Oct 2, 2023
dd0df89
update kda-sign-message to use the right network
Peixer Oct 2, 2023
896fc1b
Removing reference to cardano-crypto-kadena.js
andborges Oct 2, 2023
fa3736e
Merge branch 'feature/kadena-provider' of github.com:agencyenterprise…
andborges Oct 2, 2023
699c60c
Removing unusued file
andborges Oct 2, 2023
5b436a9
Merge branch 'main' into feature/kadena-provider
Peixer Oct 3, 2023
3569d4a
fix in activity handlers to show the right status
Peixer Oct 3, 2023
f6ac2c6
Check transaction status after send
andborges Oct 3, 2023
85b429f
fix USD display on activity-handlers
Peixer Oct 3, 2023
141a40b
Merge branch 'feature/kadena-provider' of https://github.com/agencyen…
Peixer Oct 3, 2023
a786d87
small improvements and update kadena decimals digits
Peixer Oct 4, 2023
c1f009b
fix to support send value less than 0.0000001
Peixer Oct 4, 2023
a945004
feat: kadena network
kvhnuke Oct 5, 2023
86e3b82
feat: kadena network
kvhnuke Oct 5, 2023
04f4480
devop: update yarn lock
kvhnuke Oct 5, 2023
13a7df5
fix: tx signing issue
kvhnuke Oct 6, 2023
57ad399
devop: merge changes from kadena team
kvhnuke Oct 11, 2023
79388a2
devop: yarn dedupe
kvhnuke Oct 11, 2023
e92166d
Fix account icons on send and verify screen
andborges Oct 16, 2023
67bbae6
Do not accept 0 amount on send; Fix gass fee when sending max amount
andborges Oct 16, 2023
af58266
update address validation
Peixer Oct 16, 2023
1aa2e85
Merge branch 'feature/kadena-provider' of github.com:agencyenterprise…
andborges Oct 16, 2023
da95033
Fix amount calculation when set max is selected
andborges Oct 16, 2023
48e2277
WIP - Fix send transaction page
Peixer Oct 16, 2023
3ce6841
update send transaction page
Peixer Oct 17, 2023
fcd25d1
Disable import account for Kadena networks
andborges Oct 17, 2023
e2aa613
Merge branch 'feature/kadena-provider' of github.com:agencyenterprise…
andborges Oct 17, 2023
c6ed492
Fix address validation when account starts with k:
andborges Oct 17, 2023
ab75906
Fixing base path and changing unit tests
andborges Oct 18, 2023
fe8e0b7
Merge branch 'develop' into feature/kadena-provider
kvhnuke Oct 18, 2023
45c1cbe
Changing Kadena derivation path to a valid ED25519 value
andborges Oct 18, 2023
9dd90fc
fix derivation path indexing for kadena signer new path.
jayremias Oct 18, 2023
7ae1a68
Fixing unit tests for new derivation path indexing
andborges Oct 18, 2023
c2680a4
Merge pull request #359 from agencyenterprise/feature/kadena-provider
kvhnuke Oct 19, 2023
0c8a786
devop: add latest changes
kvhnuke Oct 19, 2023
2334b9a
fix: rename identicon
kvhnuke Oct 20, 2023
f5252ca
fix: btc account address naming
kvhnuke Oct 20, 2023
cc36bb4
Chnage Kadena derivation path to account
andborges Oct 31, 2023
666ae8b
update send transaction page to show the right KDA currency name
Peixer Nov 9, 2023
ad4d71f
Merge branch 'feature/kadena-provider' into feature/account-derivatio…
Peixer Nov 15, 2023
c5cedbf
WIP - Add multi-chain
Peixer Nov 20, 2023
3b7a08e
WIP - Update multi-chain
Peixer Nov 20, 2023
c036d88
update network-activity component to watch selectedChainId
Peixer Nov 20, 2023
5bedfc6
small refactor and update in App.vue to init the right chainId state
Peixer Nov 20, 2023
49af352
small refactor at kadena api
Peixer Nov 21, 2023
f255b33
Add chain provider
mateus-batista Nov 21, 2023
60ea6ca
remove chainProvider
Peixer Nov 22, 2023
2a6b843
refactor in App and header-accounts
Peixer Nov 22, 2023
da38a0e
update kadena account state
Peixer Nov 22, 2023
6690eb2
refactor kadena defaultChainId
Peixer Nov 22, 2023
ca7c534
update header-account component
Peixer Nov 22, 2023
510b302
small refactor regarding chainId
Peixer Nov 22, 2023
89dc379
fix avatar icons
Peixer Nov 22, 2023
88c7d98
update kadena derivation path to follow Kadena standard
Peixer Nov 22, 2023
fece4ea
update Kadena chain-list component
Peixer Nov 23, 2023
39f4a55
small refactor at network components
Peixer Nov 23, 2023
7ae1aa0
small css changes
Peixer Nov 23, 2023
9d02e40
update kda_getBalance
Peixer Nov 23, 2023
4edfb52
update sign test
Peixer Nov 24, 2023
642349e
fix kadena unit tests
Peixer Nov 24, 2023
9cdfc47
update send transaction validation of Kadena
Peixer Nov 28, 2023
bf54227
add custom buy link for Kadena testnet
Peixer Nov 28, 2023
481fe12
update deposit component to show chain id selected
Peixer Nov 28, 2023
7ba7aa6
Update display amount as negative in network-activity-transaction com…
Peixer Nov 28, 2023
f6c0f04
remove debugger lost in code
Peixer Nov 29, 2023
c0688da
add negative signal in network-transaction for Kadena network
Peixer Nov 29, 2023
37793a6
update send-address-input component to emit any input change
Peixer Nov 29, 2023
8225d83
added transaction result validation, it should be success to allow th…
Peixer Dec 5, 2023
bf29d26
Merge pull request #1 from agencyenterprise/feature/multi-chain
Peixer Dec 5, 2023
efb0ee6
update keyring tests
Peixer Dec 5, 2023
059acc2
Merge pull request #370 from kadena-community/feature/kadena-provider
kvhnuke Dec 14, 2023
47fd278
devop: create subnetworks
kvhnuke Dec 14, 2023
a9abd3c
devop: remove conditional kadena statements
kvhnuke Dec 14, 2023
4eb9143
Change kadena subnetworks to 20 for mainnet and testnet
Takadenoshi Jan 16, 2024
25b3a41
Update kadena testnet faucet link
Takadenoshi Jan 16, 2024
fe35ba5
Update kadena logomark to new branding
Takadenoshi Jan 18, 2024
6685d2d
Merge pull request #382 from Takadenoshi/fix/update-kadena-logo
kvhnuke Jan 18, 2024
009cdfb
Merge pull request #380 from Takadenoshi/fix/kadena-subchain-data
kvhnuke Jan 18, 2024
3824b99
Change balance lookup to use @kadena/client instead of pact-lang-api.…
Takadenoshi Jan 18, 2024
5a56203
replace pact-lang-api in getTransactionStatus; remove pect-lang-api
Takadenoshi Jan 18, 2024
4c1516f
simplify getTransactionStatus
Takadenoshi Jan 22, 2024
9ff4f2f
Merge pull request #385 from Takadenoshi/fix/remove-pact-lang-api
kvhnuke Jan 23, 2024
a6ea1be
Kadena: add chain ID to activity transaction entries
Takadenoshi Jan 29, 2024
fb1a506
broken
Takadenoshi Jan 29, 2024
74e5870
Kadena: add chain ID to activity transaction entries
Takadenoshi Jan 29, 2024
f09edd0
Kadena: fix missing sender/receiver for cross chain transfers in acti…
Takadenoshi Jan 29, 2024
20339ea
Kadena: activity transaction entries: change on/from based on isIncom…
Takadenoshi Jan 30, 2024
26e0e66
kadena: reorder v-if / class
Takadenoshi Jan 30, 2024
29727bd
Refactor account retrieval logic in kda_requestAccounts.handleRemaini…
andborges Jan 30, 2024
3c3a143
Update router navigation in sendAction function
andborges Jan 30, 2024
1b1335a
Updating assets when subnetwork changes
andborges Jan 31, 2024
92fae22
Update input validation class in send-input-amount
andborges Jan 31, 2024
74c08c5
Add balance update functionality when activities are updated
andborges Feb 1, 2024
08acb73
Updating assets when subnetwork changes
andborges Jan 31, 2024
6519f45
fix data propagation, simplify
Takadenoshi Feb 1, 2024
5b7ce11
linting
Takadenoshi Feb 1, 2024
72e9efa
fix props in network-activity
Takadenoshi Feb 1, 2024
40fae34
Fixed Kadena type in Activity.rawInfo
Takadenoshi Feb 5, 2024
dc7a1cb
change some kadena-specific code
Takadenoshi Feb 5, 2024
e8f3778
simplify more
Takadenoshi Feb 5, 2024
07319fe
revert symbol->network change in network-activity-total
Takadenoshi Feb 5, 2024
64d315a
Add send-alert component to send-transaction and verify-transaction
andborges Feb 6, 2024
046886a
Linting issues
andborges Feb 6, 2024
1b04bfe
Merge pull request #1 from agencyenterprise/bugfix/outstanding-issues
andborges Feb 6, 2024
52d8a88
Refactor sendAction function and remove unused CSS styles
andborges Feb 6, 2024
6df418e
Merge pull request #388 from Takadenoshi/fix/activities-kadena-add-cr…
kvhnuke Feb 6, 2024
e584cad
Merge pull request #387 from Takadenoshi/feat/kadena-chain-label-in-a…
kvhnuke Feb 6, 2024
86fe870
Merge pull request #389 from Takadenoshi/feat/kadena-chain-label-in-a…
kvhnuke Feb 6, 2024
e0e89da
Merge pull request #392 from agencyenterprise/feat/kadena-provider-2
kvhnuke Feb 22, 2024
786d51d
devop: merge main
kvhnuke Feb 22, 2024
5bdef30
devop: merge main
kvhnuke Feb 22, 2024
5a648b3
devop: merge with upstream
kvhnuke Feb 22, 2024
0a90c04
devop: minor changes
kvhnuke Feb 22, 2024
bcdb319
Merge pull request #371 from enkryptcom/feat/kadena-provider-2
kvhnuke Feb 22, 2024
965fc03
construct transfers with Pact.modules.coin.transfer
Takadenoshi Mar 21, 2024
cd161a9
fix to use transfer-create
Takadenoshi Mar 21, 2024
018a705
fix method of getting keyset account
Takadenoshi Mar 25, 2024
2667c22
Merge pull request #421 from Takadenoshi/fix/create-transfer-with-pac…
kvhnuke Apr 1, 2024
f8a8afa
Merge pull request #427 from enkryptcom/develop
kvhnuke Apr 4, 2024
5f48b77
chore: fix some typos
divdeploy Apr 5, 2024
12bcad2
fix: substrate ed issue
kvhnuke Apr 9, 2024
c5f8467
CAGA ankara testnet
cagacryptoAlexey Apr 9, 2024
901e33d
Merge pull request #428 from divdeploy/main
kvhnuke Apr 11, 2024
4690621
Merge pull request #430 from cagacryptoAlexey/caga
kvhnuke Apr 11, 2024
e91b874
Remove minheight= optimization when querying Kadena activities DB. Te…
Takadenoshi Apr 12, 2024
e8a2424
Merge pull request #433 from Takadenoshi/fix/remove-minheight-optimiz…
kvhnuke Apr 16, 2024
625f2d9
Merge pull request #429 from enkryptcom/fix/substrate-ed-error
kvhnuke Apr 16, 2024
5d2579e
devop: add login metrics
kvhnuke Apr 16, 2024
a488b1a
devop: add login metrics
kvhnuke Apr 16, 2024
2991aa4
fix: overlap
kvhnuke Apr 16, 2024
148eaae
devop: merge latest
kvhnuke May 1, 2024
0bfd4ce
fix: eth_accounts
kvhnuke May 1, 2024
81e324d
devop: merge latest
kvhnuke May 1, 2024
a94dc2d
devop: minor changes
kvhnuke May 1, 2024
abd4cf2
fix: dot sigs
kvhnuke May 1, 2024
e56bd10
fix: qa issues
kvhnuke May 2, 2024
4959d95
fix: from account existance
kvhnuke May 2, 2024
a240c91
Merge pull request #354 from enkryptcom/feature/kadena-provider
kvhnuke May 2, 2024
e1cc994
devop: set release version
kvhnuke May 2, 2024
254d5d3
devop: remove console.log
kvhnuke May 6, 2024
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Enkrypt is a web3 wallet built from the ground up to support the multi-chain fut
- Ontology
- Puppy Net
- Arthera
- Caga Ankara Testnet
- More coming soon!

Looking to add your project? [Contact us!](https://mewwallet.typeform.com/enkrypt-inquiry?typeform-source=www.enkrypt.com)
Expand Down
17 changes: 11 additions & 6 deletions packages/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
{
"name": "@enkryptcom/extension",
"version": "1.38.0",
"version": "1.39.0",
"private": true,
"scripts": {
"zip": "cd dist; zip -r release.zip *;",
"build:chrome": "cross-env BROWSER='chrome' vue-cli-service build && yarn build:rollup",
"build:operaedge": "cross-env BROWSER='opera-edge' vue-cli-service build && cross-env BROWSER='opera-edge' yarn build:rollup",
"build:firefox": "cross-env BROWSER='firefox' vue-cli-service build && yarn build:rollup && node configs/get-system-info.js",
"prebuild": "yarn kadena:prebuild",
"build:chrome": "yarn prebuild && cross-env BROWSER='chrome' vue-cli-service build && yarn build:rollup",
"build:firefox": "yarn prebuild && cross-env BROWSER='firefox' vue-cli-service build && yarn build:rollup && node configs/get-system-info.js",
"build:operaedge": "yarn prebuild && cross-env BROWSER='opera-edge' vue-cli-service build && cross-env BROWSER='opera-edge' yarn build:rollup",
"lint": "vue-cli-service lint --fix",
"build:rollup": "cross-env minify=on rollup --config configs/rollup.config.contentscript.mjs && cross-env minify=on rollup --config configs/rollup.config.inject.mjs",
"inspectWebpack": "vue-cli-service inspect > webpack.log",
"kadena:prebuild": "pactjs contract-generate --contract=coin --api https://api.chainweb.com/chainweb/0.0/mainnet01/chain/1/pact",
"test": "ts-mocha --require ./configs/testNullCompiler.js --paths -p configs/tsconfig.test.json ./**/*.mocha.ts",
"watch": "rimraf dist && concurrently 'npm:watch-*(!firefox)'",
"watch:firefox": "concurrently 'npm:watch-*(!chrome)'",
"watch": "yarn prebuild && rimraf dist && concurrently 'npm:watch-*(!firefox)'",
"watch:firefox": "yarn prebuild && concurrently 'npm:watch-*(!chrome)'",
"watch-contentscript": "rollup --watch --config configs/rollup.config.contentscript.mjs",
"watch-inject": "rollup --watch --config configs/rollup.config.inject.mjs",
"watch-vue-chrome": "cross-env BROWSER='chrome' vue-cli-service build --watch --no-clean",
Expand All @@ -32,6 +34,7 @@
"@ethereumjs/common": "^4.3.0",
"@ethereumjs/tx": "^5.3.0",
"@ethereumjs/util": "^9.0.3",
"@kadena/client": "^1.2.0",
"@ledgerhq/hw-transport-webusb": "^6.28.5",
"@metamask/eth-sig-util": "^7.0.1",
"@rollup/plugin-replace": "^5.0.5",
Expand All @@ -57,6 +60,7 @@
"memoize-one": "^6.0.0",
"moment": "^2.30.1",
"nanoevents": "^9.0.0",
"pact-lang-api": "^4.3.6",
"pinia": "^2.1.7",
"qrcode.vue": "^3.4.1",
"switch-ts": "^1.1.1",
Expand All @@ -74,6 +78,7 @@
},
"devDependencies": {
"@babel/plugin-transform-class-static-block": "^7.24.1",
"@kadena/pactjs-cli": "^1.7.0",
"@polkadot/api": "^10.12.4",
"@polkadot/extension-inject": "^0.46.9",
"@polkadot/keyring": "^12.6.2",
Expand Down
1 change: 1 addition & 0 deletions packages/extension/src/libs/background/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class BackgroundHandler {
[ProviderName.ethereum]: {},
[ProviderName.polkadot]: {},
[ProviderName.bitcoin]: {},
[ProviderName.kadena]: {},
};
this.#providers = Providers;
}
Expand Down
6 changes: 4 additions & 2 deletions packages/extension/src/libs/background/types.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import BitcoinProvider from "@/providers/bitcoin";
import type EthereumProvider from "@/providers/ethereum";
import type PolkadotProvider from "@/providers/polkadot";
import type KadenaProvider from "@/providers/kadena";

export interface TabProviderType {
[key: string]: Record<
number,
EthereumProvider | PolkadotProvider | BitcoinProvider
EthereumProvider | PolkadotProvider | BitcoinProvider | KadenaProvider
>;
}
export interface ProviderType {
[key: string]:
| typeof EthereumProvider
| typeof PolkadotProvider
| typeof BitcoinProvider;
| typeof BitcoinProvider
| typeof KadenaProvider;
}
export interface ExternalMessageOptions {
savePersistentEvents: boolean;
Expand Down
10 changes: 10 additions & 0 deletions packages/extension/src/libs/domain-state/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ class DomainState {
if (state.selectedNetwork) return state.selectedNetwork;
return null;
}
async setSelectedSubNetwork(id: string): Promise<void> {
const state = await this.getState();
state.selectedSubNetworkId = id;
await this.setState(state);
}
async getSelectedSubNetWork(): Promise<string | null> {
const state = await this.getState();
if (state.selectedSubNetworkId) return state.selectedSubNetworkId;
return null;
}
async setSelectedAddress(address: string): Promise<void> {
const state = await this.getState();
state.selectedAddress = address;
Expand Down
1 change: 1 addition & 0 deletions packages/extension/src/libs/domain-state/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ export enum StorageKeys {
}
export interface IState {
selectedNetwork?: string;
selectedSubNetworkId?: string;
selectedAddress?: string;
}
6 changes: 6 additions & 0 deletions packages/extension/src/libs/metrics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Metrics from "./amplitude";
import {
BuyEventType,
DAppsEventType,
GenericEvents,
NFTEventType,
NetworkChangeEvents,
SendEventType,
Expand All @@ -13,6 +14,10 @@ import {

const metrics = new Metrics();

const trackGenericEvents = (event: GenericEvents) => {
metrics.track("generic", { event });
};

const trackNetworkSelected = (
event: NetworkChangeEvents,
options: { provider: ProviderName; network: NetworkNames }
Expand Down Expand Up @@ -87,4 +92,5 @@ export {
trackNFTEvents,
trackDAppsEvents,
optOutofMetrics,
trackGenericEvents,
};
5 changes: 5 additions & 0 deletions packages/extension/src/libs/metrics/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ export enum SwapEventType {
swapBack = "swap_back",
}

export enum GenericEvents {
login_success = "successful_login",
login_error = "login_error",
}

export enum NetworkChangeEvents {
NetworkChangePopup = "network_change_popup",
NetworkChangeAPI = "network_change_api",
Expand Down
62 changes: 42 additions & 20 deletions packages/extension/src/libs/utils/initialize-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,49 @@ import KeyRing from "@/libs/keyring/keyring";
import EthereumNetworks from "@/providers/ethereum/networks";
import PolkadotNetworks from "@/providers/polkadot/networks";
import BitcoinNetworks from "@/providers/bitcoin/networks";
import { WalletType } from "@enkryptcom/types";
export default async (mnemonic: string, password: string): Promise<void> => {
import KadenaNetworks from "@/providers/kadena/networks";
import { NetworkNames, WalletType } from "@enkryptcom/types";
import { getAccountsByNetworkName } from "@/libs/utils/accounts";
export const initAccounts = async (keyring: KeyRing) => {
const secp256k1btc = await getAccountsByNetworkName(NetworkNames.Bitcoin);
const secp256k1 = await getAccountsByNetworkName(NetworkNames.Ethereum);
const sr25519 = await getAccountsByNetworkName(NetworkNames.Polkadot);
const ed25519kda = await getAccountsByNetworkName(NetworkNames.Kadena);
if (secp256k1.length == 0)
await keyring.saveNewAccount({
basePath: EthereumNetworks.ethereum.basePath,
name: "EVM Account 1",
signerType: EthereumNetworks.ethereum.signer[0],
walletType: WalletType.mnemonic,
});
if (sr25519.length == 0)
await keyring.saveNewAccount({
basePath: PolkadotNetworks.polkadot.basePath,
name: "Substrate Account 1",
signerType: PolkadotNetworks.polkadot.signer[0],
walletType: WalletType.mnemonic,
});
if (secp256k1btc.length == 0)
await keyring.saveNewAccount({
basePath: BitcoinNetworks.bitcoin.basePath,
name: "Bitcoin Account 1",
signerType: BitcoinNetworks.bitcoin.signer[0],
walletType: WalletType.mnemonic,
});
if (ed25519kda.length == 0)
await keyring.saveNewAccount({
basePath: KadenaNetworks.kadena.basePath,
name: "Kadena Account 1",
signerType: KadenaNetworks.kadena.signer[0],
walletType: WalletType.mnemonic,
});
};
export const onboardInitializeWallets = async (
mnemonic: string,
password: string
): Promise<void> => {
const kr = new KeyRing();
await kr.init(mnemonic, password);
await kr.unlock(password);
await kr.saveNewAccount({
basePath: EthereumNetworks.ethereum.basePath,
name: "EVM Account 1",
signerType: EthereumNetworks.ethereum.signer[0],
walletType: WalletType.mnemonic,
});
await kr.saveNewAccount({
basePath: PolkadotNetworks.polkadot.basePath,
name: "Substrate Account 1",
signerType: PolkadotNetworks.polkadot.signer[0],
walletType: WalletType.mnemonic,
});
await kr.saveNewAccount({
basePath: BitcoinNetworks.bitcoin.basePath,
name: "Bitcoin Account 1",
signerType: BitcoinNetworks.bitcoin.signer[0],
walletType: WalletType.mnemonic,
});
await initAccounts(kr);
};
9 changes: 9 additions & 0 deletions packages/extension/src/libs/utils/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@ import { NetworkNames } from "@enkryptcom/types";
import EthereumNetworks from "@/providers/ethereum/networks";
import PolkadotNetworks from "@/providers/polkadot/networks";
import BitcoinNetworks from "@/providers/bitcoin/networks";
import KadenaNetworks from "@/providers/kadena/networks";
import { BaseNetwork } from "@/types/base-network";
import CustomNetworksState from "../custom-networks-state";
import { CustomEvmNetwork } from "@/providers/ethereum/types/custom-evm-network";
import Ethereum from "@/providers/ethereum/networks/eth";
import Polkadot from "@/providers/polkadot/networks/polkadot";
import Bitcoin from "@/providers/bitcoin/networks/bitcoin";
import Kadena from "@/providers/kadena/networks/kadena";

const providerNetworks: Record<ProviderName, Record<string, BaseNetwork>> = {
[ProviderName.ethereum]: EthereumNetworks,
[ProviderName.polkadot]: PolkadotNetworks,
[ProviderName.bitcoin]: BitcoinNetworks,
[ProviderName.kadena]: KadenaNetworks,
[ProviderName.enkrypt]: {},
};
const getAllNetworks = async (): Promise<BaseNetwork[]> => {
Expand All @@ -26,6 +29,7 @@ const getAllNetworks = async (): Promise<BaseNetwork[]> => {
return (Object.values(EthereumNetworks) as BaseNetwork[])
.concat(Object.values(PolkadotNetworks) as BaseNetwork[])
.concat(Object.values(BitcoinNetworks) as BaseNetwork[])
.concat(Object.values(KadenaNetworks) as BaseNetwork[])
.concat(customNetworks);
};
const getNetworkByName = async (
Expand Down Expand Up @@ -53,10 +57,12 @@ const getProviderNetworkByName = async (
const DEFAULT_EVM_NETWORK_NAME = NetworkNames.Ethereum;
const DEFAULT_SUBSTRATE_NETWORK_NAME = NetworkNames.Polkadot;
const DEFAULT_BTC_NETWORK_NAME = NetworkNames.Bitcoin;
const DEFAULT_KADENA_NETWORK_NAME = NetworkNames.Kadena;

const DEFAULT_EVM_NETWORK = Ethereum;
const DEFAULT_SUBSTRATE_NETWORK = Polkadot;
const DEFAULT_BTC_NETWORK = Bitcoin;
const DEFAULT_KADENA_NETWORK = Kadena;

const POPULAR_NAMES = [
NetworkNames.Bitcoin,
Expand All @@ -66,6 +72,7 @@ const POPULAR_NAMES = [
NetworkNames.Binance,
NetworkNames.Rootstock,
NetworkNames.Optimism,
NetworkNames.Kadena,
];
export {
getAllNetworks,
Expand All @@ -78,4 +85,6 @@ export {
DEFAULT_EVM_NETWORK,
DEFAULT_SUBSTRATE_NETWORK,
DEFAULT_BTC_NETWORK,
DEFAULT_KADENA_NETWORK,
DEFAULT_KADENA_NETWORK_NAME,
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* refference: https://github.com/unisat-wallet/wallet-sdk/blob/master/src/message/bip322-simple.ts
* refference: https://github.com/bitcoinjs/varuint-bitcoin/blob/master/index.js
* reference: https://github.com/unisat-wallet/wallet-sdk/blob/master/src/message/bip322-simple.ts
* reference: https://github.com/bitcoinjs/varuint-bitcoin/blob/master/index.js
*/

import { BitcoinNetwork, PaymentType } from "../types/bitcoin-network";
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/src/providers/ethereum/inject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const injectDocument = (
const proxiedProvider = new Proxy(provider, ProxyHandler);
document["enkrypt"]["providers"][options.name] = provider;
if (__IS_OPERA__) {
document[options.name] = proxiedProvider; // Opera expects you to inject immediatly and their wallet switcher will handle conflicts
document[options.name] = proxiedProvider; // Opera expects you to inject immediately and their wallet switcher will handle conflicts
}
options
.sendMessageHandler(
Expand Down
Loading
Loading