Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/friendly-bobcats-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@wallet01/react": patch
"@wallet01/core": patch
---

adding isAutoConnecting variable
5 changes: 5 additions & 0 deletions .changeset/gold-icons-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wallet01/react": patch
---

add onsuccessful connect option
5 changes: 5 additions & 0 deletions .changeset/happy-gifts-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wallet01/react": patch
---

build then publish
10 changes: 10 additions & 0 deletions .changeset/happy-schools-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@wallet01/react": major
"@wallet01/core": major
"@wallet01/cosmos": minor
"@wallet01/solana": minor
"@wallet01/tezos": minor
"@wallet01/evm": minor
---

New events based architecture Wallet01; updated connectors and react package
5 changes: 5 additions & 0 deletions .changeset/long-yaks-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wallet01/react": patch
---

removing listeners in useEffect
5 changes: 5 additions & 0 deletions .changeset/pink-lions-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wallet01/react": patch
---

Adding alternative way of handling event listeners
28 changes: 28 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"mode": "pre",
"tag": "beta",
"initialVersions": {
"eslint-config-custom": "0.0.0",
"tsconfig": "0.0.0",
"example-nextjs": "0.1.40-beta.4",
"exmaple-vite-react": "0.0.41",
"@wallet01/core": "0.6.5",
"@wallet01/cosmos": "0.7.5",
"@wallet01/evm": "0.11.1",
"@wallet01/react": "0.8.7",
"@wallet01/solana": "0.6.6",
"@wallet01/tezos": "0.2.1"
},
"changesets": [
"friendly-bobcats-repeat",
"gold-icons-tap",
"happy-gifts-tap",
"happy-schools-add",
"long-yaks-rescue",
"pink-lions-cry",
"real-seals-stare",
"shy-turtles-flash",
"six-bees-whisper",
"smart-cups-judge"
]
}
5 changes: 5 additions & 0 deletions .changeset/real-seals-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wallet01/evm": patch
---

Adding metamask connector
5 changes: 5 additions & 0 deletions .changeset/shy-turtles-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wallet01/react": patch
---

updating client error with hook name
5 changes: 5 additions & 0 deletions .changeset/six-bees-whisper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wallet01/react": patch
---

adding succes handlers to all the hooks
5 changes: 5 additions & 0 deletions .changeset/smart-cups-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wallet01/react": patch
---

removing unnecesary errors
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module.exports = {
root: true,
// This tells ESLint to load the config from the package `eslint-config-custom`
extends: ['custom'],
extends: ["custom"],
settings: {
next: {
rootDir: ['apps/*/'],
rootDir: ["examples/*/", "packages/*/"],
},
},
};
8 changes: 2 additions & 6 deletions examples/nextjs/components/ConnectButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@ import { toast } from "react-hot-toast";
import WalletIcons from "./assets/WalletIcons";

const ConnectButtons = () => {
const { connectors, isAutoConnecting } = useClient();
const { activeConnector, isConnected, did, address } = useWallet();
const { connectors } = useClient();
const { activeConnector, isConnected } = useWallet();
const { connect, isError, error } = useConnect();

if (isError && error) {
toast.error(error.message);
}

if (isAutoConnecting) {
console.log("isAutoConnecting");
}

return (
<div className="flex flex-col">
<span className="font-bold text-lg text-center w-full">
Expand Down
37 changes: 20 additions & 17 deletions examples/nextjs/components/ConnectedModal.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import { useClient, useMessage, useSwitch, useWallet } from "@wallet01/react";
import {
useClient,
useDisconnect,
useMessage,
useSwitch,
useWallet,
} from "@wallet01/react";
import React, { useState } from "react";
import WalletIcons from "./assets/WalletIcons";
import { BeaconConnector } from "@wallet01/tezos";

const ConnectedModal = () => {
const [message, setMessage] = useState<string>("");
const [chainId, setChainId] = useState<string>("");
const { did, activeConnector, address, disconnect } = useWallet();
const { activeConnector, address, chainId: cId } = useWallet();
const { signMessage, hash } = useMessage();
const { disconnect } = useDisconnect();
const { switchChain } = useSwitch();
const { activeChain } = useClient();
const { ecosystem } = useClient();

return (
<div className="flex flex-col">
Expand All @@ -19,18 +25,9 @@ const ConnectedModal = () => {
</span>
<div className="grid grid-cols-2 mt-5 justify-center items-center gap-8 border border-slate-600 bg-slate-700 p-4 rounded-lg m-10">
<div className="flex flex-col p-6 gap-4 max-w-full">
{activeChain ? (
<span className="text-xl font-base">
Connected to {activeChain}
</span>
{ecosystem ? (
<span className="text-xl font-base">Connected to {ecosystem}</span>
) : null}
{did ? (
<span className="text-xl font-base">
Hello, <b className="underline underline-offset-1">{did}</b>
</span>
) : (
""
)}
{address ? (
<span className="text-xl font-base truncate">
Address: <br />
Expand All @@ -39,9 +36,15 @@ const ConnectedModal = () => {
) : (
""
)}
{activeConnector?.name === "beacon" ? (
{
<span className="text-xl font-base">
ChainId: <br />
<b className="italic truncate ">{cId}</b>
</span>
}
{/* {activeConnector?.name === "beacon" ? (
<span>{BeaconConnector.publicKey}</span>
) : null}
) : null} */}
<button
className="bg-slate-600 w-fit p-3 text-medium text-lg rounded-md"
onClick={() => disconnect()}
Expand Down
111 changes: 0 additions & 111 deletions examples/nextjs/lib/filecoin.ts

This file was deleted.

2 changes: 1 addition & 1 deletion examples/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"@ethersproject/providers": "^5.7.2",
"@metamask/detect-provider": "^2.0.0",
"@wallet01/core": "workspace:*",
"@wallet01/cosmos": "workspace:*",
"@wallet01/evm": "workspace:*",
"@wallet01/react": "workspace:*",
"@wallet01/cosmos": "workspace:*",
"@wallet01/solana": "workspace:*",
"@wallet01/tezos": "workspace:*",
"ethers": "^5.7.2",
Expand Down
26 changes: 11 additions & 15 deletions examples/nextjs/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from "@wallet01/evm";
import { KeplrConnector } from "@wallet01/cosmos";
import { PhantomConnector, SolflareConnector } from "@wallet01/solana";
import { BeaconConnector, TempleConnector } from "@wallet01/tezos";
import { BeaconConnector } from "@wallet01/tezos";
import Layout from "../components/layout";
import { ColorMode } from "@wallet01/tezos/dist/types";

Expand All @@ -20,26 +20,22 @@ export default function App({ Component, pageProps }: AppProps) {
<Wallet01
autoConnect={true}
connectors={() => [
new InjectedConnector(),
new WalletconnectConnector({
chain: "1",
InjectedConnector.init(),
WalletconnectConnector.init({
chains: [1],
optionalChains: [137, 80001],
projectId: "cef77f9c3969fb563468d997449c92d2",
showQrModal: true,
}),
new BananaConnector(),
new OkxWalletConnector(),
new CoinbaseConnector(),
new PhantomConnector({
rpcUrl: "https://api.mainnet-beta.solana.com",
BananaConnector.init(),
OkxWalletConnector.init(),
CoinbaseConnector.init({
appName: "Wallet01",
}),
new SolflareConnector({
rpcUrl: "https://api.mainnet-beta.solana.com",
}),
new KeplrConnector(),
new TempleConnector({ projectName: "Wallet01" }),
new BeaconConnector({
PhantomConnector.init(),
SolflareConnector.init(),
KeplrConnector.init("osmosis"),
BeaconConnector.init({
name: "Wallet01",
featuredWallets: ["temple", "umami", "kukai", "naan"],
colorMode: ColorMode.DARK,
Expand Down
12 changes: 4 additions & 8 deletions examples/nextjs/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@ interface SVGIcons {
}

export default function Home() {
const { isAutoConnecting } = useClient();
// const { isAutoConnecting } = useClient();
const { isConnected } = useWallet();

return (
<div className="flex flex-col h-screen justify-center items-center">
{isAutoConnecting ? (
{/* {isAutoConnecting ? (
<span className="text-xl text-white font-bold">AutoConnecting</span>
) : null}
{isConnected && !isAutoConnecting ? (
<ConnectedModal />
) : (
<ConnectButtons />
)}
) : null} */}
{isConnected ? <ConnectedModal /> : <ConnectButtons />}
</div>
);
}
Loading