diff --git a/.changeset/hot-cougars-cheer.md b/.changeset/hot-cougars-cheer.md deleted file mode 100644 index 69b61e6..0000000 --- a/.changeset/hot-cougars-cheer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"cive": patch ---- - -Added wallet action to export diff --git a/.changeset/hungry-queens-hunt.md b/.changeset/hungry-queens-hunt.md deleted file mode 100644 index 4994d90..0000000 --- a/.changeset/hungry-queens-hunt.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"cive": patch ---- - -Fixed EIP1193EventMap Address type diff --git a/examples/client_wallet_fluent/src/App.tsx b/examples/client_wallet_fluent/src/App.tsx index 8794d50..b7381f3 100644 --- a/examples/client_wallet_fluent/src/App.tsx +++ b/examples/client_wallet_fluent/src/App.tsx @@ -6,16 +6,16 @@ import { custom, parseCFX, SignMessageErrorType, -} from "cive"; -import { mainnet, testnet } from "cive/chains"; -import React, { useCallback, useEffect, useMemo, useState } from "react"; -import "cive/window"; -import type { SendTransactionErrorType } from "../../../src/_types/actions/wallet/sendTransaction"; +} from 'cive' +import { mainnet, testnet } from 'cive/chains' +import React, { useCallback, useEffect, useMemo, useState } from 'react' +import 'cive/window' +import type { SendTransactionErrorType } from '../../../src/_types/actions/wallet/sendTransaction' export default function App() { - const [account, setAccount] = useState
(); - const [transaction, setTransaction] = useState(); - const [signMessage, setSignMessage] = useState(); + const [account, setAccount] = useState
() + const [transaction, setTransaction] = useState() + const [signMessage, setSignMessage] = useState() const walletClient = useMemo( () => @@ -23,13 +23,13 @@ export default function App() { chain: testnet, transport: custom(window.fluent!), }), - [] - ); + [], + ) const connect = useCallback(async () => { - const [address] = await walletClient.requestAddresses(); - setAccount(address); - }, [walletClient]); + const [address] = await walletClient.requestAddresses() + setAccount(address) + }, [walletClient]) const handleSendTransaction = useCallback(async () => { if (account) { @@ -37,47 +37,47 @@ export default function App() { const hash = await walletClient.sendTransaction({ account, to: account, - value: parseCFX("0.01"), - }); - setTransaction(`successful: ${hash}`); + value: parseCFX('0.01'), + }) + setTransaction(`successful: ${hash}`) } catch (error: unknown) { - const err = error as SendTransactionErrorType; - setTransaction(err.name); + const err = error as SendTransactionErrorType + setTransaction(err.name) } } - }, [walletClient, account]); + }, [walletClient, account]) const handleSignMessage = useCallback(async () => { if (account) { try { const signature = await walletClient.signMessage({ account, - message: "hello world", - }); - setSignMessage(`successful: ${signature}`); + message: 'hello world', + }) + setSignMessage(`successful: ${signature}`) } catch (error: unknown) { - const err = error as SignMessageErrorType; + const err = error as SignMessageErrorType - setSignMessage(err.name); + setSignMessage(err.name) } } - }, [walletClient, account]); + }, [walletClient, account]) const handleSwitchChain = useCallback(async () => { if (account) { - await walletClient.switchChain({ id: testnet.id }); + await walletClient.switchChain({ id: testnet.id }) } - }, [walletClient, account]); + }, [walletClient, account]) useEffect(() => { - window?.fluent?.on("accountsChanged", (accounts: Address[]) => { + window?.fluent?.on('accountsChanged', (accounts: Address[]) => { if (accounts.length > 0) { - setAccount(accounts[0]); + setAccount(accounts[0]) } else { - setAccount(undefined); + setAccount(undefined) } - }); - window?.fluent?.on("disconnect", () => setAccount(undefined)); - }, []); + }) + window?.fluent?.on('disconnect', () => setAccount(undefined)) + }, []) return (
@@ -120,5 +120,5 @@ export default function App() {
- ); + ) } diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md index a1427dd..931982c 100644 --- a/src/CHANGELOG.md +++ b/src/CHANGELOG.md @@ -1,5 +1,12 @@ # cive +## 0.4.1 + +### Patch Changes + +- f484fe1: Added wallet action to export +- 68dd2a6: Fixed EIP1193EventMap Address type + ## 0.4.0 ### Minor Changes diff --git a/src/package.json b/src/package.json index bcb2288..2d2657d 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "cive", - "version": "0.4.0", + "version": "0.4.1", "description": "", "type": "module", "main": "./_cjs/index.js",