Skip to content

Commit

Permalink
Fix: aptos is connect & provider variable invalid in ext (#251)
Browse files Browse the repository at this point in the history
* fix: provider not be change define on ext

* chore: release version 2.1.15
  • Loading branch information
ByteZhang1024 authored Nov 13, 2024
1 parent a834c72 commit 23a0e8e
Show file tree
Hide file tree
Showing 38 changed files with 204 additions and 180 deletions.
8 changes: 4 additions & 4 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onekeyfe/cross-inpage-provider-core",
"version": "2.1.14",
"version": "2.1.15",
"keywords": [
"cross-inpage-provider"
],
Expand Down Expand Up @@ -29,9 +29,9 @@
"build-version-info": "node ./scripts/buildVersionInfo.js"
},
"dependencies": {
"@onekeyfe/cross-inpage-provider-errors": "2.1.14",
"@onekeyfe/cross-inpage-provider-events": "2.1.14",
"@onekeyfe/cross-inpage-provider-types": "2.1.14",
"@onekeyfe/cross-inpage-provider-errors": "2.1.15",
"@onekeyfe/cross-inpage-provider-events": "2.1.15",
"@onekeyfe/cross-inpage-provider-types": "2.1.15",
"events": "^3.3.0",
"lodash-es": "^4.17.21",
"ms": "^2.1.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/versionInfo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

const version = '2.1.12';
const version = '2.1.15';
const versionBuild = '2020-0101-1';

export default {
Expand Down
12 changes: 11 additions & 1 deletion packages/core/src/walletProperty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ export enum ISpecialPropertyProviderNamesReflection {
polkadot = 'polkadot-js',
}

export const DEFINE_PROPERTY_WHITELIST = [
'connectionStatus', // base provider
];

export type IPlatformType = 'native' | 'extension' | 'web' | 'desktop';

export function checkPlatformEnable(disablePlatform?: IPlatformType[]) {
Expand Down Expand Up @@ -103,7 +107,13 @@ export function defineWindowProperty(
const enable = checkEnableDefineProperty(property);
const proxyProvider = new Proxy(provider as object, {
defineProperty(target, property, attributes) {
// skip define Prevent overwriting
try {
if (DEFINE_PROPERTY_WHITELIST.includes(property as string)) {
return Reflect.defineProperty(target, property, attributes);
}
} catch (error) {
// ignore error
}
return true;
},
});
Expand Down
6 changes: 3 additions & 3 deletions packages/desktop/desktop-bridge-injected/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onekeyfe/desktop-bridge-injected",
"version": "2.1.14",
"version": "2.1.15",
"keywords": [
"cross-inpage-provider"
],
Expand Down Expand Up @@ -34,7 +34,7 @@
"electron": "^17.2.0"
},
"dependencies": {
"@onekeyfe/cross-inpage-provider-core": "2.1.14",
"@onekeyfe/cross-inpage-provider-types": "2.1.14"
"@onekeyfe/cross-inpage-provider-core": "2.1.15",
"@onekeyfe/cross-inpage-provider-types": "2.1.15"
}
}
2 changes: 1 addition & 1 deletion packages/empty/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onekeyfe/cross-inpage-provider-empty",
"version": "2.1.14",
"version": "2.1.15",
"keywords": [
"cross-inpage-provider"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/errors/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onekeyfe/cross-inpage-provider-errors",
"version": "2.1.14",
"version": "2.1.15",
"keywords": [
"cross-inpage-provider"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/events/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onekeyfe/cross-inpage-provider-events",
"version": "2.1.14",
"version": "2.1.15",
"keywords": [
"cross-inpage-provider"
],
Expand Down
5 changes: 5 additions & 0 deletions packages/example/components/chains/aptos/example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ export default function Example() {
name: 'Injected Wallet',
inject: 'aptos',
},
{
uuid: 'injected-onekey',
name: 'Injected OneKey',
inject: '$onekey.aptos',
},
]);

const { provider, setAccount, account } = useWallet<IProviderApi>();
Expand Down
24 changes: 12 additions & 12 deletions packages/example/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onekeyfe/cross-inpage-provider-example",
"version": "2.1.14",
"version": "2.1.15",
"private": true,
"scripts": {
"postinstall": "patch-package",
Expand All @@ -21,17 +21,17 @@
"@metamask/eth-sig-util": "^7.0.2",
"@metamask/onboarding": "^1.0.1",
"@mysten/dapp-kit": "0.13.2",
"@onekeyfe/cross-inpage-provider-core": "2.1.14",
"@onekeyfe/cross-inpage-provider-types": "2.1.14",
"@onekeyfe/onekey-aptos-provider": "2.1.14",
"@onekeyfe/onekey-cardano-provider": "2.1.14",
"@onekeyfe/onekey-conflux-provider": "2.1.14",
"@onekeyfe/onekey-cosmos-provider": "2.1.14",
"@onekeyfe/onekey-near-provider": "2.1.14",
"@onekeyfe/onekey-solana-provider": "2.1.14",
"@onekeyfe/onekey-sui-provider": "2.1.14",
"@onekeyfe/onekey-tron-provider": "2.1.14",
"@onekeyfe/onekey-webln-provider": "2.1.14",
"@onekeyfe/cross-inpage-provider-core": "2.1.15",
"@onekeyfe/cross-inpage-provider-types": "2.1.15",
"@onekeyfe/onekey-aptos-provider": "2.1.15",
"@onekeyfe/onekey-cardano-provider": "2.1.15",
"@onekeyfe/onekey-conflux-provider": "2.1.15",
"@onekeyfe/onekey-cosmos-provider": "2.1.15",
"@onekeyfe/onekey-near-provider": "2.1.15",
"@onekeyfe/onekey-solana-provider": "2.1.15",
"@onekeyfe/onekey-sui-provider": "2.1.15",
"@onekeyfe/onekey-tron-provider": "2.1.15",
"@onekeyfe/onekey-webln-provider": "2.1.15",
"@polkadot/api": "^9.11.3",
"@polkadot/extension-dapp": "^0.47.5",
"@radix-ui/react-checkbox": "^1.1.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/extension/extension-bridge-hosted/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onekeyfe/extension-bridge-hosted",
"version": "2.1.14",
"version": "2.1.15",
"keywords": [
"cross-inpage-provider"
],
Expand Down Expand Up @@ -28,8 +28,8 @@
"start": "tsc --watch"
},
"dependencies": {
"@onekeyfe/cross-inpage-provider-core": "2.1.14",
"@onekeyfe/cross-inpage-provider-types": "2.1.14",
"@onekeyfe/cross-inpage-provider-core": "2.1.15",
"@onekeyfe/cross-inpage-provider-types": "2.1.15",
"uuid": "^8.3.2"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/extension/extension-bridge-injected/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onekeyfe/extension-bridge-injected",
"version": "2.1.14",
"version": "2.1.15",
"keywords": [
"cross-inpage-provider"
],
Expand Down Expand Up @@ -28,7 +28,7 @@
"start": "tsc --watch"
},
"dependencies": {
"@onekeyfe/cross-inpage-provider-core": "2.1.14",
"@onekeyfe/cross-inpage-provider-types": "2.1.14"
"@onekeyfe/cross-inpage-provider-core": "2.1.15",
"@onekeyfe/cross-inpage-provider-types": "2.1.15"
}
}
14 changes: 7 additions & 7 deletions packages/injected/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onekeyfe/cross-inpage-provider-injected",
"version": "2.1.14",
"version": "2.1.15",
"keywords": [
"cross-inpage-provider"
],
Expand Down Expand Up @@ -42,12 +42,12 @@
"electron": "*"
},
"dependencies": {
"@onekeyfe/cross-inpage-provider-core": "2.1.14",
"@onekeyfe/cross-inpage-provider-types": "2.1.14",
"@onekeyfe/desktop-bridge-injected": "2.1.14",
"@onekeyfe/extension-bridge-injected": "2.1.14",
"@onekeyfe/inpage-providers-hub": "2.1.14",
"@onekeyfe/native-bridge-injected": "2.1.14",
"@onekeyfe/cross-inpage-provider-core": "2.1.15",
"@onekeyfe/cross-inpage-provider-types": "2.1.15",
"@onekeyfe/desktop-bridge-injected": "2.1.15",
"@onekeyfe/extension-bridge-injected": "2.1.15",
"@onekeyfe/inpage-providers-hub": "2.1.15",
"@onekeyfe/native-bridge-injected": "2.1.15",
"buffer": "^6.0.3",
"crypto-browserify": "^3.12.0"
}
Expand Down
6 changes: 3 additions & 3 deletions packages/native/native-bridge-injected/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onekeyfe/native-bridge-injected",
"version": "2.1.14",
"version": "2.1.15",
"keywords": [
"cross-inpage-provider"
],
Expand Down Expand Up @@ -28,7 +28,7 @@
"start": "tsc --watch"
},
"dependencies": {
"@onekeyfe/cross-inpage-provider-core": "2.1.14",
"@onekeyfe/cross-inpage-provider-types": "2.1.14"
"@onekeyfe/cross-inpage-provider-core": "2.1.15",
"@onekeyfe/cross-inpage-provider-types": "2.1.15"
}
}
42 changes: 21 additions & 21 deletions packages/providers/inpage-providers-hub/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onekeyfe/inpage-providers-hub",
"version": "2.1.14",
"version": "2.1.15",
"keywords": [
"cross-inpage-provider"
],
Expand Down Expand Up @@ -30,26 +30,26 @@
"start": "tsc --watch"
},
"dependencies": {
"@onekeyfe/cross-inpage-provider-core": "2.1.14",
"@onekeyfe/cross-inpage-provider-types": "2.1.14",
"@onekeyfe/onekey-algo-provider": "2.1.14",
"@onekeyfe/onekey-alph-provider": "2.1.14",
"@onekeyfe/onekey-aptos-provider": "2.1.14",
"@onekeyfe/onekey-btc-provider": "2.1.14",
"@onekeyfe/onekey-cardano-provider": "2.1.14",
"@onekeyfe/onekey-conflux-provider": "2.1.14",
"@onekeyfe/onekey-cosmos-provider": "2.1.14",
"@onekeyfe/onekey-eth-provider": "2.1.14",
"@onekeyfe/onekey-nostr-provider": "2.1.14",
"@onekeyfe/onekey-polkadot-provider": "2.1.14",
"@onekeyfe/onekey-private-external-account-provider": "2.1.14",
"@onekeyfe/onekey-private-provider": "2.1.14",
"@onekeyfe/onekey-scdo-provider": "2.1.14",
"@onekeyfe/onekey-solana-provider": "2.1.14",
"@onekeyfe/onekey-sui-provider": "2.1.14",
"@onekeyfe/onekey-ton-provider": "2.1.14",
"@onekeyfe/onekey-tron-provider": "2.1.14",
"@onekeyfe/onekey-webln-provider": "2.1.14",
"@onekeyfe/cross-inpage-provider-core": "2.1.15",
"@onekeyfe/cross-inpage-provider-types": "2.1.15",
"@onekeyfe/onekey-algo-provider": "2.1.15",
"@onekeyfe/onekey-alph-provider": "2.1.15",
"@onekeyfe/onekey-aptos-provider": "2.1.15",
"@onekeyfe/onekey-btc-provider": "2.1.15",
"@onekeyfe/onekey-cardano-provider": "2.1.15",
"@onekeyfe/onekey-conflux-provider": "2.1.15",
"@onekeyfe/onekey-cosmos-provider": "2.1.15",
"@onekeyfe/onekey-eth-provider": "2.1.15",
"@onekeyfe/onekey-nostr-provider": "2.1.15",
"@onekeyfe/onekey-polkadot-provider": "2.1.15",
"@onekeyfe/onekey-private-external-account-provider": "2.1.15",
"@onekeyfe/onekey-private-provider": "2.1.15",
"@onekeyfe/onekey-scdo-provider": "2.1.15",
"@onekeyfe/onekey-solana-provider": "2.1.15",
"@onekeyfe/onekey-sui-provider": "2.1.15",
"@onekeyfe/onekey-ton-provider": "2.1.15",
"@onekeyfe/onekey-tron-provider": "2.1.15",
"@onekeyfe/onekey-webln-provider": "2.1.15",
"web3": "^1.7.3"
},
"devDependencies": {
Expand Down
10 changes: 5 additions & 5 deletions packages/providers/onekey-algo-provider/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onekeyfe/onekey-algo-provider",
"version": "2.1.14",
"version": "2.1.15",
"keywords": [
"cross-inpage-provider"
],
Expand Down Expand Up @@ -28,9 +28,9 @@
"start": "tsc --watch"
},
"dependencies": {
"@onekeyfe/cross-inpage-provider-core": "2.1.14",
"@onekeyfe/cross-inpage-provider-errors": "2.1.14",
"@onekeyfe/cross-inpage-provider-types": "2.1.14",
"@onekeyfe/extension-bridge-injected": "2.1.14"
"@onekeyfe/cross-inpage-provider-core": "2.1.15",
"@onekeyfe/cross-inpage-provider-errors": "2.1.15",
"@onekeyfe/cross-inpage-provider-types": "2.1.15",
"@onekeyfe/extension-bridge-injected": "2.1.15"
}
}
10 changes: 5 additions & 5 deletions packages/providers/onekey-alph-provider/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onekeyfe/onekey-alph-provider",
"version": "2.1.14",
"version": "2.1.15",
"keywords": [
"cross-inpage-provider"
],
Expand Down Expand Up @@ -31,9 +31,9 @@
"@alephium/get-extension-wallet": "^1.5.2",
"@alephium/walletconnect-provider": "^1.5.2",
"@alephium/web3": "^1.5.2",
"@onekeyfe/cross-inpage-provider-core": "2.1.14",
"@onekeyfe/cross-inpage-provider-errors": "2.1.14",
"@onekeyfe/cross-inpage-provider-types": "2.1.14",
"@onekeyfe/extension-bridge-injected": "2.1.14"
"@onekeyfe/cross-inpage-provider-core": "2.1.15",
"@onekeyfe/cross-inpage-provider-errors": "2.1.15",
"@onekeyfe/cross-inpage-provider-types": "2.1.15",
"@onekeyfe/extension-bridge-injected": "2.1.15"
}
}
10 changes: 5 additions & 5 deletions packages/providers/onekey-aptos-provider/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onekeyfe/onekey-aptos-provider",
"version": "2.1.14",
"version": "2.1.15",
"keywords": [
"cross-inpage-provider"
],
Expand Down Expand Up @@ -28,10 +28,10 @@
"start": "tsc --watch"
},
"dependencies": {
"@onekeyfe/cross-inpage-provider-core": "2.1.14",
"@onekeyfe/cross-inpage-provider-errors": "2.1.14",
"@onekeyfe/cross-inpage-provider-types": "2.1.14",
"@onekeyfe/extension-bridge-injected": "2.1.14",
"@onekeyfe/cross-inpage-provider-core": "2.1.15",
"@onekeyfe/cross-inpage-provider-errors": "2.1.15",
"@onekeyfe/cross-inpage-provider-types": "2.1.15",
"@onekeyfe/extension-bridge-injected": "2.1.15",
"aptos": "^1.3.17",
"eth-rpc-errors": "^4.0.3"
}
Expand Down
Loading

0 comments on commit 23a0e8e

Please sign in to comment.