Skip to content

Commit b3b34ac

Browse files
committed
devop: merge main
2 parents 8c8cf7d + f7b86b4 commit b3b34ac

55 files changed

Lines changed: 2461 additions & 925 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Enkrypt is a web3 wallet built from the ground up to support the multi-chain fut
5454
- Canto
5555
- Celo
5656
- Degen
57+
- Derive
5758
- Dogecoin
5859
- Edgeware
5960
- Edgeware EVM
@@ -116,6 +117,8 @@ Enkrypt is a web3 wallet built from the ground up to support the multi-chain fut
116117
- Ink Onchain
117118
- Unichain
118119
- Gravity
120+
- Unit Zero
121+
- Unit Zero Testnet
119122
- More coming soon!
120123

121124
Looking to add your project? [Contact us!](https://mewwallet.typeform.com/enkrypt-inquiry?typeform-source=www.enkrypt.com)

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232
"prepare": "husky"
3333
},
3434
"devDependencies": {
35-
"@commitlint/cli": "^19.8.0",
36-
"@commitlint/config-conventional": "^19.8.0",
37-
"@swc/core": "^1.11.21",
35+
"@commitlint/cli": "^19.8.1",
36+
"@commitlint/config-conventional": "^19.8.1",
37+
"@swc/core": "^1.11.24",
3838
"concurrently": "^9.1.2",
3939
"husky": "^9.1.7",
4040
"node-notifier": "^10.0.1",
41-
"nodemon": "^3.1.9",
41+
"nodemon": "^3.1.10",
4242
"ultra-runner": "^3.10.5"
4343
},
4444
"resolutions": {

packages/extension-bridge/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,23 @@
4444
"webextension-polyfill": "^0.12.0"
4545
},
4646
"devDependencies": {
47-
"@types/node": "^22.14.1",
47+
"@types/node": "^22.15.17",
4848
"@types/webextension-polyfill": "^0.12.3",
49-
"@typescript-eslint/eslint-plugin": "^8.30.1",
50-
"@typescript-eslint/parser": "^8.30.1",
49+
"@typescript-eslint/eslint-plugin": "^8.32.1",
50+
"@typescript-eslint/parser": "^8.32.1",
5151
"bumpp": "^10.1.0",
52-
"eslint": "^9.24.0",
52+
"eslint": "^9.26.0",
5353
"eslint-config-airbnb-base": "^15.0.0",
54-
"eslint-config-prettier": "^10.1.2",
54+
"eslint-config-prettier": "^10.1.5",
5555
"eslint-import-resolver-alias": "^1.1.2",
5656
"eslint-plugin-import": "^2.31.0",
5757
"eslint-plugin-module-resolver": "^1.5.0",
5858
"prettier": "^3.5.3",
5959
"ts-node": "^10.9.2",
6060
"tsconfig-paths": "^4.2.0",
6161
"tsup": "^8.4.0",
62-
"type-fest": "^4.40.0",
62+
"type-fest": "^4.41.0",
6363
"typescript": "^5.8.3",
64-
"typescript-eslint": "8.30.1"
64+
"typescript-eslint": "8.32.1"
6565
}
6666
}

packages/extension/package.json

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@enkryptcom/extension",
3-
"version": "2.6.2",
3+
"version": "2.7.0",
44
"private": true,
55
"type": "module",
66
"scripts": {
@@ -24,7 +24,7 @@
2424
"watch:firefox": "yarn prebuild && cross-env BROWSER='firefox' vite"
2525
},
2626
"dependencies": {
27-
"@amplitude/analytics-browser": "^2.14.0",
27+
"@amplitude/analytics-browser": "^2.17.4",
2828
"@enkryptcom/extension-bridge": "workspace:^",
2929
"@enkryptcom/hw-wallets": "workspace:^",
3030
"@enkryptcom/keyring": "workspace:^",
@@ -41,25 +41,25 @@
4141
"@kadena/pactjs-cli": "^1.17.1",
4242
"@ledgerhq/hw-transport-webusb": "^6.29.4",
4343
"@metamask/eth-sig-util": "^8.2.0",
44-
"@metaplex-foundation/mpl-bubblegum": "^4.4.0",
44+
"@metaplex-foundation/mpl-bubblegum": "^5.0.0",
4545
"@metaplex-foundation/umi": "^1.2.0",
4646
"@metaplex-foundation/umi-bundle-defaults": "^1.2.0",
47-
"@polkadot/api": "^15.9.2",
48-
"@polkadot/extension-inject": "^0.58.8",
47+
"@polkadot/api": "^15.9.3",
48+
"@polkadot/extension-inject": "^0.58.9",
4949
"@polkadot/keyring": "^13.4.4",
50-
"@polkadot/rpc-provider": "^15.9.2",
51-
"@polkadot/types": "^15.9.2",
52-
"@polkadot/types-known": "^15.9.2",
50+
"@polkadot/rpc-provider": "^15.9.3",
51+
"@polkadot/types": "^15.9.3",
52+
"@polkadot/types-known": "^15.9.3",
5353
"@polkadot/ui-shared": "^3.13.1",
5454
"@polkadot/util": "^13.4.4",
5555
"@polkadot/wasm-crypto": "^7.4.1",
5656
"@solana-developers/helpers": "2.8.0",
5757
"@solana/spl-token": "^0.4.13",
5858
"@solana/wallet-standard-features": "^1.3.0",
59-
"@solana/web3.js": "^1.98.0",
59+
"@solana/web3.js": "^1.98.2",
6060
"@wallet-standard/base": "^1.1.0",
6161
"add": "^2.0.6",
62-
"bignumber.js": "^9.2.1",
62+
"bignumber.js": "^9.3.0",
6363
"bip39": "^3.1.0",
6464
"bitcoinjs-lib": "^6.1.7",
6565
"bs58": "^6.0.0",
@@ -81,7 +81,7 @@
8181
"uuid": "^11.1.0",
8282
"vue": "^3.5.13",
8383
"vue-echarts": "7.0.3",
84-
"vue-router": "^4.5.0",
84+
"vue-router": "^4.5.1",
8585
"vue3-lottie": "^3.3.1",
8686
"vuedraggable": "^4.1.0",
8787
"web3-eth": "^1.10.4",
@@ -100,45 +100,46 @@
100100
"@rollup/plugin-typescript": "^12.1.2",
101101
"@tsconfig/node20": "^20.1.5",
102102
"@types/bs58": "^5.0.0",
103-
"@types/chrome": "^0.0.315",
103+
"@types/chrome": "^0.0.322",
104104
"@types/ethereumjs-abi": "^0.6.5",
105105
"@types/events": "^3.0.3",
106106
"@types/fs-extra": "^11.0.4",
107107
"@types/less": "^3.0.8",
108108
"@types/lodash": "^4.17.16",
109-
"@types/node": "^22.14.1",
109+
"@types/node": "^22.15.17",
110+
"@types/semver": "^7.7.0",
110111
"@types/url-parse": "^1.4.11",
111112
"@types/utf-8-validate": "^5.0.2",
112113
"@types/uuid": "^10.0.0",
113114
"@types/wif": "^2.0.5",
114115
"@types/zxcvbn": "^4.4.5",
115-
"@vitejs/plugin-vue": "^5.2.3",
116+
"@vitejs/plugin-vue": "^5.2.4",
116117
"@vue/eslint-config-prettier": "^10.2.0",
117118
"@vue/eslint-config-typescript": "^14.5.0",
118119
"@vue/tsconfig": "^0.7.0",
119120
"@vueuse/core": "^13.1.0",
120121
"cross-env": "^7.0.3",
121-
"eslint": "^9.24.0",
122-
"eslint-plugin-vue": "^10.0.0",
122+
"eslint": "^9.26.0",
123+
"eslint-plugin-vue": "^10.1.0",
123124
"fs-extra": "^11.3.0",
124125
"jsdom": "^26.1.0",
125126
"less": "^4.3.0",
126-
"less-loader": "^12.2.0",
127-
"npm-run-all2": "^7.0.2",
127+
"less-loader": "^12.3.0",
128+
"npm-run-all2": "^8.0.1",
128129
"prettier": "^3.5.3",
129130
"rimraf": "^6.0.1",
130-
"rollup": "^4.40.0",
131+
"rollup": "^4.40.2",
131132
"rollup-plugin-visualizer": "^5.14.0",
132-
"semver": "^7.7.1",
133+
"semver": "^7.7.2",
133134
"systeminformation": "^5.25.11",
134135
"tsup": "^8.4.0",
135136
"typescript": "~5.8.3",
136137
"url": "^0.11.4",
137-
"vite": "^6.3.1",
138+
"vite": "^6.3.5",
138139
"vite-plugin-node-polyfills": "0.23.0",
139140
"vite-tsconfig-paths": "^5.1.4",
140-
"vitest": "^3.1.1",
141-
"vue-tsc": "^2.2.8",
141+
"vitest": "^3.1.3",
142+
"vue-tsc": "^2.2.10",
142143
"webextension-polyfill": "^0.12.0"
143144
},
144145
"installConfig": {
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import { NFTCollection, NFTType, NFTItem } from '@/types/nft';
2+
import { NodeType } from '@/types/provider';
3+
import cacheFetch from '../cache-fetch';
4+
import { NetworkNames } from '@enkryptcom/types';
5+
import {
6+
ConfluxResponse,
7+
ConfluxNFTItem,
8+
NFTBalanceItem,
9+
ListResponse,
10+
NFTItemWithDesc,
11+
} from './types/conflux';
12+
13+
const CONFLUX_ENDPOINT = 'https://evmapi.confluxscan.org';
14+
const CACHE_TTL = 60 * 1000;
15+
16+
// will fetch most 100 collections
17+
// every collection will have most 100 items
18+
export default async (
19+
network: NodeType,
20+
address: string,
21+
): Promise<NFTCollection[]> => {
22+
if (network.name !== NetworkNames.Conflux)
23+
throw new Error('Conflux: network not supported');
24+
let allItems: NFTCollection[] = [];
25+
26+
let nftBalances: ConfluxResponse = await cacheFetch(
27+
{
28+
url: `${CONFLUX_ENDPOINT}/nft/balances?owner=${address}&skip=0&limit=100`,
29+
},
30+
CACHE_TTL,
31+
);
32+
if (nftBalances.status !== '1' || nftBalances.result.total === 0) {
33+
return [];
34+
}
35+
36+
for (let collection of nftBalances.result
37+
.list as unknown as NFTBalanceItem[]) {
38+
let contract = collection.contract;
39+
40+
let items = await getCollectionItems(contract, address);
41+
if (!items.length) {
42+
continue;
43+
}
44+
45+
let nftCollection: NFTCollection = {
46+
name: collection.name,
47+
image: collection.iconUrl || '',
48+
description: items[0].description,
49+
contract,
50+
items,
51+
};
52+
allItems.push(nftCollection);
53+
}
54+
55+
return allItems;
56+
};
57+
58+
async function getCollectionItems(
59+
contract: string,
60+
address: string,
61+
): Promise<NFTItemWithDesc[]> {
62+
let itemResponse: ConfluxResponse = await cacheFetch(
63+
{
64+
url: `${CONFLUX_ENDPOINT}/nft/tokens?contract=${contract}&owner=${address}&skip=0&limit=100&withBrief=${true}&withMetadata=${true}&suppressMetadataError=${true}`,
65+
},
66+
CACHE_TTL,
67+
);
68+
69+
if (itemResponse.status !== '1') {
70+
return [];
71+
}
72+
let items: ConfluxNFTItem[] = itemResponse.result
73+
.list as unknown as ConfluxNFTItem[];
74+
75+
return items.map(item => ({
76+
name: item.name,
77+
id: item.tokenId,
78+
contract: item.contract,
79+
image: item.image,
80+
description: item.description,
81+
url: `https://evm.confluxscan.org/nft/${item.contract}/${item.tokenId}`,
82+
type: item.type === 'ERC721' ? NFTType.ERC721 : NFTType.ERC1155,
83+
}));
84+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { NFTItem } from '@/types/nft';
2+
3+
export interface ConfluxNFTItem {
4+
owner: string;
5+
contract: string;
6+
tokenId: string;
7+
amount: string;
8+
type: string;
9+
name: string;
10+
image: string;
11+
description: string;
12+
rawData: object;
13+
}
14+
15+
export interface NFTBalanceItem {
16+
owner: string;
17+
contract: string;
18+
balance: string;
19+
name: string;
20+
symbol: string;
21+
type: string;
22+
website: string | null;
23+
iconUrl: string | null;
24+
}
25+
26+
export interface ListResponse {
27+
total: number;
28+
list: object[];
29+
}
30+
31+
export interface ConfluxResponse {
32+
status: string;
33+
message: string;
34+
result: ListResponse;
35+
}
36+
37+
export interface NFTItemWithDesc extends NFTItem {
38+
description: string;
39+
}

0 commit comments

Comments
 (0)