diff --git a/packages/core/package.json b/packages/core/package.json index 52bc66fe..606fc7ec 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/cross-inpage-provider-core", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -29,9 +29,9 @@ "build-version-info": "node ./scripts/buildVersionInfo.js" }, "dependencies": { - "@onekeyfe/cross-inpage-provider-errors": "2.1.19", - "@onekeyfe/cross-inpage-provider-events": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", + "@onekeyfe/cross-inpage-provider-errors": "2.1.20", + "@onekeyfe/cross-inpage-provider-events": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", "events": "^3.3.0", "lodash-es": "^4.17.21", "ms": "^2.1.3" diff --git a/packages/core/src/versionInfo.ts b/packages/core/src/versionInfo.ts index 03be6532..a4bd6e89 100644 --- a/packages/core/src/versionInfo.ts +++ b/packages/core/src/versionInfo.ts @@ -1,5 +1,5 @@ -const version = '2.1.17'; +const version = '2.1.19'; const versionBuild = '2020-0101-1'; export default { diff --git a/packages/desktop/desktop-bridge-injected/package.json b/packages/desktop/desktop-bridge-injected/package.json index 51e84615..427dc20c 100644 --- a/packages/desktop/desktop-bridge-injected/package.json +++ b/packages/desktop/desktop-bridge-injected/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/desktop-bridge-injected", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -34,7 +34,7 @@ "electron": "^17.2.0" }, "dependencies": { - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19" + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20" } } diff --git a/packages/empty/package.json b/packages/empty/package.json index ac2df5f8..acfec725 100644 --- a/packages/empty/package.json +++ b/packages/empty/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/cross-inpage-provider-empty", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], diff --git a/packages/errors/package.json b/packages/errors/package.json index c897a4ff..d904dba5 100644 --- a/packages/errors/package.json +++ b/packages/errors/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/cross-inpage-provider-errors", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], diff --git a/packages/events/package.json b/packages/events/package.json index f2d63cc4..94b820ec 100644 --- a/packages/events/package.json +++ b/packages/events/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/cross-inpage-provider-events", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], diff --git a/packages/example/components/chains/aptosStandard/example.tsx b/packages/example/components/chains/aptosStandard/example.tsx index 15ac0992..f588227b 100644 --- a/packages/example/components/chains/aptosStandard/example.tsx +++ b/packages/example/components/chains/aptosStandard/example.tsx @@ -25,6 +25,10 @@ import { Ed25519PublicKey, Ed25519Signature, AccountAuthenticatorEd25519, + AccountAddress, + U64, + U256, + isEncodedEntryFunctionArgument, } from '@aptos-labs/ts-sdk'; import { WalletReadyState, @@ -314,6 +318,70 @@ function Example() { /> + + { + const { recipient, amount, coinType } = JSON.parse(request); + return { + result: await signAndSubmitTransaction({ + sender: account?.address ?? '', + data: { + function: '0x1::primary_fungible_store::transfer', + typeArguments: ['0x1::fungible_asset::Metadata'], + functionArguments: [coinType, recipient as string, amount as number], + }, + }), + }; + }} + /> + + { + const { recipient, amount, coinType } = JSON.parse(request); + return { + result: await signAndSubmitTransaction({ + sender: account?.address ?? '', + data: { + function: '0x1::primary_fungible_store::transfer', + typeArguments: ['0x1::fungible_asset::Metadata'], + functionArguments: [ + coinType, + AccountAddress.from(recipient as string), + new U64(amount as number), + ], + }, + }), + }; + }} + /> + + ); @@ -326,6 +394,7 @@ function AptosConnectButton() { const walletsRef = useRef<(Wallet | AptosStandardSupportedWallet)[]>([]); walletsRef.current = wallets.filter((wallet) => wallet.readyState === WalletReadyState.Installed); + console.log('Aptos Standard Wallets:', walletsRef.current); const onConnectWallet = useCallback( async (selectedWallet: IKnownWallet) => { diff --git a/packages/example/package.json b/packages/example/package.json index dad651b4..9762416b 100644 --- a/packages/example/package.json +++ b/packages/example/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/cross-inpage-provider-example", - "version": "2.1.19", + "version": "2.1.20", "private": true, "scripts": { "postinstall": "patch-package", @@ -25,17 +25,17 @@ "@metamask/onboarding": "^1.0.1", "@mizuwallet-sdk/core": "^1.4.0", "@mysten/dapp-kit": "0.13.2", - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", - "@onekeyfe/onekey-aptos-provider": "2.1.19", - "@onekeyfe/onekey-cardano-provider": "2.1.19", - "@onekeyfe/onekey-conflux-provider": "2.1.19", - "@onekeyfe/onekey-cosmos-provider": "2.1.19", - "@onekeyfe/onekey-near-provider": "2.1.19", - "@onekeyfe/onekey-solana-provider": "2.1.19", - "@onekeyfe/onekey-sui-provider": "2.1.19", - "@onekeyfe/onekey-tron-provider": "2.1.19", - "@onekeyfe/onekey-webln-provider": "2.1.19", + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", + "@onekeyfe/onekey-aptos-provider": "2.1.20", + "@onekeyfe/onekey-cardano-provider": "2.1.20", + "@onekeyfe/onekey-conflux-provider": "2.1.20", + "@onekeyfe/onekey-cosmos-provider": "2.1.20", + "@onekeyfe/onekey-near-provider": "2.1.20", + "@onekeyfe/onekey-solana-provider": "2.1.20", + "@onekeyfe/onekey-sui-provider": "2.1.20", + "@onekeyfe/onekey-tron-provider": "2.1.20", + "@onekeyfe/onekey-webln-provider": "2.1.20", "@polkadot/api": "^9.11.3", "@polkadot/extension-dapp": "^0.47.5", "@radix-ui/react-checkbox": "^1.1.0", diff --git a/packages/extension/extension-bridge-hosted/package.json b/packages/extension/extension-bridge-hosted/package.json index d834ccd1..9e452109 100644 --- a/packages/extension/extension-bridge-hosted/package.json +++ b/packages/extension/extension-bridge-hosted/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/extension-bridge-hosted", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -28,8 +28,8 @@ "start": "tsc --watch" }, "dependencies": { - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", "uuid": "^8.3.2" }, "devDependencies": { diff --git a/packages/extension/extension-bridge-injected/package.json b/packages/extension/extension-bridge-injected/package.json index b70ed5b9..9cb7ab2b 100644 --- a/packages/extension/extension-bridge-injected/package.json +++ b/packages/extension/extension-bridge-injected/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/extension-bridge-injected", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -28,7 +28,7 @@ "start": "tsc --watch" }, "dependencies": { - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19" + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20" } } diff --git a/packages/injected/package.json b/packages/injected/package.json index 5f572822..cae4a21c 100644 --- a/packages/injected/package.json +++ b/packages/injected/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/cross-inpage-provider-injected", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -42,12 +42,12 @@ "electron": "*" }, "dependencies": { - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", - "@onekeyfe/desktop-bridge-injected": "2.1.19", - "@onekeyfe/extension-bridge-injected": "2.1.19", - "@onekeyfe/inpage-providers-hub": "2.1.19", - "@onekeyfe/native-bridge-injected": "2.1.19", + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", + "@onekeyfe/desktop-bridge-injected": "2.1.20", + "@onekeyfe/extension-bridge-injected": "2.1.20", + "@onekeyfe/inpage-providers-hub": "2.1.20", + "@onekeyfe/native-bridge-injected": "2.1.20", "buffer": "^6.0.3", "crypto-browserify": "^3.12.0" } diff --git a/packages/native/native-bridge-injected/package.json b/packages/native/native-bridge-injected/package.json index f459603f..368eb558 100644 --- a/packages/native/native-bridge-injected/package.json +++ b/packages/native/native-bridge-injected/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/native-bridge-injected", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -28,7 +28,7 @@ "start": "tsc --watch" }, "dependencies": { - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19" + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20" } } diff --git a/packages/providers/inpage-providers-hub/package.json b/packages/providers/inpage-providers-hub/package.json index fbc79905..29c635b2 100644 --- a/packages/providers/inpage-providers-hub/package.json +++ b/packages/providers/inpage-providers-hub/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/inpage-providers-hub", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -30,26 +30,26 @@ "start": "tsc --watch" }, "dependencies": { - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", - "@onekeyfe/onekey-algo-provider": "2.1.19", - "@onekeyfe/onekey-alph-provider": "2.1.19", - "@onekeyfe/onekey-aptos-provider": "2.1.19", - "@onekeyfe/onekey-bfc-provider": "2.1.19", - "@onekeyfe/onekey-btc-provider": "2.1.19", - "@onekeyfe/onekey-cardano-provider": "2.1.19", - "@onekeyfe/onekey-conflux-provider": "2.1.19", - "@onekeyfe/onekey-cosmos-provider": "2.1.19", - "@onekeyfe/onekey-eth-provider": "2.1.19", - "@onekeyfe/onekey-nostr-provider": "2.1.19", - "@onekeyfe/onekey-polkadot-provider": "2.1.19", - "@onekeyfe/onekey-private-provider": "2.1.19", - "@onekeyfe/onekey-scdo-provider": "2.1.19", - "@onekeyfe/onekey-solana-provider": "2.1.19", - "@onekeyfe/onekey-sui-provider": "2.1.19", - "@onekeyfe/onekey-ton-provider": "2.1.19", - "@onekeyfe/onekey-tron-provider": "2.1.19", - "@onekeyfe/onekey-webln-provider": "2.1.19", + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", + "@onekeyfe/onekey-algo-provider": "2.1.20", + "@onekeyfe/onekey-alph-provider": "2.1.20", + "@onekeyfe/onekey-aptos-provider": "2.1.20", + "@onekeyfe/onekey-bfc-provider": "2.1.20", + "@onekeyfe/onekey-btc-provider": "2.1.20", + "@onekeyfe/onekey-cardano-provider": "2.1.20", + "@onekeyfe/onekey-conflux-provider": "2.1.20", + "@onekeyfe/onekey-cosmos-provider": "2.1.20", + "@onekeyfe/onekey-eth-provider": "2.1.20", + "@onekeyfe/onekey-nostr-provider": "2.1.20", + "@onekeyfe/onekey-polkadot-provider": "2.1.20", + "@onekeyfe/onekey-private-provider": "2.1.20", + "@onekeyfe/onekey-scdo-provider": "2.1.20", + "@onekeyfe/onekey-solana-provider": "2.1.20", + "@onekeyfe/onekey-sui-provider": "2.1.20", + "@onekeyfe/onekey-ton-provider": "2.1.20", + "@onekeyfe/onekey-tron-provider": "2.1.20", + "@onekeyfe/onekey-webln-provider": "2.1.20", "web3": "^1.7.3" }, "devDependencies": { diff --git a/packages/providers/onekey-algo-provider/package.json b/packages/providers/onekey-algo-provider/package.json index c4b145cf..6feb9330 100644 --- a/packages/providers/onekey-algo-provider/package.json +++ b/packages/providers/onekey-algo-provider/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/onekey-algo-provider", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -28,9 +28,9 @@ "start": "tsc --watch" }, "dependencies": { - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-errors": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", - "@onekeyfe/extension-bridge-injected": "2.1.19" + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-errors": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", + "@onekeyfe/extension-bridge-injected": "2.1.20" } } diff --git a/packages/providers/onekey-alph-provider/package.json b/packages/providers/onekey-alph-provider/package.json index a1548552..43eb4c16 100644 --- a/packages/providers/onekey-alph-provider/package.json +++ b/packages/providers/onekey-alph-provider/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/onekey-alph-provider", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -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.19", - "@onekeyfe/cross-inpage-provider-errors": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", - "@onekeyfe/extension-bridge-injected": "2.1.19" + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-errors": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", + "@onekeyfe/extension-bridge-injected": "2.1.20" } } diff --git a/packages/providers/onekey-aptos-provider/package.json b/packages/providers/onekey-aptos-provider/package.json index b76f9148..9fddfc77 100644 --- a/packages/providers/onekey-aptos-provider/package.json +++ b/packages/providers/onekey-aptos-provider/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/onekey-aptos-provider", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -29,10 +29,10 @@ }, "dependencies": { "@aptos-labs/wallet-standard": "^0.2.0", - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-errors": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", - "@onekeyfe/extension-bridge-injected": "2.1.19", + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-errors": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", + "@onekeyfe/extension-bridge-injected": "2.1.20", "@wallet-standard/core": "1.0.3", "eth-rpc-errors": "^4.0.3" }, diff --git a/packages/providers/onekey-aptos-provider/src/OnekeyAptosProvider.ts b/packages/providers/onekey-aptos-provider/src/OnekeyAptosProvider.ts index 99ba529d..65cf2e4e 100644 --- a/packages/providers/onekey-aptos-provider/src/OnekeyAptosProvider.ts +++ b/packages/providers/onekey-aptos-provider/src/OnekeyAptosProvider.ts @@ -20,6 +20,7 @@ import { Ed25519PublicKey, Ed25519Signature, } from '@aptos-labs/ts-sdk'; +import { AptosSignAndSubmitTransactionOutput } from '@aptos-labs/wallet-standard'; export type AptosProviderType = 'petra' | 'martian'; @@ -69,6 +70,8 @@ export type AptosRequest = { signature: string; publicKey: string; }>; + + 'signAndSubmitTransactionV2': (params: string) => Promise; }; type JsBridgeRequest = { @@ -113,6 +116,7 @@ export interface IProviderAptos extends ProviderAptosBase { signTransaction(transactions: any): Promise; signTransactionV2(params: SignTransactionV2Params): Promise; + signAndSubmitTransactionV2(params: string): Promise; /** * Sign message @@ -260,7 +264,7 @@ class ProviderAptos extends ProviderAptosBase implements IProviderAptos { if (!result) throw web3Errors.provider.unauthorized(); - this._handleConnected(result, { emit: true }); + this._handleConnected(result, { emit: false }); return result; } @@ -322,6 +326,13 @@ class ProviderAptos extends ProviderAptosBase implements IProviderAptos { throw new Error('Unsupported sign type'); } + async signAndSubmitTransactionV2(params: string): Promise { + return this._callBridge({ + method: 'signAndSubmitTransactionV2', + params, + }); + } + async signMessageCompatible( payload: SignMessagePayloadCompatible, ): Promise { diff --git a/packages/providers/onekey-aptos-provider/src/StandardProvider.ts b/packages/providers/onekey-aptos-provider/src/StandardProvider.ts index c1af3d21..7567c709 100644 --- a/packages/providers/onekey-aptos-provider/src/StandardProvider.ts +++ b/packages/providers/onekey-aptos-provider/src/StandardProvider.ts @@ -1,4 +1,10 @@ -import { Ed25519Signature, Ed25519PublicKey, Network, AccountAddress } from '@aptos-labs/ts-sdk'; +import { + Ed25519Signature, + Ed25519PublicKey, + Network, + AccountAddress, + isEncodedEntryFunctionArgument, +} from '@aptos-labs/ts-sdk'; import { APTOS_CHAINS, AccountInfo, @@ -32,6 +38,9 @@ import type { WalletIcon, AptosOnAccountChangeInput, AptosOnNetworkChangeInput, + AptosSignAndSubmitTransactionMethod, + AptosSignAndSubmitTransactionInput, + AptosSignAndSubmitTransactionOutput, } from '@aptos-labs/wallet-standard'; import type { ProviderAptos } from './OnekeyAptosProvider'; @@ -121,6 +130,10 @@ export class AptosStandardProvider implements AptosWallet { version: '1.0.0', onNetworkChange: this.onNetworkChange, }, + 'aptos:signAndSubmitTransaction': { + version: '1.1.0', + signAndSubmitTransaction: this.signAndSubmitTransaction, + }, }; } @@ -202,6 +215,27 @@ export class AptosStandardProvider implements AptosWallet { }); }; + signAndSubmitTransaction: AptosSignAndSubmitTransactionMethod = async ( + input: AptosSignAndSubmitTransactionInput, + ): Promise> => { + const { payload } = input; + + const existsBscEncodedArg = payload.functionArguments.find((arg) => + isEncodedEntryFunctionArgument(arg), + ); + + if (existsBscEncodedArg) { + throw new Error('Unsupported Function Arguments type'); + } + + const result = await this.provider.signAndSubmitTransactionV2(JSON.stringify(input)); + + return Promise.resolve({ + status: UserResponseStatus.APPROVED, + args: result, + }); + }; + /** * @param input - A message to sign with the private key of the connected account. * @returns A user response either with a signed message, or the user rejecting to sign. diff --git a/packages/providers/onekey-bfc-provider/package.json b/packages/providers/onekey-bfc-provider/package.json index f940a91d..1a128d9d 100644 --- a/packages/providers/onekey-bfc-provider/package.json +++ b/packages/providers/onekey-bfc-provider/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/onekey-bfc-provider", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -29,10 +29,10 @@ }, "dependencies": { "@benfen/bfc.js": "0.2.7", - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-errors": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", - "@onekeyfe/extension-bridge-injected": "2.1.19", + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-errors": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", + "@onekeyfe/extension-bridge-injected": "2.1.20", "eth-rpc-errors": "^4.0.3", "mitt": "^3.0.0" }, diff --git a/packages/providers/onekey-btc-provider/package.json b/packages/providers/onekey-btc-provider/package.json index 922bd99e..69ea9e03 100644 --- a/packages/providers/onekey-btc-provider/package.json +++ b/packages/providers/onekey-btc-provider/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/onekey-btc-provider", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -28,9 +28,9 @@ "start": "tsc --watch" }, "dependencies": { - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-errors": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", - "@onekeyfe/extension-bridge-injected": "2.1.19" + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-errors": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", + "@onekeyfe/extension-bridge-injected": "2.1.20" } } diff --git a/packages/providers/onekey-cardano-provider/package.json b/packages/providers/onekey-cardano-provider/package.json index d26b1d45..6891cfe9 100644 --- a/packages/providers/onekey-cardano-provider/package.json +++ b/packages/providers/onekey-cardano-provider/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/onekey-cardano-provider", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider", "cardano" @@ -29,9 +29,9 @@ "start": "tsc --watch" }, "dependencies": { - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-errors": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", - "@onekeyfe/extension-bridge-injected": "2.1.19" + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-errors": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", + "@onekeyfe/extension-bridge-injected": "2.1.20" } } diff --git a/packages/providers/onekey-conflux-provider/package.json b/packages/providers/onekey-conflux-provider/package.json index bcf3ea50..a5b67654 100644 --- a/packages/providers/onekey-conflux-provider/package.json +++ b/packages/providers/onekey-conflux-provider/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/onekey-conflux-provider", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -28,9 +28,9 @@ "start": "tsc --watch" }, "dependencies": { - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-errors": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", - "@onekeyfe/extension-bridge-injected": "2.1.19" + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-errors": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", + "@onekeyfe/extension-bridge-injected": "2.1.20" } } diff --git a/packages/providers/onekey-cosmos-provider/package.json b/packages/providers/onekey-cosmos-provider/package.json index 950b4b21..9f2c81fe 100644 --- a/packages/providers/onekey-cosmos-provider/package.json +++ b/packages/providers/onekey-cosmos-provider/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/onekey-cosmos-provider", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -29,10 +29,10 @@ }, "dependencies": { "@noble/hashes": "^1.3.0", - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-errors": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", - "@onekeyfe/extension-bridge-injected": "2.1.19", + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-errors": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", + "@onekeyfe/extension-bridge-injected": "2.1.20", "eth-rpc-errors": "^4.0.3", "long": "^5.2.1", "mitt": "^3.0.0" diff --git a/packages/providers/onekey-cosmos-provider/src/OnekeyCosmosProvider.ts b/packages/providers/onekey-cosmos-provider/src/OnekeyCosmosProvider.ts index e1314fec..8e1bf85f 100644 --- a/packages/providers/onekey-cosmos-provider/src/OnekeyCosmosProvider.ts +++ b/packages/providers/onekey-cosmos-provider/src/OnekeyCosmosProvider.ts @@ -4,7 +4,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable tsdoc/syntax */ import { bytesToHex, hexToBytes } from '@noble/hashes/utils'; -import type { IInpageProviderConfig } from '@onekeyfe/cross-inpage-provider-core'; +import { checkEnableDefineProperty, checkWalletSwitchEnable, type IInpageProviderConfig } from '@onekeyfe/cross-inpage-provider-core'; import { getOrCreateExtInjectedJsBridge } from '@onekeyfe/extension-bridge-injected'; import { ProviderCosmosBase } from './ProviderCosmosBase'; import type * as TypeUtils from './type-utils'; @@ -249,6 +249,8 @@ class ProviderCosmos extends ProviderCosmosBase implements IProviderCosmos { args: any[]; id: string; }; + if(!checkWalletSwitchEnable()) return; + if (data && data.type === 'proxy-request' && data.method) { const method = data.method as 'enable'; if (this[method]) { diff --git a/packages/providers/onekey-eth-provider/package.json b/packages/providers/onekey-eth-provider/package.json index b479f28b..f40d206f 100644 --- a/packages/providers/onekey-eth-provider/package.json +++ b/packages/providers/onekey-eth-provider/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/onekey-eth-provider", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -28,10 +28,10 @@ "start": "tsc --watch" }, "dependencies": { - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-errors": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", - "@onekeyfe/extension-bridge-injected": "2.1.19", + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-errors": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", + "@onekeyfe/extension-bridge-injected": "2.1.20", "eth-rpc-errors": "^4.0.3", "uuid": "^8.3.2" }, diff --git a/packages/providers/onekey-near-provider/package.json b/packages/providers/onekey-near-provider/package.json index 1df580da..e4d111aa 100644 --- a/packages/providers/onekey-near-provider/package.json +++ b/packages/providers/onekey-near-provider/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/onekey-near-provider", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -35,10 +35,10 @@ "near-api-js": "^0.44.2" }, "dependencies": { - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-errors": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", - "@onekeyfe/extension-bridge-injected": "2.1.19", + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-errors": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", + "@onekeyfe/extension-bridge-injected": "2.1.20", "borsh": "^0.6.0", "depd": "^2.0.0", "tweetnacl": "^1.0.3" diff --git a/packages/providers/onekey-nostr-provider/package.json b/packages/providers/onekey-nostr-provider/package.json index ac322705..d34093c1 100644 --- a/packages/providers/onekey-nostr-provider/package.json +++ b/packages/providers/onekey-nostr-provider/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/onekey-nostr-provider", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -28,9 +28,9 @@ "start": "tsc --watch" }, "dependencies": { - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-errors": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", - "@onekeyfe/extension-bridge-injected": "2.1.19" + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-errors": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", + "@onekeyfe/extension-bridge-injected": "2.1.20" } } diff --git a/packages/providers/onekey-polkadot-provider/package.json b/packages/providers/onekey-polkadot-provider/package.json index b1e977bc..e010a5f0 100644 --- a/packages/providers/onekey-polkadot-provider/package.json +++ b/packages/providers/onekey-polkadot-provider/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/onekey-polkadot-provider", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -29,10 +29,10 @@ }, "dependencies": { "@noble/hashes": "^1.3.0", - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-errors": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", - "@onekeyfe/extension-bridge-injected": "2.1.19", + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-errors": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", + "@onekeyfe/extension-bridge-injected": "2.1.20", "@polkadot/extension-inject": "^0.46.3", "eth-rpc-errors": "^4.0.3", "long": "^5.2.1", diff --git a/packages/providers/onekey-private-provider/package.json b/packages/providers/onekey-private-provider/package.json index 68e68526..17e190e0 100644 --- a/packages/providers/onekey-private-provider/package.json +++ b/packages/providers/onekey-private-provider/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/onekey-private-provider", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -28,9 +28,9 @@ "start": "tsc --watch" }, "dependencies": { - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-errors": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", - "@onekeyfe/extension-bridge-injected": "2.1.19" + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-errors": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", + "@onekeyfe/extension-bridge-injected": "2.1.20" } } diff --git a/packages/providers/onekey-scdo-provider/package.json b/packages/providers/onekey-scdo-provider/package.json index 59c21ce2..5212afb0 100644 --- a/packages/providers/onekey-scdo-provider/package.json +++ b/packages/providers/onekey-scdo-provider/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/onekey-scdo-provider", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -28,9 +28,9 @@ "start": "tsc --watch" }, "dependencies": { - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-errors": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", - "@onekeyfe/extension-bridge-injected": "2.1.19" + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-errors": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", + "@onekeyfe/extension-bridge-injected": "2.1.20" } } diff --git a/packages/providers/onekey-solana-provider/package.json b/packages/providers/onekey-solana-provider/package.json index c4474061..ef496dcd 100644 --- a/packages/providers/onekey-solana-provider/package.json +++ b/packages/providers/onekey-solana-provider/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/onekey-solana-provider", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider", "solona" @@ -29,10 +29,10 @@ "start": "tsc --watch" }, "dependencies": { - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-errors": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", - "@onekeyfe/extension-bridge-injected": "2.1.19", + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-errors": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", + "@onekeyfe/extension-bridge-injected": "2.1.20", "@solana/wallet-standard-features": "^1.1.0", "@solana/web3.js": "^1.41.3", "@wallet-standard/base": "^1.0.1", diff --git a/packages/providers/onekey-sui-provider/package.json b/packages/providers/onekey-sui-provider/package.json index 045d39ce..d9f22d2e 100644 --- a/packages/providers/onekey-sui-provider/package.json +++ b/packages/providers/onekey-sui-provider/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/onekey-sui-provider", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -29,10 +29,10 @@ }, "dependencies": { "@mysten/wallet-standard": "^0.7.2", - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-errors": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", - "@onekeyfe/extension-bridge-injected": "2.1.19", + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-errors": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", + "@onekeyfe/extension-bridge-injected": "2.1.20", "eth-rpc-errors": "^4.0.3", "mitt": "^3.0.0" } diff --git a/packages/providers/onekey-ton-provider/package.json b/packages/providers/onekey-ton-provider/package.json index a394172b..fb09af21 100644 --- a/packages/providers/onekey-ton-provider/package.json +++ b/packages/providers/onekey-ton-provider/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/onekey-ton-provider", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -28,10 +28,10 @@ "start": "tsc --watch" }, "dependencies": { - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-errors": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", - "@onekeyfe/extension-bridge-injected": "2.1.19", + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-errors": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", + "@onekeyfe/extension-bridge-injected": "2.1.20", "@tonconnect/protocol": "^2.2.6" } } diff --git a/packages/providers/onekey-tron-provider/package.json b/packages/providers/onekey-tron-provider/package.json index eaaa2d5f..7b5b586a 100644 --- a/packages/providers/onekey-tron-provider/package.json +++ b/packages/providers/onekey-tron-provider/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/onekey-tron-provider", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -29,10 +29,10 @@ }, "dependencies": { "@noble/secp256k1": "1.7.1", - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-errors": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", - "@onekeyfe/extension-bridge-injected": "2.1.19", + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-errors": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", + "@onekeyfe/extension-bridge-injected": "2.1.20", "querystring": "^0.2.1", "sunweb": "^1.0.7", "tronweb": "^5.3.2" diff --git a/packages/providers/onekey-webln-provider/package.json b/packages/providers/onekey-webln-provider/package.json index 2bfb8073..84d61889 100644 --- a/packages/providers/onekey-webln-provider/package.json +++ b/packages/providers/onekey-webln-provider/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/onekey-webln-provider", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -28,9 +28,9 @@ "start": "tsc --watch" }, "dependencies": { - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-errors": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19", - "@onekeyfe/extension-bridge-injected": "2.1.19" + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-errors": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20", + "@onekeyfe/extension-bridge-injected": "2.1.20" } } diff --git a/packages/types/package.json b/packages/types/package.json index a7f7bf97..3a6a0bae 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/cross-inpage-provider-types", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], diff --git a/packages/webview/package.json b/packages/webview/package.json index 61acf929..6718f04a 100644 --- a/packages/webview/package.json +++ b/packages/webview/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/onekey-cross-webview", - "version": "2.1.19", + "version": "2.1.20", "keywords": [ "cross-inpage-provider" ], @@ -36,7 +36,7 @@ "react-native-webview": "^11.17.2" }, "dependencies": { - "@onekeyfe/cross-inpage-provider-core": "2.1.19", - "@onekeyfe/cross-inpage-provider-types": "2.1.19" + "@onekeyfe/cross-inpage-provider-core": "2.1.20", + "@onekeyfe/cross-inpage-provider-types": "2.1.20" } }