Skip to content

Commit

Permalink
Fix: dot provider & add onDisconnect on aptos (#248)
Browse files Browse the repository at this point in the history
* feat: fix dot provider

* feat: add onDisconnect method on aptos provider

* chore: release version 2.1.13
  • Loading branch information
ByteZhang1024 authored Nov 11, 2024
1 parent 5407a59 commit f4e39f4
Show file tree
Hide file tree
Showing 40 changed files with 686 additions and 181 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.12",
"version": "2.1.13",
"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.12",
"@onekeyfe/cross-inpage-provider-events": "2.1.12",
"@onekeyfe/cross-inpage-provider-types": "2.1.12",
"@onekeyfe/cross-inpage-provider-errors": "2.1.13",
"@onekeyfe/cross-inpage-provider-events": "2.1.13",
"@onekeyfe/cross-inpage-provider-types": "2.1.13",
"events": "^3.3.0",
"lodash-es": "^4.17.21",
"ms": "^2.1.3"
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.12",
"version": "2.1.13",
"keywords": [
"cross-inpage-provider"
],
Expand Down Expand Up @@ -34,7 +34,7 @@
"electron": "^17.2.0"
},
"dependencies": {
"@onekeyfe/cross-inpage-provider-core": "2.1.12",
"@onekeyfe/cross-inpage-provider-types": "2.1.12"
"@onekeyfe/cross-inpage-provider-core": "2.1.13",
"@onekeyfe/cross-inpage-provider-types": "2.1.13"
}
}
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.12",
"version": "2.1.13",
"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.12",
"version": "2.1.13",
"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.12",
"version": "2.1.13",
"keywords": [
"cross-inpage-provider"
],
Expand Down
7 changes: 6 additions & 1 deletion packages/example/components/chains/aptos/example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ export default function Example() {
publicKey: params.publicKey,
});
});

// @ts-expect-error
provider.onDisconnect?.((params: { name: string | null } | null) => {
console.log(`aptos [onDisconnect] ${JSON.stringify(params)}`);
});
}, [account, provider, setAccount]);
return (
<>
Expand Down Expand Up @@ -198,7 +203,7 @@ export default function Example() {
const options = {
method: 'POST',
url: 'https://api.mainnet.aptoslabs.com/v1/transactions',
headers: {'Content-Type': 'application/x.aptos.signed_transaction+bcs'},
headers: { 'Content-Type': 'application/x.aptos.signed_transaction+bcs' },
data: buffer
};

Expand Down
17 changes: 14 additions & 3 deletions packages/example/components/chains/polkadot/example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,6 @@ export default function Example() {

const listenerRef = useRef<() => void>();
useEffect(() => {
if (!apiRef.current) {
return;
}
if (!provider) {
return;
}
Expand Down Expand Up @@ -222,6 +219,20 @@ export default function Example() {
return JSON.stringify(res);
}}
/>
<ApiPayload
title="accounts.get (Manta dApp)"
description="Test Manta Connect (dApp)"
disableRequestContent
onExecute={async (request: string) => {
// serialization provider
JSON.stringify(provider)
// get accounts
const localProvider = provider
const accountProvider = localProvider?.accounts
const res = await accountProvider?.get();
return JSON.stringify(res);
}}
/>
<ApiPayload
title="signRaw"
description="签名消息"
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.12",
"version": "2.1.13",
"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.12",
"@onekeyfe/cross-inpage-provider-types": "2.1.12",
"@onekeyfe/onekey-aptos-provider": "2.1.12",
"@onekeyfe/onekey-cardano-provider": "2.1.12",
"@onekeyfe/onekey-conflux-provider": "2.1.12",
"@onekeyfe/onekey-cosmos-provider": "2.1.12",
"@onekeyfe/onekey-near-provider": "2.1.12",
"@onekeyfe/onekey-solana-provider": "2.1.12",
"@onekeyfe/onekey-sui-provider": "2.1.12",
"@onekeyfe/onekey-tron-provider": "2.1.12",
"@onekeyfe/onekey-webln-provider": "2.1.12",
"@onekeyfe/cross-inpage-provider-core": "2.1.13",
"@onekeyfe/cross-inpage-provider-types": "2.1.13",
"@onekeyfe/onekey-aptos-provider": "2.1.13",
"@onekeyfe/onekey-cardano-provider": "2.1.13",
"@onekeyfe/onekey-conflux-provider": "2.1.13",
"@onekeyfe/onekey-cosmos-provider": "2.1.13",
"@onekeyfe/onekey-near-provider": "2.1.13",
"@onekeyfe/onekey-solana-provider": "2.1.13",
"@onekeyfe/onekey-sui-provider": "2.1.13",
"@onekeyfe/onekey-tron-provider": "2.1.13",
"@onekeyfe/onekey-webln-provider": "2.1.13",
"@polkadot/api": "^9.11.3",
"@polkadot/extension-dapp": "^0.47.5",
"@radix-ui/react-checkbox": "^1.1.0",
Expand Down
Loading

0 comments on commit f4e39f4

Please sign in to comment.