Skip to content

Commit

Permalink
Merge pull request #1492 from Conflux-Chain/mergeMain
Browse files Browse the repository at this point in the history
Merge main
  • Loading branch information
iosh authored Dec 26, 2024
2 parents ff7316c + 6534d6a commit e179481
Show file tree
Hide file tree
Showing 178 changed files with 819 additions and 551 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/pre-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,10 @@ jobs:

- name: zip files
run: |
cd ./dist
zip -r ./chrome.zip ./chrome
zip -r ./firefox.zip ./firefox
zip -r ./edge.zip ./edge
cd ./dist/chrome && zip -FS -r ../chrome.zip .
cd ../firefox && zip -FS -r ../firefox.zip .
cd ../edge && zip -FS -r ../edge.zip .
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/prod-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,9 @@ jobs:

- name: zip files
run: |
cd ./dist
zip -r ./chrome.zip ./chrome
zip -r ./firefox.zip ./firefox
zip -r ./edge.zip ./edge
cd ./dist/chrome && zip -FS -r ../chrome.zip .
cd ../firefox && zip -FS -r ../firefox.zip .
cd ../edge && zip -FS -r ../edge.zip .
- uses: shogo82148/actions-upload-release-asset@v1
with:
Expand Down
173 changes: 173 additions & 0 deletions .yarn/versions/7f49ff5b.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
releases:
helios: patch

declined:
- helios-background
- "@fluent-wallet/rpc-engine"
- "@fluent-wallet/cfx_accounts"
- "@fluent-wallet/cfx_call"
- "@fluent-wallet/cfx_chain-id"
- "@fluent-wallet/cfx_check-balance-against-transaction"
- "@fluent-wallet/cfx_client-version"
- "@fluent-wallet/cfx_epoch-number"
- "@fluent-wallet/cfx_estimate-1559-fee"
- "@fluent-wallet/cfx_estimate-gas-and-collateral"
- "@fluent-wallet/cfx_fee-history"
- "@fluent-wallet/cfx_gas-price"
- "@fluent-wallet/cfx_get-account"
- "@fluent-wallet/cfx_get-account-pending-info"
- "@fluent-wallet/cfx_get-account-pending-transactions"
- "@fluent-wallet/cfx_get-accumulate-interest-rate"
- "@fluent-wallet/cfx_get-admin"
- "@fluent-wallet/cfx_get-balance"
- "@fluent-wallet/cfx_get-best-block-hash"
- "@fluent-wallet/cfx_get-block-by-block-number"
- "@fluent-wallet/cfx_get-block-by-epoch-number"
- "@fluent-wallet/cfx_get-block-by-hash"
- "@fluent-wallet/cfx_get-block-by-hash-with-pivot-assumption"
- "@fluent-wallet/cfx_get-block-reward-info"
- "@fluent-wallet/cfx_get-blocks-by-epoch"
- "@fluent-wallet/cfx_get-code"
- "@fluent-wallet/cfx_get-collateral-for-storage"
- "@fluent-wallet/cfx_get-confirmation-risk-by-hash"
- "@fluent-wallet/cfx_get-deposit-list"
- "@fluent-wallet/cfx_get-fee-burnt"
- "@fluent-wallet/cfx_get-interest-rate"
- "@fluent-wallet/cfx_get-logs"
- "@fluent-wallet/cfx_get-max-gas-limit"
- "@fluent-wallet/cfx_get-next-nonce"
- "@fluent-wallet/cfx_get-next-usable-nonce"
- "@fluent-wallet/cfx_get-pos-economics"
- "@fluent-wallet/cfx_get-pos-reward-by-epoch"
- "@fluent-wallet/cfx_get-skipped-blocks-by-epoch"
- "@fluent-wallet/cfx_get-sponsor-info"
- "@fluent-wallet/cfx_get-staking-balance"
- "@fluent-wallet/cfx_get-status"
- "@fluent-wallet/cfx_get-storage-at"
- "@fluent-wallet/cfx_get-storage-root"
- "@fluent-wallet/cfx_get-supply-info"
- "@fluent-wallet/cfx_get-transaction-by-hash"
- "@fluent-wallet/cfx_get-transaction-receipt"
- "@fluent-wallet/cfx_get-vote-list"
- "@fluent-wallet/cfx_max-priority-fee-per-gas"
- "@fluent-wallet/cfx_net-version"
- "@fluent-wallet/cfx_opened-method-groups"
- "@fluent-wallet/cfx_request-accounts"
- "@fluent-wallet/cfx_send-raw-transaction"
- "@fluent-wallet/cfx_send-transaction"
- "@fluent-wallet/cfx_sign-tx-with-ledger-nano-s"
- "@fluent-wallet/cfx_sign-typed-data_v4"
- "@fluent-wallet/eth_accounts"
- "@fluent-wallet/eth_block-number"
- "@fluent-wallet/eth_call"
- "@fluent-wallet/eth_chain-id"
- "@fluent-wallet/eth_estimate-1559-fee"
- "@fluent-wallet/eth_estimate-gas"
- "@fluent-wallet/eth_fee-history"
- "@fluent-wallet/eth_gas-price"
- "@fluent-wallet/eth_get-balance"
- "@fluent-wallet/eth_get-block-by-hash"
- "@fluent-wallet/eth_get-block-by-number"
- "@fluent-wallet/eth_get-code"
- "@fluent-wallet/eth_get-logs"
- "@fluent-wallet/eth_get-transaction-by-hash"
- "@fluent-wallet/eth_get-transaction-count"
- "@fluent-wallet/eth_get-transaction-receipt"
- "@fluent-wallet/eth_max-priority-fee-per-gas"
- "@fluent-wallet/eth_request-accounts"
- "@fluent-wallet/eth_send-raw-transaction"
- "@fluent-wallet/eth_send-transaction"
- "@fluent-wallet/eth_sign-transaction"
- "@fluent-wallet/eth_sign-tx-with-ledger-nano-s"
- "@fluent-wallet/net_version"
- "@fluent-wallet/personal_sign"
- "@fluent-wallet/txpool_next-nonce"
- "@fluent-wallet/wallet_accounts"
- "@fluent-wallet/wallet_add-ethereum-chain"
- "@fluent-wallet/wallet_add-hd-path"
- "@fluent-wallet/wallet_add-network"
- "@fluent-wallet/wallet_add-pending-user-auth-request"
- "@fluent-wallet/wallet_add-vault"
- "@fluent-wallet/wallet_after-unlock"
- "@fluent-wallet/wallet_chain-id"
- "@fluent-wallet/wallet_cleanup-tx"
- "@fluent-wallet/wallet_create-account"
- "@fluent-wallet/wallet_create-address"
- "@fluent-wallet/wallet_db-query"
- "@fluent-wallet/wallet_delete-account"
- "@fluent-wallet/wallet_delete-account-group"
- "@fluent-wallet/wallet_delete-app"
- "@fluent-wallet/wallet_delete-memo"
- "@fluent-wallet/wallet_delete-network"
- "@fluent-wallet/wallet_detect-address-type"
- "@fluent-wallet/wallet_detect-network-type"
- "@fluent-wallet/wallet_discover-accounts"
- "@fluent-wallet/wallet_enrich-conflux-tx"
- "@fluent-wallet/wallet_enrich-ethereum-tx"
- "@fluent-wallet/wallet_enrich-txs"
- "@fluent-wallet/wallet_export-account"
- "@fluent-wallet/wallet_export-account-group"
- "@fluent-wallet/wallet_export-all"
- "@fluent-wallet/wallet_generate-address"
- "@fluent-wallet/wallet_generate-private-key"
- "@fluent-wallet/wallet_get-account-address-by-network"
- "@fluent-wallet/wallet_get-account-group"
- "@fluent-wallet/wallet_get-account-group-vault-value"
- "@fluent-wallet/wallet_get-address-private-key"
- "@fluent-wallet/wallet_get-balance"
- "@fluent-wallet/wallet_get-block-or-epoch-number"
- "@fluent-wallet/wallet_get-block-time"
- "@fluent-wallet/wallet_get-blockchain-explorer-url"
- "@fluent-wallet/wallet_get-current-account"
- "@fluent-wallet/wallet_get-current-network"
- "@fluent-wallet/wallet_get-current-viewing-app"
- "@fluent-wallet/wallet_get-fluent-metadata"
- "@fluent-wallet/wallet_get-import-hardware-wallet-info"
- "@fluent-wallet/wallet_get-network"
- "@fluent-wallet/wallet_get-next-nonce"
- "@fluent-wallet/wallet_get-next-usable-nonce"
- "@fluent-wallet/wallet_get-pending-auth-request"
- "@fluent-wallet/wallet_get-permissions"
- "@fluent-wallet/wallet_get-preferences"
- "@fluent-wallet/wallet_handle-unfinished-cfx-tx"
- "@fluent-wallet/wallet_handle-unfinished-eth-tx"
- "@fluent-wallet/wallet_handle-unfinished-txs"
- "@fluent-wallet/wallet_import-address"
- "@fluent-wallet/wallet_import-all"
- "@fluent-wallet/wallet_import-hardware-wallet-account-group-or-account"
- "@fluent-wallet/wallet_import-mnemonic"
- "@fluent-wallet/wallet_import-private-key"
- "@fluent-wallet/wallet_metadata-for-popup"
- "@fluent-wallet/wallet_network1559compatible"
- "@fluent-wallet/wallet_refetch-balance"
- "@fluent-wallet/wallet_refetch-token-list"
- "@fluent-wallet/wallet_refetch-tx-list"
- "@fluent-wallet/wallet_register-site-metadata"
- "@fluent-wallet/wallet_request-accounts"
- "@fluent-wallet/wallet_request-permissions"
- "@fluent-wallet/wallet_request-unlock-ui"
- "@fluent-wallet/wallet_send-transaction"
- "@fluent-wallet/wallet_send-transaction-with-action"
- "@fluent-wallet/wallet_set-app-current-account"
- "@fluent-wallet/wallet_set-app-current-network"
- "@fluent-wallet/wallet_set-current-account"
- "@fluent-wallet/wallet_set-current-network"
- "@fluent-wallet/wallet_set-preferences"
- "@fluent-wallet/wallet_switch-ethereum-chain"
- "@fluent-wallet/wallet_unlock"
- "@fluent-wallet/wallet_unwatch-asset"
- "@fluent-wallet/wallet_update-account"
- "@fluent-wallet/wallet_update-account-group"
- "@fluent-wallet/wallet_update-network"
- "@fluent-wallet/wallet_update-token-list"
- "@fluent-wallet/wallet_upsert-memo"
- "@fluent-wallet/wallet_user-approved-auth-request"
- "@fluent-wallet/wallet_user-rejected-auth-request"
- "@fluent-wallet/wallet_validate20token"
- "@fluent-wallet/wallet_validate-app-permissions"
- "@fluent-wallet/wallet_validate-mnemonic"
- "@fluent-wallet/wallet_validate-password"
- "@fluent-wallet/wallet_validate-private-key"
- "@fluent-wallet/wallet_watch-asset"
- "@fluent-wallet/wallet_zero-account-group"
- workspace-tools
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@
"dev:chrome": "cross-env NODE_ENV=development cross-env TARGET_BROWSER=chrome webpack --config ./scripts/webpack.config.dev.mjs",
"dev:firefox": "cross-env NODE_ENV=development cross-env TARGET_BROWSER=firefox webpack --config ./scripts/webpack.config.dev.mjs",
"dev:edge": "cross-env NODE_ENV=development cross-env TARGET_BROWSER=edge webpack --config ./scripts/webpack.config.dev.mjs",
"build:chrome": "cross-env NODE_ENV=production cross-env TARGET_BROWSER=chrome webpack --config ./scripts/webpack.config.prod.mjs",
"build:firefox": "cross-env NODE_ENV=production cross-env TARGET_BROWSER=firefox webpack --config ./scripts/webpack.config.prod.mjs",
"build:edge": "cross-env NODE_ENV=production cross-env TARGET_BROWSER=edge webpack --config ./scripts/webpack.config.prod.mjs",
"build:chrome": "cross-env NODE_ENV=production cross-env TARGET_BROWSER=chrome webpack --config ./scripts/webpack.config.prod.mjs && yarn removeEmptyFile",
"build:firefox": "cross-env NODE_ENV=production cross-env TARGET_BROWSER=firefox webpack --config ./scripts/webpack.config.prod.mjs && yarn removeEmptyFile",
"build:edge": "cross-env NODE_ENV=production cross-env TARGET_BROWSER=edge webpack --config ./scripts/webpack.config.prod.mjs && yarn removeEmptyFile",
"build": "yarn build:chrome && yarn build:firefox && yarn build:edge && yarn removeEmptyFile",
"removeEmptyFile": "rm -rf ./dist/*/manifest.js"
"removeEmptyFile": "find ./dist -name \"manifest.js\" -type f -delete"
},
"devDependencies": {
"@babel/core": "7.17.9",
Expand All @@ -94,7 +94,7 @@
"@types/serve-static": "^1",
"@types/webpack-bundle-analyzer": "^4",
"@vitejs/plugin-react": "4.3.1",
"@vitest/coverage-v8": "2.0.5",
"@vitest/coverage-v8": "2.1.8",
"@yarnpkg/esbuild-plugin-pnp": "3.0.0-rc.2",
"@yqrashawn/snowpack": "3.8.6-fix-6",
"autoprefixer": "10.4.20",
Expand Down Expand Up @@ -157,7 +157,7 @@
"stylelint-config-prettier": "^9.0.3",
"stylelint-config-standard": "^26.0.0",
"tailwindcss": "^3.1.1",
"vitest": "2.0.5",
"vitest": "2.1.8",
"wait-for-expect": "3.0.2",
"web-ext": "7.0.0",
"webpack": "5.93.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/background/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@fluent-wallet/cfx_sign-tx-with-ledger-nano-s": "workspace:*",
"@fluent-wallet/cfx_sign-typed-data_v4": "workspace:packages/rpcs/cfx_signTypedData_v4",
"@fluent-wallet/consts": "workspace:packages/consts",
"@fluent-wallet/db": "workspace:packages/db",
"@fluent-wallet/db": "1.0.76",
"@fluent-wallet/eth_accounts": "workspace:packages/rpcs/eth_accounts",
"@fluent-wallet/eth_block-number": "workspace:packages/rpcs/eth_blockNumber",
"@fluent-wallet/eth_call": "workspace:packages/rpcs/eth_call",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// // # imports
import {IS_PROD_MODE, IS_TEST_MODE} from '@fluent-wallet/inner-utils'
import {EXT_STORAGE} from '@fluent-wallet/consts'
import {isManifestV3} from './env'
import {isManifestV3} from './env.js'
import {defRpcEngine} from '@fluent-wallet/rpc-engine'
import {persist as persistToExtStorageHandler} from '../background/src/persist-db-to-ext-storage'
import {persist as persistToExtStorageHandler} from './persist-db-to-ext-storage.js'

import browser from 'webextension-polyfill'
import SCHEMA from '../background/src//db-schema'
import SCHEMA from './db-schema.js'
import {listen} from '@fluent-wallet/extension-runtime/background.js'
import fillInitialDBData from '../background/src/init-db.js'
import fillInitialDBData from './init-db.js'
import * as bb from '@fluent-wallet/webextension'

import {rpcEngineOpts} from '../background/src/rpc-engine-opts'
import {rpcEngineOpts} from './rpc-engine-opts.js'

// # setup
// ## dev helper
Expand Down Expand Up @@ -56,9 +56,8 @@ async function initDB(initDBFn, skipRestore) {

// ## init rpc engine
async function initRPCEngine(dbConnection) {

const {request} = defRpcEngine(dbConnection, rpcEngineOpts)
const protectedRequest = (req = {} as any) =>
const protectedRequest = (req = {}) =>
request({
id: req.id,
jsonrpc: req.jsonrpc,
Expand Down Expand Up @@ -125,8 +124,7 @@ function saveTimestamp() {
// # initialize

async function initApp() {
const {request, db} = await initBG()

const {request} = await initBG()

// ## start long running jobs
if (!IS_TEST_MODE) {
Expand Down
40 changes: 0 additions & 40 deletions packages/index.html

This file was deleted.

2 changes: 1 addition & 1 deletion packages/rpc-engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@fluent-wallet/json-rpc-error": "workspace:packages/json-rpc-error",
"@fluent-wallet/random-id": "workspace:packages/random-id",
"@fluent-wallet/rpc-epoch-ref": "workspace:packages/rpc-epoch-ref",
"@fluent-wallet/spec": "workspace:packages/spec",
"@fluent-wallet/spec": "1.0.6",
"@fluent-wallet/transducers": "workspace:packages/transducers",
"@thi.ng/atom": "4.1.42",
"@thi.ng/rstream": "6.0.21",
Expand Down
2 changes: 1 addition & 1 deletion packages/rpcs/cfx_accounts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"main": "index.js",
"version": "3.0.1",
"dependencies": {
"@fluent-wallet/spec": "workspace:packages/spec"
"@fluent-wallet/spec": "1.0.6"
}
}
2 changes: 1 addition & 1 deletion packages/rpcs/cfx_call/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"packageManager": "yarn@3.0.1",
"version": "0.0.8",
"dependencies": {
"@fluent-wallet/spec": "workspace:packages/spec"
"@fluent-wallet/spec": "1.0.6"
}
}
2 changes: 1 addition & 1 deletion packages/rpcs/cfx_chainId/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"main": "index.js",
"version": "1.0.3",
"dependencies": {
"@fluent-wallet/spec": "workspace:packages/spec"
"@fluent-wallet/spec": "1.0.6"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"packageManager": "yarn@3.0.1",
"version": "0.0.6",
"dependencies": {
"@fluent-wallet/spec": "workspace:packages/spec"
"@fluent-wallet/spec": "1.0.6"
}
}
2 changes: 1 addition & 1 deletion packages/rpcs/cfx_clientVersion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"packageManager": "yarn@3.0.1",
"version": "0.0.4",
"dependencies": {
"@fluent-wallet/spec": "workspace:packages/spec"
"@fluent-wallet/spec": "1.0.6"
}
}
2 changes: 1 addition & 1 deletion packages/rpcs/cfx_epochNumber/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"main": "index.js",
"version": "0.0.12",
"dependencies": {
"@fluent-wallet/spec": "workspace:packages/spec"
"@fluent-wallet/spec": "1.0.6"
}
}
2 changes: 1 addition & 1 deletion packages/rpcs/cfx_estimate1559Fee/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": "0.0.4",
"dependencies": {
"@ethersproject/units": "5.6.1",
"@fluent-wallet/spec": "workspace:packages/spec",
"@fluent-wallet/spec": "1.0.6",
"bn.js": "5.2.0"
}
}
Loading

0 comments on commit e179481

Please sign in to comment.