Beta 100 (#27)
* update deps * revert react dep updates * chore: update deps to beta.50 * fix: get dapp running again up to Client.connect() * save progress * feat(debug): sets up a debug peerClient as responder * refactor: remove more hardcoded example connect params * fix: gets `checkPersistedState` working again * fix: gets client.disconnect + effects working again * feat: integrates `session_update` handling with namespaces * fix: remove hardcoded `chains` * stash progress * Establish session * save progress - established session with example dapp * refactor: rewrite namespace helpers to handle `requiredNamespaces` (#23) * fix: re-enables restoring persisted session * refactor: remove debug peerClient code * fix: re-enables restoring persisted pairings * Save progress * fix: re-enables pairing modal, connecting from existing pairing * Update modals to handle new payloads * fix(types): fix Metadata typing * chore(deps): upgrade to beta.53 * refactor: adjusts event handler args for beta.53 `session_update` * stash * fix: adds missing keys for `DEFAULT_EIP155_EVENTS` enum * stash * chore: update comment for client.request typing FIXME * feat: integrate beta.54 * feat: integrate beta.55, removes FIXME comments for client.request types * chore: clean up unused import * fix: log session_ping event * fix: log incoming `session_event` * chore: upgrade client@2.0.0-beta.55 -> sign-client@2.0.0-beta.56 * chore: integrate beta.57 * New beta changes (#24) * smal lchange * fix types * Add package info * format empty methods / events * Update deps * adjust styles * attempt ios layout fix * Revert "attempt ios layout fix" This reverts commit f0176f2ef52f338980ee54e75a767b3d452733f2. * beta.54 * fix build * Update to beta 55 * Add todos * update wallet to beta 56 * Update mumbai rpc add logger * update to beta 57 * chore: adds note on beta.100 compatibility * plock * beta.58 * beta.100; Co-authored-by: Ilja <idaderko@gmail.com> Co-authored-by: Ben Kremer <ben@walletconnect.com> Co-authored-by: Ilja <IljaDaderko@users.noreply.github.com>
This commit is contained in:
parent
dc76f21c2c
commit
954831538d
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-dapp-v2",
|
||||
"version": "2.0.0-beta.26",
|
||||
"version": "2.0.0-beta.100",
|
||||
"private": true,
|
||||
"keywords": [
|
||||
"walletconnect",
|
||||
@ -30,10 +30,10 @@
|
||||
"dependencies": {
|
||||
"@ethereumjs/tx": "^3.5.0",
|
||||
"@solana/web3.js": "^1.36.0",
|
||||
"@walletconnect/client": "2.0.0-beta.26",
|
||||
"@walletconnect/legacy-modal": "2.0.0-beta.26",
|
||||
"@walletconnect/types": "2.0.0-beta.26",
|
||||
"@walletconnect/utils": "2.0.0-beta.26",
|
||||
"@walletconnect/sign-client": "2.0.0-beta.100",
|
||||
"@walletconnect/legacy-modal": "2.0.0-beta.100",
|
||||
"@walletconnect/types": "2.0.0-beta.100",
|
||||
"@walletconnect/utils": "2.0.0-beta.100",
|
||||
"axios": "^0.21.1",
|
||||
"blockies-ts": "^1.0.0",
|
||||
"bs58": "^5.0.0",
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { version } from "@walletconnect/client/package.json";
|
||||
import { version } from "@walletconnect/sign-client/package.json";
|
||||
|
||||
import Banner from "./components/Banner";
|
||||
import Blockchain from "./components/Blockchain";
|
||||
@ -80,11 +80,12 @@ export default function App() {
|
||||
throw new Error("WalletConnect is not initialized");
|
||||
}
|
||||
// Suggest existing pairings (if any).
|
||||
if (client.pairing.topics.length) {
|
||||
return openPairingModal();
|
||||
}
|
||||
if (client.pairing.values.length) {
|
||||
openPairingModal();
|
||||
} else {
|
||||
// If no existing pairings are available, trigger `WalletConnectClient.connect`.
|
||||
connect();
|
||||
}
|
||||
};
|
||||
|
||||
const onPing = async () => {
|
||||
@ -204,9 +205,7 @@ export default function App() {
|
||||
return !accounts.length && !Object.keys(balances).length ? (
|
||||
<SLanding center>
|
||||
<Banner />
|
||||
<h6>
|
||||
<span>{`Using v${version || "2.0.0-beta"}`}</span>
|
||||
</h6>
|
||||
<h6>{`Using v${version || "2.0.0-beta"}`}</h6>
|
||||
<SButtonContainer>
|
||||
<h6>Select chains:</h6>
|
||||
<SToggleContainer>
|
||||
@ -252,8 +251,6 @@ export default function App() {
|
||||
);
|
||||
};
|
||||
|
||||
console.log(accounts);
|
||||
|
||||
return (
|
||||
<SLayout>
|
||||
<Column maxWidth={1000} spanHeight>
|
||||
|
@ -50,7 +50,7 @@ const SActiveSession = styled(SActiveAccount as any)`
|
||||
interface HeaderProps {
|
||||
ping: () => Promise<void>;
|
||||
disconnect: () => Promise<void>;
|
||||
session: SessionTypes.Created | undefined;
|
||||
session: SessionTypes.Struct | undefined;
|
||||
}
|
||||
|
||||
const Header = (props: HeaderProps) => {
|
||||
|
@ -6,7 +6,7 @@ import { PairingTypes } from "@walletconnect/types";
|
||||
import Peer from "./Peer";
|
||||
|
||||
interface PairingProps {
|
||||
pairing: PairingTypes.Settled;
|
||||
pairing: PairingTypes.Struct;
|
||||
onClick?: any;
|
||||
}
|
||||
|
||||
@ -16,16 +16,14 @@ const SPairingContainer = styled.div`
|
||||
`;
|
||||
|
||||
const Pairing = (props: PairingProps) => {
|
||||
const {
|
||||
state: { metadata },
|
||||
} = props.pairing;
|
||||
const { peerMetadata } = props.pairing;
|
||||
return (
|
||||
<SPairingContainer onClick={props.onClick}>
|
||||
<div>
|
||||
{typeof metadata !== "undefined" ? (
|
||||
<Peer oneLiner metadata={metadata} />
|
||||
{typeof peerMetadata !== "undefined" ? (
|
||||
<Peer oneLiner metadata={peerMetadata} />
|
||||
) : (
|
||||
<div>{`Unknown`}</div>
|
||||
<div>{`Unknown Wallet`}</div>
|
||||
)}
|
||||
</div>
|
||||
</SPairingContainer>
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { SignClientTypes } from "@walletconnect/types";
|
||||
import * as React from "react";
|
||||
import styled from "styled-components";
|
||||
import { AppMetadata } from "@walletconnect/types";
|
||||
import { colors, fonts } from "../styles";
|
||||
|
||||
const SPeerOneLiner = styled.div`
|
||||
@ -53,7 +53,7 @@ const SName = styled(SCenter as any)`
|
||||
|
||||
interface PeerProps {
|
||||
oneLiner?: boolean;
|
||||
metadata: AppMetadata;
|
||||
metadata: SignClientTypes.Metadata;
|
||||
}
|
||||
|
||||
const Peer = (props: PeerProps) =>
|
||||
|
@ -26,24 +26,6 @@ export const DEFAULT_PROJECT_ID = process.env.REACT_APP_PROJECT_ID;
|
||||
|
||||
export const DEFAULT_RELAY_URL = process.env.REACT_APP_RELAY_URL;
|
||||
|
||||
export enum DEFAULT_EIP155_METHODS {
|
||||
ETH_SEND_TRANSACTION = "eth_sendTransaction",
|
||||
ETH_SIGN_TRANSACTION = "eth_signTransaction",
|
||||
ETH_SIGN = "eth_sign",
|
||||
PERSONAL_SIGN = "personal_sign",
|
||||
ETH_SIGN_TYPED_DATA = "eth_signTypedData",
|
||||
}
|
||||
|
||||
export enum DEFAULT_COSMOS_METHODS {
|
||||
COSMOS_SIGN_DIRECT = "cosmos_signDirect",
|
||||
COSMOS_SIGN_AMINO = "cosmos_signAmino",
|
||||
}
|
||||
|
||||
export enum DEFAULT_SOLANA_METHODS {
|
||||
SOL_SIGN_TRANSACTION = "solana_signTransaction",
|
||||
SOL_SIGN_MESSAGE = "solana_signMessage",
|
||||
}
|
||||
|
||||
export const DEFAULT_LOGGER = "debug";
|
||||
|
||||
export const DEFAULT_APP_METADATA = {
|
||||
@ -52,3 +34,39 @@ export const DEFAULT_APP_METADATA = {
|
||||
url: "https://walletconnect.com/",
|
||||
icons: ["https://avatars.githubusercontent.com/u/37784886"],
|
||||
};
|
||||
|
||||
/**
|
||||
* EIP155
|
||||
*/
|
||||
export enum DEFAULT_EIP155_METHODS {
|
||||
ETH_SEND_TRANSACTION = "eth_sendTransaction",
|
||||
ETH_SIGN_TRANSACTION = "eth_signTransaction",
|
||||
ETH_SIGN = "eth_sign",
|
||||
PERSONAL_SIGN = "personal_sign",
|
||||
ETH_SIGN_TYPED_DATA = "eth_signTypedData",
|
||||
}
|
||||
|
||||
export enum DEFAULT_EIP_155_EVENTS {
|
||||
ETH_CHAIN_CHANGED = "chainChanged",
|
||||
ETH_ACCOUNTS_CHANGED = "accountsChanged",
|
||||
}
|
||||
|
||||
/**
|
||||
* COSMOS
|
||||
*/
|
||||
export enum DEFAULT_COSMOS_METHODS {
|
||||
COSMOS_SIGN_DIRECT = "cosmos_signDirect",
|
||||
COSMOS_SIGN_AMINO = "cosmos_signAmino",
|
||||
}
|
||||
|
||||
export enum DEFAULT_COSMOS_EVENTS {}
|
||||
|
||||
/**
|
||||
* SOLANA
|
||||
*/
|
||||
export enum DEFAULT_SOLANA_METHODS {
|
||||
SOL_SIGN_TRANSACTION = "solana_signTransaction",
|
||||
SOL_SIGN_MESSAGE = "solana_signMessage",
|
||||
}
|
||||
|
||||
export enum DEFAULT_SOLANA_EVENTS {}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import Client, { CLIENT_EVENTS } from "@walletconnect/client";
|
||||
import Client from "@walletconnect/sign-client";
|
||||
import { PairingTypes, SessionTypes } from "@walletconnect/types";
|
||||
import QRCodeModal from "@walletconnect/legacy-modal";
|
||||
import {
|
||||
@ -14,28 +14,26 @@ import { PublicKey } from "@solana/web3.js";
|
||||
|
||||
import {
|
||||
DEFAULT_APP_METADATA,
|
||||
DEFAULT_COSMOS_METHODS,
|
||||
DEFAULT_EIP155_METHODS,
|
||||
DEFAULT_LOGGER,
|
||||
DEFAULT_PROJECT_ID,
|
||||
DEFAULT_RELAY_URL,
|
||||
DEFAULT_SOLANA_METHODS,
|
||||
} from "../constants";
|
||||
import { AccountBalances, apiGetAccountBalance } from "../helpers";
|
||||
import { ERROR, getAppMetadata } from "@walletconnect/utils";
|
||||
import { getPublicKeysFromAccounts } from "../helpers/solana";
|
||||
import { getRequiredNamespaces } from "../helpers/namespaces";
|
||||
|
||||
/**
|
||||
* Types
|
||||
*/
|
||||
interface IContext {
|
||||
client: Client | undefined;
|
||||
session: SessionTypes.Created | undefined;
|
||||
session: SessionTypes.Struct | undefined;
|
||||
connect: (pairing?: { topic: string }) => Promise<void>;
|
||||
disconnect: () => Promise<void>;
|
||||
isInitializing: boolean;
|
||||
chains: string[];
|
||||
pairings: string[];
|
||||
pairings: PairingTypes.Struct[];
|
||||
accounts: string[];
|
||||
solanaPublicKeys?: Record<string, PublicKey>;
|
||||
balances: AccountBalances;
|
||||
@ -53,8 +51,8 @@ export const ClientContext = createContext<IContext>({} as IContext);
|
||||
*/
|
||||
export function ClientContextProvider({ children }: { children: ReactNode | ReactNode[] }) {
|
||||
const [client, setClient] = useState<Client>();
|
||||
const [pairings, setPairings] = useState<string[]>([]);
|
||||
const [session, setSession] = useState<SessionTypes.Created>();
|
||||
const [pairings, setPairings] = useState<PairingTypes.Struct[]>([]);
|
||||
const [session, setSession] = useState<SessionTypes.Struct>();
|
||||
|
||||
const [isFetchingBalances, setIsFetchingBalances] = useState(false);
|
||||
const [isInitializing, setIsInitializing] = useState(false);
|
||||
@ -96,78 +94,53 @@ export function ClientContextProvider({ children }: { children: ReactNode | Reac
|
||||
}
|
||||
};
|
||||
|
||||
const getSupportedNamespaces = useCallback(() => {
|
||||
const supportedNamespaces: string[] = [];
|
||||
chains.forEach(chainId => {
|
||||
const [namespace] = chainId.split(":");
|
||||
if (!supportedNamespaces.includes(namespace)) {
|
||||
supportedNamespaces.push(namespace);
|
||||
}
|
||||
});
|
||||
|
||||
return supportedNamespaces;
|
||||
}, [chains]);
|
||||
|
||||
const getSupportedMethods = (namespaces: string[]) => {
|
||||
const supportedMethods: string[] = namespaces
|
||||
.map(namespace => {
|
||||
switch (namespace) {
|
||||
case "eip155":
|
||||
return Object.values(DEFAULT_EIP155_METHODS);
|
||||
case "cosmos":
|
||||
return Object.values(DEFAULT_COSMOS_METHODS);
|
||||
case "solana":
|
||||
return Object.values(DEFAULT_SOLANA_METHODS);
|
||||
default:
|
||||
throw new Error(`No default methods for namespace: ${namespace}`);
|
||||
}
|
||||
})
|
||||
const onSessionConnected = useCallback(async (_session: SessionTypes.Struct) => {
|
||||
const allNamespaceAccounts = Object.values(_session.namespaces)
|
||||
.map(namespace => namespace.accounts)
|
||||
.flat();
|
||||
const allNamespaceChains = Object.keys(_session.namespaces);
|
||||
|
||||
return supportedMethods;
|
||||
};
|
||||
|
||||
const onSessionConnected = useCallback(async (_session: SessionTypes.Settled) => {
|
||||
setSession(_session);
|
||||
setChains(_session.permissions.blockchain.chains);
|
||||
setAccounts(_session.state.accounts);
|
||||
setSolanaPublicKeys(getPublicKeysFromAccounts(_session.state.accounts));
|
||||
await getAccountBalances(_session.state.accounts);
|
||||
setChains(allNamespaceChains);
|
||||
setAccounts(allNamespaceAccounts);
|
||||
setSolanaPublicKeys(getPublicKeysFromAccounts(allNamespaceAccounts));
|
||||
await getAccountBalances(allNamespaceAccounts);
|
||||
}, []);
|
||||
|
||||
const connect = useCallback(
|
||||
async (pairing?: { topic: string }) => {
|
||||
async pairing => {
|
||||
if (typeof client === "undefined") {
|
||||
throw new Error("WalletConnect is not initialized");
|
||||
}
|
||||
console.log("connect", pairing);
|
||||
console.log("connect, pairing topic is:", pairing?.topic);
|
||||
try {
|
||||
const supportedNamespaces = getSupportedNamespaces();
|
||||
const methods = getSupportedMethods(supportedNamespaces);
|
||||
const requiredNamespaces = getRequiredNamespaces(chains);
|
||||
console.log("requiredNamespaces config for connect:", requiredNamespaces);
|
||||
|
||||
const session = await client.connect({
|
||||
metadata: getAppMetadata() || DEFAULT_APP_METADATA,
|
||||
pairing,
|
||||
permissions: {
|
||||
blockchain: {
|
||||
chains,
|
||||
},
|
||||
jsonrpc: {
|
||||
methods,
|
||||
},
|
||||
},
|
||||
const { uri, approval } = await client.connect({
|
||||
pairingTopic: pairing?.topic,
|
||||
requiredNamespaces,
|
||||
});
|
||||
|
||||
onSessionConnected(session);
|
||||
// Open QRCode modal if a URI was returned (i.e. we're not connecting an existing pairing).
|
||||
if (uri) {
|
||||
QRCodeModal.open(uri, () => {
|
||||
console.log("EVENT", "QR Code Modal closed");
|
||||
});
|
||||
}
|
||||
|
||||
const session = await approval();
|
||||
console.log("Established session:", session);
|
||||
await onSessionConnected(session);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
// ignore rejection
|
||||
}
|
||||
|
||||
} finally {
|
||||
// close modal in case it was open
|
||||
QRCodeModal.close();
|
||||
}
|
||||
},
|
||||
[chains, client, onSessionConnected, getSupportedNamespaces],
|
||||
[chains, client, onSessionConnected],
|
||||
);
|
||||
|
||||
const disconnect = useCallback(async () => {
|
||||
@ -181,6 +154,8 @@ export function ClientContextProvider({ children }: { children: ReactNode | Reac
|
||||
topic: session.topic,
|
||||
reason: ERROR.USER_DISCONNECTED.format(),
|
||||
});
|
||||
// Reset app state after disconnect.
|
||||
reset();
|
||||
}, [client, session]);
|
||||
|
||||
const _subscribeToEvents = useCallback(
|
||||
@ -189,25 +164,24 @@ export function ClientContextProvider({ children }: { children: ReactNode | Reac
|
||||
throw new Error("WalletConnect is not initialized");
|
||||
}
|
||||
|
||||
_client.on(CLIENT_EVENTS.pairing.proposal, async (proposal: PairingTypes.Proposal) => {
|
||||
const { uri } = proposal.signal.params;
|
||||
console.log("EVENT", "QR Code Modal open");
|
||||
QRCodeModal.open(uri, () => {
|
||||
console.log("EVENT", "QR Code Modal closed");
|
||||
});
|
||||
_client.on("session_ping", args => {
|
||||
console.log("EVENT", "session_ping", args);
|
||||
});
|
||||
|
||||
_client.on(CLIENT_EVENTS.pairing.created, async () => {
|
||||
setPairings(_client.pairing.topics);
|
||||
_client.on("session_event", args => {
|
||||
console.log("EVENT", "session_event", args);
|
||||
});
|
||||
|
||||
_client.on(CLIENT_EVENTS.session.updated, (updatedSession: SessionTypes.Settled) => {
|
||||
console.log("EVENT", "session_updated");
|
||||
_client.on("session_update", ({ topic, params }) => {
|
||||
console.log("EVENT", "session_update", { topic, params });
|
||||
const { namespaces } = params;
|
||||
const _session = _client.session.get(topic);
|
||||
const updatedSession = { ..._session, namespaces };
|
||||
onSessionConnected(updatedSession);
|
||||
});
|
||||
|
||||
_client.on(CLIENT_EVENTS.session.deleted, () => {
|
||||
console.log("EVENT", "session_deleted");
|
||||
_client.on("session_delete", () => {
|
||||
console.log("EVENT", "session_delete");
|
||||
reset();
|
||||
});
|
||||
},
|
||||
@ -220,12 +194,17 @@ export function ClientContextProvider({ children }: { children: ReactNode | Reac
|
||||
throw new Error("WalletConnect is not initialized");
|
||||
}
|
||||
// populates existing pairings to state
|
||||
setPairings(_client.pairing.topics);
|
||||
setPairings(_client.pairing.values);
|
||||
console.log("RESTORED PAIRINGS: ", _client.pairing.values);
|
||||
|
||||
if (typeof session !== "undefined") return;
|
||||
// populates existing session to state (assume only the top one)
|
||||
if (_client.session.topics.length) {
|
||||
const _session = await _client.session.get(_client.session.topics[0]);
|
||||
onSessionConnected(_session);
|
||||
// populates (the last) existing session to state
|
||||
if (_client.session.length) {
|
||||
const lastKeyIndex = _client.session.keys.length - 1;
|
||||
const _session = _client.session.get(_client.session.keys[lastKeyIndex]);
|
||||
console.log("RESTORED SESSION:", _session);
|
||||
await onSessionConnected(_session);
|
||||
return _session;
|
||||
}
|
||||
},
|
||||
[session, onSessionConnected],
|
||||
@ -239,8 +218,10 @@ export function ClientContextProvider({ children }: { children: ReactNode | Reac
|
||||
logger: DEFAULT_LOGGER,
|
||||
relayUrl: DEFAULT_RELAY_URL,
|
||||
projectId: DEFAULT_PROJECT_ID,
|
||||
metadata: getAppMetadata() || DEFAULT_APP_METADATA,
|
||||
});
|
||||
|
||||
console.log("CREATED CLIENT: ", _client);
|
||||
setClient(_client);
|
||||
await _subscribeToEvents(_client);
|
||||
await _checkPersistedState(_client);
|
||||
|
@ -123,7 +123,7 @@ export function JsonRpcContextProvider({ children }: { children: ReactNode | Rea
|
||||
let valid = false;
|
||||
|
||||
try {
|
||||
await client.session.ping(session.topic);
|
||||
await client.ping({ topic: session.topic });
|
||||
valid = true;
|
||||
} catch (e) {
|
||||
valid = false;
|
||||
@ -163,7 +163,7 @@ export function JsonRpcContextProvider({ children }: { children: ReactNode | Rea
|
||||
};
|
||||
}
|
||||
|
||||
const result = await client!.request({
|
||||
const result = await client!.request<string>({
|
||||
topic: session!.topic,
|
||||
chainId,
|
||||
request: {
|
||||
@ -187,7 +187,7 @@ export function JsonRpcContextProvider({ children }: { children: ReactNode | Rea
|
||||
|
||||
const tx = await formatTestTransaction(account);
|
||||
|
||||
const signedTx: string = await client!.request({
|
||||
const signedTx = await client!.request<string>({
|
||||
topic: session!.topic,
|
||||
chainId,
|
||||
request: {
|
||||
@ -217,7 +217,7 @@ export function JsonRpcContextProvider({ children }: { children: ReactNode | Rea
|
||||
const params = [hexMsg, address];
|
||||
|
||||
// send message
|
||||
const signature: string = await client!.request({
|
||||
const signature = await client!.request<string>({
|
||||
topic: session!.topic,
|
||||
chainId,
|
||||
request: {
|
||||
@ -255,7 +255,7 @@ export function JsonRpcContextProvider({ children }: { children: ReactNode | Rea
|
||||
const params = [address, hexMsg];
|
||||
|
||||
// send message
|
||||
const signature: string = await client!.request({
|
||||
const signature = await client!.request<string>({
|
||||
topic: session!.topic,
|
||||
chainId,
|
||||
request: {
|
||||
@ -290,7 +290,7 @@ export function JsonRpcContextProvider({ children }: { children: ReactNode | Rea
|
||||
const params = [address, message];
|
||||
|
||||
// send message
|
||||
const signature = await client!.request({
|
||||
const signature = await client!.request<string>({
|
||||
topic: session!.topic,
|
||||
chainId,
|
||||
request: {
|
||||
@ -357,7 +357,7 @@ export function JsonRpcContextProvider({ children }: { children: ReactNode | Rea
|
||||
};
|
||||
|
||||
// send message
|
||||
const result = await client!.request({
|
||||
const result = await client!.request<{ signature: string }>({
|
||||
topic: session!.topic,
|
||||
chainId,
|
||||
request: {
|
||||
@ -400,7 +400,7 @@ export function JsonRpcContextProvider({ children }: { children: ReactNode | Rea
|
||||
const params = { signerAddress: address, signDoc };
|
||||
|
||||
// send message
|
||||
const result = await client!.request({
|
||||
const result = await client!.request<{ signature: string }>({
|
||||
topic: session!.topic,
|
||||
chainId,
|
||||
request: {
|
||||
@ -456,7 +456,8 @@ export function JsonRpcContextProvider({ children }: { children: ReactNode | Rea
|
||||
);
|
||||
|
||||
try {
|
||||
const { signature } = await client!.request({
|
||||
const result = await client!.request<{ signature: string }>({
|
||||
chainId,
|
||||
topic: session!.topic,
|
||||
request: {
|
||||
method: DEFAULT_SOLANA_METHODS.SOL_SIGN_TRANSACTION,
|
||||
@ -478,7 +479,7 @@ export function JsonRpcContextProvider({ children }: { children: ReactNode | Rea
|
||||
|
||||
// We only need `Buffer.from` here to satisfy the `Buffer` param type for `addSignature`.
|
||||
// The resulting `UInt8Array` is equivalent to just `bs58.decode(...)`.
|
||||
transaction.addSignature(senderPublicKey, Buffer.from(bs58.decode(signature)));
|
||||
transaction.addSignature(senderPublicKey, Buffer.from(bs58.decode(result.signature)));
|
||||
|
||||
const valid = transaction.verifySignatures();
|
||||
|
||||
@ -486,7 +487,7 @@ export function JsonRpcContextProvider({ children }: { children: ReactNode | Rea
|
||||
method: DEFAULT_SOLANA_METHODS.SOL_SIGN_TRANSACTION,
|
||||
address,
|
||||
valid,
|
||||
result: signature,
|
||||
result: result.signature,
|
||||
};
|
||||
} catch (error: any) {
|
||||
throw new Error(error);
|
||||
@ -507,7 +508,8 @@ export function JsonRpcContextProvider({ children }: { children: ReactNode | Rea
|
||||
);
|
||||
|
||||
try {
|
||||
const { signature } = await client!.request({
|
||||
const result = await client!.request<{ signature: string }>({
|
||||
chainId,
|
||||
topic: session!.topic,
|
||||
request: {
|
||||
method: DEFAULT_SOLANA_METHODS.SOL_SIGN_MESSAGE,
|
||||
@ -518,13 +520,17 @@ export function JsonRpcContextProvider({ children }: { children: ReactNode | Rea
|
||||
},
|
||||
});
|
||||
|
||||
const valid = verifyMessageSignature(senderPublicKey.toBase58(), signature, message);
|
||||
const valid = verifyMessageSignature(
|
||||
senderPublicKey.toBase58(),
|
||||
result.signature,
|
||||
message,
|
||||
);
|
||||
|
||||
return {
|
||||
method: DEFAULT_SOLANA_METHODS.SOL_SIGN_MESSAGE,
|
||||
address,
|
||||
valid,
|
||||
result: signature,
|
||||
result: result.signature,
|
||||
};
|
||||
} catch (error: any) {
|
||||
throw new Error(error);
|
||||
|
63
dapps/react-dapp-v2/src/helpers/namespaces.ts
Normal file
63
dapps/react-dapp-v2/src/helpers/namespaces.ts
Normal file
@ -0,0 +1,63 @@
|
||||
import { ProposalTypes } from "@walletconnect/types";
|
||||
import {
|
||||
DEFAULT_COSMOS_EVENTS,
|
||||
DEFAULT_COSMOS_METHODS,
|
||||
DEFAULT_EIP155_METHODS,
|
||||
DEFAULT_EIP_155_EVENTS,
|
||||
DEFAULT_SOLANA_EVENTS,
|
||||
DEFAULT_SOLANA_METHODS,
|
||||
} from "../constants";
|
||||
|
||||
export const getNamespacesFromChains = (chains: string[]) => {
|
||||
const supportedNamespaces: string[] = [];
|
||||
chains.forEach(chainId => {
|
||||
const [namespace] = chainId.split(":");
|
||||
if (!supportedNamespaces.includes(namespace)) {
|
||||
supportedNamespaces.push(namespace);
|
||||
}
|
||||
});
|
||||
|
||||
return supportedNamespaces;
|
||||
};
|
||||
|
||||
export const getSupportedMethodsByNamespace = (namespace: string) => {
|
||||
switch (namespace) {
|
||||
case "eip155":
|
||||
return Object.values(DEFAULT_EIP155_METHODS);
|
||||
case "cosmos":
|
||||
return Object.values(DEFAULT_COSMOS_METHODS);
|
||||
case "solana":
|
||||
return Object.values(DEFAULT_SOLANA_METHODS);
|
||||
default:
|
||||
throw new Error(`No default methods for namespace: ${namespace}`);
|
||||
}
|
||||
};
|
||||
|
||||
export const getSupportedEventsByNamespace = (namespace: string) => {
|
||||
switch (namespace) {
|
||||
case "eip155":
|
||||
return Object.values(DEFAULT_EIP_155_EVENTS);
|
||||
case "cosmos":
|
||||
return Object.values(DEFAULT_COSMOS_EVENTS);
|
||||
case "solana":
|
||||
return Object.values(DEFAULT_SOLANA_EVENTS);
|
||||
default:
|
||||
throw new Error(`No default events for namespace: ${namespace}`);
|
||||
}
|
||||
};
|
||||
|
||||
export const getRequiredNamespaces = (chains: string[]): ProposalTypes.RequiredNamespaces => {
|
||||
const selectedNamespaces = getNamespacesFromChains(chains);
|
||||
console.log("selected namespaces:", selectedNamespaces);
|
||||
|
||||
return Object.fromEntries(
|
||||
selectedNamespaces.map(namespace => [
|
||||
namespace,
|
||||
{
|
||||
methods: getSupportedMethodsByNamespace(namespace),
|
||||
chains: chains.filter(chain => chain.startsWith(namespace)),
|
||||
events: getSupportedEventsByNamespace(namespace) as any[],
|
||||
},
|
||||
]),
|
||||
);
|
||||
};
|
@ -9,7 +9,7 @@ import { STable } from "../components/shared";
|
||||
import { SModalContainer, SModalTitle } from "./shared";
|
||||
|
||||
interface PairingModalProps {
|
||||
pairings: PairingTypes.Settled[];
|
||||
pairings: PairingTypes.Struct[];
|
||||
connect: (pairing?: { topic: string }) => Promise<void>;
|
||||
}
|
||||
|
||||
|
@ -1996,6 +1996,11 @@
|
||||
superstruct "^0.14.2"
|
||||
tweetnacl "^1.0.0"
|
||||
|
||||
"@stablelib/aead@^1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@stablelib/aead/-/aead-1.0.1.tgz#c4b1106df9c23d1b867eb9b276d8f42d5fc4c0c3"
|
||||
integrity sha512-q39ik6sxGHewqtO0nP4BuSe3db5G1fEJE8ukvngS2gLkBXyy6E7pLubhbYgnkDFv6V8cWaxcE4Xn0t6LWcJkyg==
|
||||
|
||||
"@stablelib/binary@^1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@stablelib/binary/-/binary-1.0.1.tgz#c5900b94368baf00f811da5bdb1610963dfddf7f"
|
||||
@ -2008,6 +2013,54 @@
|
||||
resolved "https://registry.yarnpkg.com/@stablelib/bytes/-/bytes-1.0.1.tgz#0f4aa7b03df3080b878c7dea927d01f42d6a20d8"
|
||||
integrity sha512-Kre4Y4kdwuqL8BR2E9hV/R5sOrUj6NanZaZis0V6lX5yzqC3hBuVSDXUIBqQv/sCpmuWRiHLwqiT1pqqjuBXoQ==
|
||||
|
||||
"@stablelib/chacha20poly1305@^1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@stablelib/chacha20poly1305/-/chacha20poly1305-1.0.1.tgz#de6b18e283a9cb9b7530d8767f99cde1fec4c2ee"
|
||||
integrity sha512-MmViqnqHd1ymwjOQfghRKw2R/jMIGT3wySN7cthjXCBdO+qErNPUBnRzqNpnvIwg7JBCg3LdeCZZO4de/yEhVA==
|
||||
dependencies:
|
||||
"@stablelib/aead" "^1.0.1"
|
||||
"@stablelib/binary" "^1.0.1"
|
||||
"@stablelib/chacha" "^1.0.1"
|
||||
"@stablelib/constant-time" "^1.0.1"
|
||||
"@stablelib/poly1305" "^1.0.1"
|
||||
"@stablelib/wipe" "^1.0.1"
|
||||
|
||||
"@stablelib/chacha@^1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@stablelib/chacha/-/chacha-1.0.1.tgz#deccfac95083e30600c3f92803a3a1a4fa761371"
|
||||
integrity sha512-Pmlrswzr0pBzDofdFuVe1q7KdsHKhhU24e8gkEwnTGOmlC7PADzLVxGdn2PoNVBBabdg0l/IfLKg6sHAbTQugg==
|
||||
dependencies:
|
||||
"@stablelib/binary" "^1.0.1"
|
||||
"@stablelib/wipe" "^1.0.1"
|
||||
|
||||
"@stablelib/constant-time@^1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@stablelib/constant-time/-/constant-time-1.0.1.tgz#bde361465e1cf7b9753061b77e376b0ca4c77e35"
|
||||
integrity sha512-tNOs3uD0vSJcK6z1fvef4Y+buN7DXhzHDPqRLSXUel1UfqMB1PWNsnnAezrKfEwTLpN0cGH2p9NNjs6IqeD0eg==
|
||||
|
||||
"@stablelib/hash@^1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@stablelib/hash/-/hash-1.0.1.tgz#3c944403ff2239fad8ebb9015e33e98444058bc5"
|
||||
integrity sha512-eTPJc/stDkdtOcrNMZ6mcMK1e6yBbqRBaNW55XA1jU8w/7QdnCF0CmMmOD1m7VSkBR44PWrMHU2l6r8YEQHMgg==
|
||||
|
||||
"@stablelib/hkdf@^1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@stablelib/hkdf/-/hkdf-1.0.1.tgz#b4efd47fd56fb43c6a13e8775a54b354f028d98d"
|
||||
integrity sha512-SBEHYE16ZXlHuaW5RcGk533YlBj4grMeg5TooN80W3NpcHRtLZLLXvKyX0qcRFxf+BGDobJLnwkvgEwHIDBR6g==
|
||||
dependencies:
|
||||
"@stablelib/hash" "^1.0.1"
|
||||
"@stablelib/hmac" "^1.0.1"
|
||||
"@stablelib/wipe" "^1.0.1"
|
||||
|
||||
"@stablelib/hmac@^1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@stablelib/hmac/-/hmac-1.0.1.tgz#3d4c1b8cf194cb05d28155f0eed8a299620a07ec"
|
||||
integrity sha512-V2APD9NSnhVpV/QMYgCVMIYKiYG6LSqw1S65wxVoirhU/51ACio6D4yDVSwMzuTJXWZoVHbDdINioBwKy5kVmA==
|
||||
dependencies:
|
||||
"@stablelib/constant-time" "^1.0.1"
|
||||
"@stablelib/hash" "^1.0.1"
|
||||
"@stablelib/wipe" "^1.0.1"
|
||||
|
||||
"@stablelib/int@^1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@stablelib/int/-/int-1.0.1.tgz#75928cc25d59d73d75ae361f02128588c15fd008"
|
||||
@ -2020,6 +2073,14 @@
|
||||
dependencies:
|
||||
"@stablelib/bytes" "^1.0.1"
|
||||
|
||||
"@stablelib/poly1305@^1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@stablelib/poly1305/-/poly1305-1.0.1.tgz#93bfb836c9384685d33d70080718deae4ddef1dc"
|
||||
integrity sha512-1HlG3oTSuQDOhSnLwJRKeTRSAdFNVB/1djy2ZbS35rBSJ/PFqx9cf9qatinWghC2UbfOYD8AcrtbUQl8WoxabA==
|
||||
dependencies:
|
||||
"@stablelib/constant-time" "^1.0.1"
|
||||
"@stablelib/wipe" "^1.0.1"
|
||||
|
||||
"@stablelib/random@^1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@stablelib/random/-/random-1.0.1.tgz#4357a00cb1249d484a9a71e6054bc7b8324a7009"
|
||||
@ -2028,6 +2089,15 @@
|
||||
"@stablelib/binary" "^1.0.1"
|
||||
"@stablelib/wipe" "^1.0.1"
|
||||
|
||||
"@stablelib/sha256@^1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@stablelib/sha256/-/sha256-1.0.1.tgz#77b6675b67f9b0ea081d2e31bda4866297a3ae4f"
|
||||
integrity sha512-GIIH3e6KH+91FqGV42Kcj71Uefd/QEe7Dy42sBTeqppXV95ggCcxLTk39bEr+lZfJmp+ghsR07J++ORkRELsBQ==
|
||||
dependencies:
|
||||
"@stablelib/binary" "^1.0.1"
|
||||
"@stablelib/hash" "^1.0.1"
|
||||
"@stablelib/wipe" "^1.0.1"
|
||||
|
||||
"@stablelib/wipe@^1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@stablelib/wipe/-/wipe-1.0.1.tgz#d21401f1d59ade56a62e139462a97f104ed19a36"
|
||||
@ -2671,10 +2741,10 @@
|
||||
"@typescript-eslint/types" "4.33.0"
|
||||
eslint-visitor-keys "^2.0.0"
|
||||
|
||||
"@walletconnect/client@2.0.0-beta.26":
|
||||
version "2.0.0-beta.26"
|
||||
resolved "https://registry.yarnpkg.com/@walletconnect/client/-/client-2.0.0-beta.26.tgz#c3f617c6f726e99e39b1d92857f06e0a477742de"
|
||||
integrity sha512-BQNLS+kQyxOEIECwHN0sW+iF0CGWLECorSwmPGnadv/7kX3xGIEzv6mBOjBJisyIoea50RfADmKZNa//H1khxw==
|
||||
"@walletconnect/core@^2.0.0-beta.100":
|
||||
version "2.0.0-beta.100"
|
||||
resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-2.0.0-beta.100.tgz#7bbefb9b105a4d1c4ec9c7ff6cdc8ba016594924"
|
||||
integrity sha512-Hw66ixUTMfo/rguI8PGTWB8HNP3d+JRD1gU8MFjdogDk0rFQv52jJ5rakfYJTuzz2NdVNkPBOwilq02m3bmk3Q==
|
||||
dependencies:
|
||||
"@walletconnect/encoding" "^1.0.1"
|
||||
"@walletconnect/events" "^1.0.0"
|
||||
@ -2682,34 +2752,15 @@
|
||||
"@walletconnect/jsonrpc-provider" "^1.0.3"
|
||||
"@walletconnect/jsonrpc-utils" "^1.0.0"
|
||||
"@walletconnect/jsonrpc-ws-connection" "^1.0.0"
|
||||
"@walletconnect/keyvaluestorage" "^1.0.0"
|
||||
"@walletconnect/logger" "^1.0.0"
|
||||
"@walletconnect/relay-api" "^1.0.2"
|
||||
"@walletconnect/safe-json" "^1.0.0"
|
||||
"@walletconnect/time" "^1.0.1"
|
||||
"@walletconnect/types" "^2.0.0-beta.26"
|
||||
"@walletconnect/utils" "^2.0.0-beta.26"
|
||||
"@walletconnect/types" "^2.0.0-beta.100"
|
||||
"@walletconnect/utils" "^2.0.0-beta.100"
|
||||
ws "^8.3.0"
|
||||
|
||||
"@walletconnect/crypto@^1.0.2":
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@walletconnect/crypto/-/crypto-1.0.2.tgz#3fcc2b2cde6f529a19eadd883dc555cd0e861992"
|
||||
integrity sha512-+OlNtwieUqVcOpFTvLBvH+9J9pntEqH5evpINHfVxff1XIgwV55PpbdvkHu6r9Ib4WQDOFiD8OeeXs1vHw7xKQ==
|
||||
dependencies:
|
||||
"@walletconnect/encoding" "^1.0.1"
|
||||
"@walletconnect/environment" "^1.0.0"
|
||||
"@walletconnect/randombytes" "^1.0.2"
|
||||
aes-js "^3.1.2"
|
||||
hash.js "^1.1.7"
|
||||
|
||||
"@walletconnect/ecies-25519@^1.0.2":
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@walletconnect/ecies-25519/-/ecies-25519-1.0.2.tgz#c248e2e1423328edb4a4a668c5bef19350533b7c"
|
||||
integrity sha512-H5elgLjBPhsKXozo7M87Gg/FLTh/YdhCGYPuuodEreLZ0Lvow3fkiNRucqHmmllU3vJhIjUxMcbtvzseky1hSA==
|
||||
dependencies:
|
||||
"@stablelib/x25519" "^1.0.2"
|
||||
"@walletconnect/crypto" "^1.0.2"
|
||||
"@walletconnect/encoding" "^1.0.1"
|
||||
|
||||
"@walletconnect/encoding@^1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@walletconnect/encoding/-/encoding-1.0.1.tgz#93c18ce9478c3d5283dbb88c41eb2864b575269a"
|
||||
@ -2770,32 +2821,40 @@
|
||||
"@walletconnect/safe-json" "^1.0.0"
|
||||
ws "^7.5.1"
|
||||
|
||||
"@walletconnect/legacy-modal@2.0.0-beta.26":
|
||||
version "2.0.0-beta.26"
|
||||
resolved "https://registry.yarnpkg.com/@walletconnect/legacy-modal/-/legacy-modal-2.0.0-beta.26.tgz#2a20f51b87d40e77f6f1263f897b35f5ed95438e"
|
||||
integrity sha512-MTLLAv7roOtk8OM1B3X1EHXgVMFps9ryK1gcBV2RbVmUjuO4EPojJMnBDdMCegIovisqXuWDy0hM+MTGFHmDDA==
|
||||
"@walletconnect/keyvaluestorage@^1.0.0":
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@walletconnect/keyvaluestorage/-/keyvaluestorage-1.0.0.tgz#2733fc32c868f534419308f90b079fba0ef7d66e"
|
||||
integrity sha512-dlIrX/pCjuXMUprkLdy0hw0Ibr3To9nCdG19mPqd/lRdRWsPItBL+79LClVplMxb0cuF3qlTuGTNx/hmUKYmWA==
|
||||
dependencies:
|
||||
"@walletconnect/legacy-types" "^2.0.0-beta.26"
|
||||
"@walletconnect/legacy-utils" "^2.0.0-beta.26"
|
||||
localStorage "^1.0.4"
|
||||
safe-json-utils "^1.1.1"
|
||||
|
||||
"@walletconnect/legacy-modal@2.0.0-beta.100":
|
||||
version "2.0.0-beta.100"
|
||||
resolved "https://registry.yarnpkg.com/@walletconnect/legacy-modal/-/legacy-modal-2.0.0-beta.100.tgz#3c04f91ebb17d3340d6dda74c925c64560ae0e17"
|
||||
integrity sha512-NNTiNqeBeG1A0VG8nXXszBuz0tLGdM2xfAZorYdRAyQe/fmzUiO7X2ymIvLFaEFoMX7bB7jujIHiEAQm57bSJw==
|
||||
dependencies:
|
||||
"@walletconnect/legacy-types" "^2.0.0-beta.100"
|
||||
"@walletconnect/legacy-utils" "^2.0.0-beta.100"
|
||||
copy-to-clipboard "^3.3.1"
|
||||
preact "10.4.1"
|
||||
qrcode "1.4.4"
|
||||
|
||||
"@walletconnect/legacy-types@^2.0.0-beta.26":
|
||||
version "2.0.0-beta.26"
|
||||
resolved "https://registry.yarnpkg.com/@walletconnect/legacy-types/-/legacy-types-2.0.0-beta.26.tgz#cf4249ea28d586d44dfc93a77b861c95a86794dc"
|
||||
integrity sha512-5sZFx/V0639gb/HlHUS+FhvOKbEMPNlVoQtquwNPJIzcuhzmdv7zJEmz911VwBlQyZXfWbgoKNM6yu+ryrlFKg==
|
||||
"@walletconnect/legacy-types@^2.0.0-beta.100":
|
||||
version "2.0.0-beta.100"
|
||||
resolved "https://registry.yarnpkg.com/@walletconnect/legacy-types/-/legacy-types-2.0.0-beta.100.tgz#dbe78289d5cdfff79471f4072fcd5a85b970b85b"
|
||||
integrity sha512-+kkDcNQIXJHbu1h2sE4OjA8UFTvmh5Wvc9E4mk+8c9XpHF3xTWneydInoRKTGe1QcMGB7B1w0UDAyfBi7fervA==
|
||||
dependencies:
|
||||
"@walletconnect/jsonrpc-types" "^1.0.0"
|
||||
|
||||
"@walletconnect/legacy-utils@^2.0.0-beta.26":
|
||||
version "2.0.0-beta.26"
|
||||
resolved "https://registry.yarnpkg.com/@walletconnect/legacy-utils/-/legacy-utils-2.0.0-beta.26.tgz#ca25633ab5e4af36e477160c83384a7c9dcf0e22"
|
||||
integrity sha512-5cH80VWPuo6D2LXUktN2orxygZO0bA7Bdv4wwB5WkXmiamGIhkGtsGZ10bkOM8cwftfVq4bb93i3WgBvGmVzAA==
|
||||
"@walletconnect/legacy-utils@^2.0.0-beta.100":
|
||||
version "2.0.0-beta.100"
|
||||
resolved "https://registry.yarnpkg.com/@walletconnect/legacy-utils/-/legacy-utils-2.0.0-beta.100.tgz#b014975092f8fa03738ec01d8f8a7a549ec450df"
|
||||
integrity sha512-Cm/Jo300TgAXicRsQ+AaB8pmRiNtwbvc7wCZalmXi8HWle2hzDuFTobM/4VGbEJh0zIiZRWK1azZgWQTl/Dt8g==
|
||||
dependencies:
|
||||
"@walletconnect/encoding" "^1.0.1"
|
||||
"@walletconnect/jsonrpc-utils" "^1.0.0"
|
||||
"@walletconnect/legacy-types" "^2.0.0-beta.26"
|
||||
"@walletconnect/legacy-types" "^2.0.0-beta.100"
|
||||
"@walletconnect/safe-json" "^1.0.0"
|
||||
"@walletconnect/window-getters" "^1.0.0"
|
||||
"@walletconnect/window-metadata" "^1.0.0"
|
||||
@ -2809,15 +2868,6 @@
|
||||
dependencies:
|
||||
pino "^6.7.0"
|
||||
|
||||
"@walletconnect/randombytes@^1.0.2":
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@walletconnect/randombytes/-/randombytes-1.0.2.tgz#95c644251a15e6675f58fbffc9513a01486da49c"
|
||||
integrity sha512-ivgOtAyqQnN0rLQmOFPemsgYGysd/ooLfaDA/ACQ3cyqlca56t3rZc7pXfqJOIETx/wSyoF5XbwL+BqYodw27A==
|
||||
dependencies:
|
||||
"@walletconnect/encoding" "^1.0.1"
|
||||
"@walletconnect/environment" "^1.0.0"
|
||||
randombytes "^2.1.0"
|
||||
|
||||
"@walletconnect/relay-api@^1.0.2":
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@walletconnect/relay-api/-/relay-api-1.0.2.tgz#a6d93c5292c2f9f9424f86de09854e4f0bd2fbae"
|
||||
@ -2830,40 +2880,65 @@
|
||||
resolved "https://registry.yarnpkg.com/@walletconnect/safe-json/-/safe-json-1.0.0.tgz#12eeb11d43795199c045fafde97e3c91646683b2"
|
||||
integrity sha512-QJzp/S/86sUAgWY6eh5MKYmSfZaRpIlmCJdi5uG4DJlKkZrHEF7ye7gA+VtbVzvTtpM/gRwO2plQuiooIeXjfg==
|
||||
|
||||
"@walletconnect/sign-client@2.0.0-beta.100":
|
||||
version "2.0.0-beta.100"
|
||||
resolved "https://registry.yarnpkg.com/@walletconnect/sign-client/-/sign-client-2.0.0-beta.100.tgz#9e753f3b5d19ad08d9e184de6b13c8b9551ae3a6"
|
||||
integrity sha512-aBZZ5GHZPSDkfcOqyeVRAuwGElynhWgHoOzDkw44G5O/z23DYBYcVf1Ez4Jkag9K7/arvPLmTT6/hYGAL9mp0A==
|
||||
dependencies:
|
||||
"@walletconnect/core" "^2.0.0-beta.100"
|
||||
"@walletconnect/encoding" "^1.0.1"
|
||||
"@walletconnect/events" "^1.0.0"
|
||||
"@walletconnect/heartbeat" "^1.0.0"
|
||||
"@walletconnect/jsonrpc-provider" "^1.0.3"
|
||||
"@walletconnect/jsonrpc-utils" "^1.0.0"
|
||||
"@walletconnect/jsonrpc-ws-connection" "^1.0.0"
|
||||
"@walletconnect/keyvaluestorage" "^1.0.0"
|
||||
"@walletconnect/logger" "^1.0.0"
|
||||
"@walletconnect/relay-api" "^1.0.2"
|
||||
"@walletconnect/safe-json" "^1.0.0"
|
||||
"@walletconnect/time" "^1.0.1"
|
||||
"@walletconnect/types" "^2.0.0-beta.100"
|
||||
"@walletconnect/utils" "^2.0.0-beta.100"
|
||||
ws "^8.3.0"
|
||||
|
||||
"@walletconnect/time@^1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@walletconnect/time/-/time-1.0.1.tgz#645f596887e67c56522edbc2b170d46a97c87ce0"
|
||||
integrity sha512-LtNtHupTNranehLMh8Z/JN6xVySysSoJNjNCQ0ML+hOUkim5QX/VdvfovSpaX9qA2b95u7bIuTcq0O3UBk7Iyw==
|
||||
|
||||
"@walletconnect/types@2.0.0-beta.26", "@walletconnect/types@^2.0.0-beta.26":
|
||||
version "2.0.0-beta.26"
|
||||
resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-2.0.0-beta.26.tgz#500599a893303556f48e6f17daf4c3362495495d"
|
||||
integrity sha512-wVtgEEgBLxrmKhaZ1UqHVQgKuZiYdPF4vo910RqrSOZbbPRNBtrHY37JvhQdZKe2Ake1r1x66tPyOR+WaMp1Zg==
|
||||
"@walletconnect/types@2.0.0-beta.100", "@walletconnect/types@^2.0.0-beta.100":
|
||||
version "2.0.0-beta.100"
|
||||
resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-2.0.0-beta.100.tgz#880964fccad1bd45555d6066e57c6336a10ca5b3"
|
||||
integrity sha512-AIfofrA7BTGlYb3FAq2fNd7H8KE/7XOnAUZcKOhT5xqxd4hqlrdv5yPImBxrTB5j7pxFwUXh4m1iXXmhmwKkAg==
|
||||
dependencies:
|
||||
"@walletconnect/events" "^1.0.0"
|
||||
"@walletconnect/heartbeat" "^1.0.0"
|
||||
"@walletconnect/jsonrpc-types" "^1.0.0"
|
||||
keyvaluestorage "^0.7.1"
|
||||
"@walletconnect/keyvaluestorage" "^1.0.0"
|
||||
pino "^6.7.0"
|
||||
pino-pretty "^4.3.0"
|
||||
|
||||
"@walletconnect/utils@2.0.0-beta.26", "@walletconnect/utils@^2.0.0-beta.26":
|
||||
version "2.0.0-beta.26"
|
||||
resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.0.0-beta.26.tgz#228c1f068ca42630f01bbd3c013dcfc42677cc9a"
|
||||
integrity sha512-RjADvX6d8K3eqLcxFIiQDFV9ajiI7kQX4+iVV63uf5rlC+HnIX+jwIYJWlD+eR6JPmfIIskoG5/m0RqK/iphjA==
|
||||
"@walletconnect/utils@2.0.0-beta.100", "@walletconnect/utils@^2.0.0-beta.100":
|
||||
version "2.0.0-beta.100"
|
||||
resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.0.0-beta.100.tgz#04ae80d7bdab5977ed4395d7ef44a7a169af9a72"
|
||||
integrity sha512-FWE2Zb/N3vbjUpm+E6hs7XcISLx+l2V4lmkbxOropfI7K9Y8+EoAlm4IdEdL8vUxYwNt/xh1vy5NNkaBCJl6xg==
|
||||
dependencies:
|
||||
"@walletconnect/ecies-25519" "^1.0.2"
|
||||
"@walletconnect/encoding" "^1.0.1"
|
||||
"@stablelib/chacha20poly1305" "^1.0.1"
|
||||
"@stablelib/hkdf" "^1.0.1"
|
||||
"@stablelib/random" "^1.0.1"
|
||||
"@stablelib/sha256" "^1.0.1"
|
||||
"@stablelib/x25519" "^1.0.2"
|
||||
"@walletconnect/jsonrpc-utils" "^1.0.0"
|
||||
"@walletconnect/logger" "^1.0.0"
|
||||
"@walletconnect/relay-api" "^1.0.2"
|
||||
"@walletconnect/safe-json" "^1.0.0"
|
||||
"@walletconnect/time" "^1.0.1"
|
||||
"@walletconnect/types" "^2.0.0-beta.26"
|
||||
"@walletconnect/types" "^2.0.0-beta.100"
|
||||
"@walletconnect/window-getters" "^1.0.0"
|
||||
"@walletconnect/window-metadata" "^1.0.0"
|
||||
lodash.union "^4.6.0"
|
||||
lodash.isequal "4.5.0"
|
||||
query-string "^6.13.5"
|
||||
uint8arrays "^3.0.0"
|
||||
|
||||
"@walletconnect/window-getters@^1.0.0":
|
||||
version "1.0.0"
|
||||
@ -3104,11 +3179,6 @@ aes-js@3.0.0:
|
||||
resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d"
|
||||
integrity sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0=
|
||||
|
||||
aes-js@^3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.1.2.tgz#db9aabde85d5caabbfc0d4f2a4446960f627146a"
|
||||
integrity sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==
|
||||
|
||||
agent-base@6:
|
||||
version "6.0.2"
|
||||
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77"
|
||||
@ -3231,19 +3301,11 @@ anymatch@^3.0.0, anymatch@^3.0.3, anymatch@~3.1.2:
|
||||
normalize-path "^3.0.0"
|
||||
picomatch "^2.0.4"
|
||||
|
||||
aproba@^1.0.3, aproba@^1.1.1:
|
||||
aproba@^1.1.1:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a"
|
||||
integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==
|
||||
|
||||
are-we-there-yet@~1.1.2:
|
||||
version "1.1.7"
|
||||
resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz#b15474a932adab4ff8a50d9adfa7e4e926f21146"
|
||||
integrity sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==
|
||||
dependencies:
|
||||
delegates "^1.0.0"
|
||||
readable-stream "^2.0.6"
|
||||
|
||||
argparse@^1.0.7:
|
||||
version "1.0.10"
|
||||
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
|
||||
@ -3714,14 +3776,6 @@ bech32@1.1.4, bech32@^1.1.4:
|
||||
resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9"
|
||||
integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==
|
||||
|
||||
better-sqlite3@^7.1.2:
|
||||
version "7.5.0"
|
||||
resolved "https://registry.yarnpkg.com/better-sqlite3/-/better-sqlite3-7.5.0.tgz#2a91cb616453f002096743b0e5b66a7021cd1c63"
|
||||
integrity sha512-6FdG9DoytYGDhLW7VWW1vxjEz7xHkqK6LnaUQYA8d6GHNgZhu9PFX2xwKEEnSBRoT1J4PjTUPeg217ShxNmuPg==
|
||||
dependencies:
|
||||
bindings "^1.5.0"
|
||||
prebuild-install "^7.0.0"
|
||||
|
||||
bfj@^7.0.2:
|
||||
version "7.0.2"
|
||||
resolved "https://registry.yarnpkg.com/bfj/-/bfj-7.0.2.tgz#1988ce76f3add9ac2913fd8ba47aad9e651bfbb2"
|
||||
@ -3764,15 +3818,6 @@ bip39@^3.0.2:
|
||||
pbkdf2 "^3.0.9"
|
||||
randombytes "^2.0.1"
|
||||
|
||||
bl@^4.0.3:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a"
|
||||
integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==
|
||||
dependencies:
|
||||
buffer "^5.5.0"
|
||||
inherits "^2.0.4"
|
||||
readable-stream "^3.4.0"
|
||||
|
||||
blakejs@^1.1.0:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.1.tgz#bf313053978b2cd4c444a48795710be05c785702"
|
||||
@ -4044,7 +4089,7 @@ buffer@^4.3.0:
|
||||
ieee754 "^1.1.4"
|
||||
isarray "^1.0.0"
|
||||
|
||||
buffer@^5.4.3, buffer@^5.5.0:
|
||||
buffer@^5.4.3:
|
||||
version "5.7.1"
|
||||
resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0"
|
||||
integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==
|
||||
@ -4414,11 +4459,6 @@ coa@^2.0.2:
|
||||
chalk "^2.4.1"
|
||||
q "^1.1.2"
|
||||
|
||||
code-point-at@^1.0.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
|
||||
integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=
|
||||
|
||||
collect-v8-coverage@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59"
|
||||
@ -4561,11 +4601,6 @@ console-browserify@^1.1.0:
|
||||
resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336"
|
||||
integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==
|
||||
|
||||
console-control-strings@^1.0.0, console-control-strings@~1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e"
|
||||
integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=
|
||||
|
||||
constants-browserify@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75"
|
||||
@ -5104,13 +5139,6 @@ decode-uri-component@^0.2.0:
|
||||
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
|
||||
integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=
|
||||
|
||||
decompress-response@^6.0.0:
|
||||
version "6.0.0"
|
||||
resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc"
|
||||
integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==
|
||||
dependencies:
|
||||
mimic-response "^3.1.0"
|
||||
|
||||
dedent@^0.7.0:
|
||||
version "0.7.0"
|
||||
resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c"
|
||||
@ -5128,11 +5156,6 @@ deep-equal@^1.0.1:
|
||||
object-keys "^1.1.1"
|
||||
regexp.prototype.flags "^1.2.0"
|
||||
|
||||
deep-extend@^0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac"
|
||||
integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==
|
||||
|
||||
deep-is@^0.1.3, deep-is@~0.1.3:
|
||||
version "0.1.4"
|
||||
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831"
|
||||
@ -5203,11 +5226,6 @@ delayed-stream@~1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
|
||||
integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk=
|
||||
|
||||
delegates@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
|
||||
integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=
|
||||
|
||||
depd@~1.1.2:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9"
|
||||
@ -5231,11 +5249,6 @@ detect-browser@^5.2.1:
|
||||
resolved "https://registry.yarnpkg.com/detect-browser/-/detect-browser-5.3.0.tgz#9705ef2bddf46072d0f7265a1fe300e36fe7ceca"
|
||||
integrity sha512-53rsFbGdwMwlF7qvCt0ypLM5V5/Mbl0szB7GPN8y9NCcbknYOeVVXdrXEq+90IwAfrrzt6Hd+u2E2ntakICU8w==
|
||||
|
||||
detect-libc@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.0.tgz#c528bc09bc6d1aa30149228240917c225448f204"
|
||||
integrity sha512-S55LzUl8HUav8l9E2PBTlC5PAJrHK7tkM+XXFGD+fbsbkTzhCpG6K05LxJcUOEWzMa4v6ptcMZ9s3fOdJDu0Zw==
|
||||
|
||||
detect-newline@^3.0.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651"
|
||||
@ -6130,11 +6143,6 @@ expand-brackets@^2.1.4:
|
||||
snapdragon "^0.8.1"
|
||||
to-regex "^3.0.1"
|
||||
|
||||
expand-template@^2.0.3:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c"
|
||||
integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==
|
||||
|
||||
expect@^26.6.0, expect@^26.6.2:
|
||||
version "26.6.2"
|
||||
resolved "https://registry.yarnpkg.com/expect/-/expect-26.6.2.tgz#c6b996bf26bf3fe18b67b2d0f51fc981ba934417"
|
||||
@ -6474,11 +6482,6 @@ from2@^2.1.0:
|
||||
inherits "^2.0.1"
|
||||
readable-stream "^2.0.0"
|
||||
|
||||
fs-constants@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad"
|
||||
integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==
|
||||
|
||||
fs-extra@^7.0.0:
|
||||
version "7.0.1"
|
||||
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9"
|
||||
@ -6552,20 +6555,6 @@ functional-red-black-tree@^1.0.1:
|
||||
resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327"
|
||||
integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=
|
||||
|
||||
gauge@~2.7.3:
|
||||
version "2.7.4"
|
||||
resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7"
|
||||
integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=
|
||||
dependencies:
|
||||
aproba "^1.0.3"
|
||||
console-control-strings "^1.0.0"
|
||||
has-unicode "^2.0.0"
|
||||
object-assign "^4.1.0"
|
||||
signal-exit "^3.0.0"
|
||||
string-width "^1.0.1"
|
||||
strip-ansi "^3.0.1"
|
||||
wide-align "^1.1.0"
|
||||
|
||||
gensync@^1.0.0-beta.1, gensync@^1.0.0-beta.2:
|
||||
version "1.0.0-beta.2"
|
||||
resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0"
|
||||
@ -6622,11 +6611,6 @@ get-value@^2.0.3, get-value@^2.0.6:
|
||||
resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28"
|
||||
integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=
|
||||
|
||||
github-from-package@0.0.0:
|
||||
version "0.0.0"
|
||||
resolved "https://registry.yarnpkg.com/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce"
|
||||
integrity sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=
|
||||
|
||||
glob-parent@^3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae"
|
||||
@ -6772,11 +6756,6 @@ has-tostringtag@^1.0.0:
|
||||
dependencies:
|
||||
has-symbols "^1.0.2"
|
||||
|
||||
has-unicode@^2.0.0:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9"
|
||||
integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=
|
||||
|
||||
has-value@^0.3.1:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f"
|
||||
@ -7155,7 +7134,7 @@ inherits@2.0.3:
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
|
||||
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
|
||||
|
||||
ini@^1.3.5, ini@~1.3.0:
|
||||
ini@^1.3.5:
|
||||
version "1.3.8"
|
||||
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c"
|
||||
integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==
|
||||
@ -7365,13 +7344,6 @@ is-extglob@^2.1.0, is-extglob@^2.1.1:
|
||||
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
|
||||
integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=
|
||||
|
||||
is-fullwidth-code-point@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb"
|
||||
integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs=
|
||||
dependencies:
|
||||
number-is-nan "^1.0.0"
|
||||
|
||||
is-fullwidth-code-point@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
|
||||
@ -8289,16 +8261,6 @@ keyvaluestorage-interface@^1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/keyvaluestorage-interface/-/keyvaluestorage-interface-1.0.0.tgz#13ebdf71f5284ad54be94bd1ad9ed79adad515ff"
|
||||
integrity sha512-8t6Q3TclQ4uZynJY9IGr2+SsIGwK9JHcO6ootkHCGA0CrQCRy+VkouYNO2xicET6b9al7QKzpebNow+gkpCL8g==
|
||||
|
||||
keyvaluestorage@^0.7.1:
|
||||
version "0.7.1"
|
||||
resolved "https://registry.yarnpkg.com/keyvaluestorage/-/keyvaluestorage-0.7.1.tgz#be2f9f742d759d5442cdf9d49af6bdacc964c1eb"
|
||||
integrity sha512-7AHq8bZE4WRWy+BltiuPwQo5aKuj7CguhwGdW7NUUOEImY2Tq/lJaBjHdOf0MYzeu+Y4oxQWhkZEZcrDc9KnxA==
|
||||
dependencies:
|
||||
better-sqlite3 "^7.1.2"
|
||||
keyvaluestorage-interface "^1.0.0"
|
||||
localStorage "^1.0.4"
|
||||
safe-json-utils "^1.1.1"
|
||||
|
||||
killable@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892"
|
||||
@ -8480,6 +8442,11 @@ lodash.debounce@^4.0.8:
|
||||
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
|
||||
integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168=
|
||||
|
||||
lodash.isequal@4.5.0:
|
||||
version "4.5.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"
|
||||
integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA=
|
||||
|
||||
lodash.memoize@^4.1.2:
|
||||
version "4.1.2"
|
||||
resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe"
|
||||
@ -8510,11 +8477,6 @@ lodash.truncate@^4.4.2:
|
||||
resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193"
|
||||
integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=
|
||||
|
||||
lodash.union@^4.6.0:
|
||||
version "4.6.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.union/-/lodash.union-4.6.0.tgz#48bb5088409f16f1821666641c44dd1aaae3cd88"
|
||||
integrity sha1-SLtQiECfFvGCFmZkHETdGqrjzYg=
|
||||
|
||||
lodash.uniq@^4.5.0:
|
||||
version "4.5.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
|
||||
@ -8736,11 +8698,6 @@ mimic-fn@^2.1.0:
|
||||
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
|
||||
integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==
|
||||
|
||||
mimic-response@^3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9"
|
||||
integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==
|
||||
|
||||
min-indent@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869"
|
||||
@ -8773,7 +8730,7 @@ minimatch@3.0.4, minimatch@^3.0.4:
|
||||
dependencies:
|
||||
brace-expansion "^1.1.7"
|
||||
|
||||
minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5:
|
||||
minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.5:
|
||||
version "1.2.5"
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
|
||||
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
|
||||
@ -8838,11 +8795,6 @@ mixin-deep@^1.2.0:
|
||||
for-in "^1.0.2"
|
||||
is-extendable "^1.0.1"
|
||||
|
||||
mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3:
|
||||
version "0.5.3"
|
||||
resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113"
|
||||
integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==
|
||||
|
||||
mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.5, mkdirp@~0.5.1:
|
||||
version "0.5.5"
|
||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
|
||||
@ -8900,6 +8852,11 @@ multicast-dns@^6.0.1:
|
||||
dns-packet "^1.3.1"
|
||||
thunky "^1.0.2"
|
||||
|
||||
multiformats@^9.4.2:
|
||||
version "9.6.5"
|
||||
resolved "https://registry.yarnpkg.com/multiformats/-/multiformats-9.6.5.tgz#f2d894a26664b454a90abf5a8911b7e39195db80"
|
||||
integrity sha512-vMwf/FUO+qAPvl3vlSZEgEVFY/AxeZq5yg761ScF3CZsXgmTi/HGkicUiNN0CI4PW8FiY2P0OLklOcmQjdQJhw==
|
||||
|
||||
nan@^2.12.1:
|
||||
version "2.15.0"
|
||||
resolved "https://registry.yarnpkg.com/nan/-/nan-2.15.0.tgz#3f34a473ff18e15c1b5626b62903b5ad6e665fee"
|
||||
@ -8927,11 +8884,6 @@ nanomatch@^1.2.9:
|
||||
snapdragon "^0.8.1"
|
||||
to-regex "^3.0.1"
|
||||
|
||||
napi-build-utils@^1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/napi-build-utils/-/napi-build-utils-1.0.2.tgz#b1fddc0b2c46e380a0b7a76f984dd47c41a13806"
|
||||
integrity sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==
|
||||
|
||||
native-url@^0.2.6:
|
||||
version "0.2.6"
|
||||
resolved "https://registry.yarnpkg.com/native-url/-/native-url-0.2.6.tgz#ca1258f5ace169c716ff44eccbddb674e10399ae"
|
||||
@ -8972,13 +8924,6 @@ no-case@^3.0.4:
|
||||
lower-case "^2.0.2"
|
||||
tslib "^2.0.3"
|
||||
|
||||
node-abi@^3.3.0:
|
||||
version "3.8.0"
|
||||
resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.8.0.tgz#679957dc8e7aa47b0a02589dbfde4f77b29ccb32"
|
||||
integrity sha512-tzua9qWWi7iW4I42vUPKM+SfaF0vQSLAm4yO5J83mSwB7GeoWrDKC/K+8YCnYNwqP5duwazbw2X9l4m8SC2cUw==
|
||||
dependencies:
|
||||
semver "^7.3.5"
|
||||
|
||||
node-addon-api@^2.0.0:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32"
|
||||
@ -9113,16 +9058,6 @@ npm-run-path@^4.0.0:
|
||||
dependencies:
|
||||
path-key "^3.0.0"
|
||||
|
||||
npmlog@^4.0.1:
|
||||
version "4.1.2"
|
||||
resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b"
|
||||
integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==
|
||||
dependencies:
|
||||
are-we-there-yet "~1.1.2"
|
||||
console-control-strings "~1.1.0"
|
||||
gauge "~2.7.3"
|
||||
set-blocking "~2.0.0"
|
||||
|
||||
nth-check@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c"
|
||||
@ -9142,11 +9077,6 @@ num2fraction@^1.2.2:
|
||||
resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede"
|
||||
integrity sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4=
|
||||
|
||||
number-is-nan@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
|
||||
integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=
|
||||
|
||||
nwsapi@^2.2.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7"
|
||||
@ -10405,25 +10335,6 @@ preact@10.4.1:
|
||||
resolved "https://registry.yarnpkg.com/preact/-/preact-10.4.1.tgz#9b3ba020547673a231c6cf16f0fbaef0e8863431"
|
||||
integrity sha512-WKrRpCSwL2t3tpOOGhf2WfTpcmbpxaWtDbdJdKdjd0aEiTkvOmS4NBkG6kzlaAHI9AkQ3iVqbFWM3Ei7mZ4o1Q==
|
||||
|
||||
prebuild-install@^7.0.0:
|
||||
version "7.0.1"
|
||||
resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-7.0.1.tgz#c10075727c318efe72412f333e0ef625beaf3870"
|
||||
integrity sha512-QBSab31WqkyxpnMWQxubYAHR5S9B2+r81ucocew34Fkl98FhvKIF50jIJnNOBmAZfyNV7vE5T6gd3hTVWgY6tg==
|
||||
dependencies:
|
||||
detect-libc "^2.0.0"
|
||||
expand-template "^2.0.3"
|
||||
github-from-package "0.0.0"
|
||||
minimist "^1.2.3"
|
||||
mkdirp-classic "^0.5.3"
|
||||
napi-build-utils "^1.0.1"
|
||||
node-abi "^3.3.0"
|
||||
npmlog "^4.0.1"
|
||||
pump "^3.0.0"
|
||||
rc "^1.2.7"
|
||||
simple-get "^4.0.0"
|
||||
tar-fs "^2.0.0"
|
||||
tunnel-agent "^0.6.0"
|
||||
|
||||
prelude-ls@^1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
|
||||
@ -10740,16 +10651,6 @@ raw-body@2.4.2:
|
||||
iconv-lite "0.4.24"
|
||||
unpipe "1.0.0"
|
||||
|
||||
rc@^1.2.7:
|
||||
version "1.2.8"
|
||||
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
|
||||
integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==
|
||||
dependencies:
|
||||
deep-extend "^0.6.0"
|
||||
ini "~1.3.0"
|
||||
minimist "^1.2.0"
|
||||
strip-json-comments "~2.0.1"
|
||||
|
||||
react-app-polyfill@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/react-app-polyfill/-/react-app-polyfill-2.0.0.tgz#a0bea50f078b8a082970a9d853dc34b6dcc6a3cf"
|
||||
@ -10914,7 +10815,7 @@ read-pkg@^5.2.0:
|
||||
parse-json "^5.0.0"
|
||||
type-fest "^0.6.0"
|
||||
|
||||
"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6:
|
||||
"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6:
|
||||
version "2.3.7"
|
||||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57"
|
||||
integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==
|
||||
@ -10927,7 +10828,7 @@ read-pkg@^5.2.0:
|
||||
string_decoder "~1.1.1"
|
||||
util-deprecate "~1.0.1"
|
||||
|
||||
readable-stream@^3.0.0, readable-stream@^3.0.6, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0:
|
||||
readable-stream@^3.0.0, readable-stream@^3.0.6, readable-stream@^3.1.1, readable-stream@^3.6.0:
|
||||
version "3.6.0"
|
||||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198"
|
||||
integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==
|
||||
@ -11541,7 +11442,7 @@ serve-static@1.14.2:
|
||||
parseurl "~1.3.3"
|
||||
send "0.17.2"
|
||||
|
||||
set-blocking@^2.0.0, set-blocking@~2.0.0:
|
||||
set-blocking@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
|
||||
integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc=
|
||||
@ -11632,20 +11533,6 @@ signal-exit@^3.0.0, signal-exit@^3.0.2:
|
||||
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9"
|
||||
integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==
|
||||
|
||||
simple-concat@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f"
|
||||
integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==
|
||||
|
||||
simple-get@^4.0.0:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-4.0.1.tgz#4a39db549287c979d352112fa03fd99fd6bc3543"
|
||||
integrity sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==
|
||||
dependencies:
|
||||
decompress-response "^6.0.0"
|
||||
once "^1.3.1"
|
||||
simple-concat "^1.0.0"
|
||||
|
||||
simple-swizzle@^0.2.2:
|
||||
version "0.2.2"
|
||||
resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a"
|
||||
@ -11993,24 +11880,6 @@ string-natural-compare@^3.0.1:
|
||||
resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4"
|
||||
integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw==
|
||||
|
||||
string-width@^1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
|
||||
integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=
|
||||
dependencies:
|
||||
code-point-at "^1.0.0"
|
||||
is-fullwidth-code-point "^1.0.0"
|
||||
strip-ansi "^3.0.0"
|
||||
|
||||
"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
|
||||
version "4.2.3"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
||||
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
||||
dependencies:
|
||||
emoji-regex "^8.0.0"
|
||||
is-fullwidth-code-point "^3.0.0"
|
||||
strip-ansi "^6.0.1"
|
||||
|
||||
string-width@^3.0.0, string-width@^3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961"
|
||||
@ -12020,6 +11889,15 @@ string-width@^3.0.0, string-width@^3.1.0:
|
||||
is-fullwidth-code-point "^2.0.0"
|
||||
strip-ansi "^5.1.0"
|
||||
|
||||
string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
|
||||
version "4.2.3"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
||||
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
||||
dependencies:
|
||||
emoji-regex "^8.0.0"
|
||||
is-fullwidth-code-point "^3.0.0"
|
||||
strip-ansi "^6.0.1"
|
||||
|
||||
string.prototype.matchall@^4.0.6:
|
||||
version "4.0.6"
|
||||
resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.6.tgz#5abb5dabc94c7b0ea2380f65ba610b3a544b15fa"
|
||||
@ -12080,7 +11958,7 @@ strip-ansi@6.0.0:
|
||||
dependencies:
|
||||
ansi-regex "^5.0.0"
|
||||
|
||||
strip-ansi@^3.0.0, strip-ansi@^3.0.1:
|
||||
strip-ansi@^3.0.1:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
|
||||
integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=
|
||||
@ -12148,11 +12026,6 @@ strip-json-comments@^3.1.0, strip-json-comments@^3.1.1:
|
||||
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006"
|
||||
integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==
|
||||
|
||||
strip-json-comments@~2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
|
||||
integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo=
|
||||
|
||||
style-loader@1.3.0:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-1.3.0.tgz#828b4a3b3b7e7aa5847ce7bae9e874512114249e"
|
||||
@ -12277,27 +12150,6 @@ tapable@^1.0.0, tapable@^1.1.3:
|
||||
resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2"
|
||||
integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==
|
||||
|
||||
tar-fs@^2.0.0:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.1.1.tgz#489a15ab85f1f0befabb370b7de4f9eb5cbe8784"
|
||||
integrity sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==
|
||||
dependencies:
|
||||
chownr "^1.1.1"
|
||||
mkdirp-classic "^0.5.2"
|
||||
pump "^3.0.0"
|
||||
tar-stream "^2.1.4"
|
||||
|
||||
tar-stream@^2.1.4:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287"
|
||||
integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==
|
||||
dependencies:
|
||||
bl "^4.0.3"
|
||||
end-of-stream "^1.4.1"
|
||||
fs-constants "^1.0.0"
|
||||
inherits "^2.0.3"
|
||||
readable-stream "^3.1.1"
|
||||
|
||||
tar@^6.0.2:
|
||||
version "6.1.11"
|
||||
resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621"
|
||||
@ -12561,13 +12413,6 @@ tty-browserify@0.0.0:
|
||||
resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"
|
||||
integrity sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=
|
||||
|
||||
tunnel-agent@^0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
|
||||
integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=
|
||||
dependencies:
|
||||
safe-buffer "^5.0.1"
|
||||
|
||||
tweetnacl-util@^0.15.0:
|
||||
version "0.15.1"
|
||||
resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b"
|
||||
@ -12657,6 +12502,13 @@ typescript@^4.3.2:
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3"
|
||||
integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==
|
||||
|
||||
uint8arrays@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/uint8arrays/-/uint8arrays-3.0.0.tgz#260869efb8422418b6f04e3fac73a3908175c63b"
|
||||
integrity sha512-HRCx0q6O9Bfbp+HHSfQQKD7wU70+lydKVt4EghkdOvlK/NlrF90z+eXV34mUd48rNvVJXwkrMSPpCATkct8fJA==
|
||||
dependencies:
|
||||
multiformats "^9.4.2"
|
||||
|
||||
unbox-primitive@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471"
|
||||
@ -13156,13 +13008,6 @@ which@^2.0.1, which@^2.0.2:
|
||||
dependencies:
|
||||
isexe "^2.0.0"
|
||||
|
||||
wide-align@^1.1.0:
|
||||
version "1.1.5"
|
||||
resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3"
|
||||
integrity sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==
|
||||
dependencies:
|
||||
string-width "^1.0.2 || 2 || 3 || 4"
|
||||
|
||||
word-wrap@^1.2.3, word-wrap@~1.2.3:
|
||||
version "1.2.3"
|
||||
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c"
|
||||
|
2
wallets/react-wallet-v2/.gitignore
vendored
2
wallets/react-wallet-v2/.gitignore
vendored
@ -1,5 +1,7 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
.DS_Store
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
|
@ -13,13 +13,13 @@
|
||||
"@cosmjs/proto-signing": "0.28.4",
|
||||
"@json-rpc-tools/utils": "1.7.6",
|
||||
"@nextui-org/react": "1.0.8-beta.5",
|
||||
"@solana/web3.js": "1.39.1",
|
||||
"@walletconnect/client": "2.0.0-beta.26",
|
||||
"@walletconnect/utils": "2.0.0-beta.26",
|
||||
"@solana/web3.js": "1.43.0",
|
||||
"@walletconnect/sign-client": "2.0.0-beta.100",
|
||||
"@walletconnect/utils": "2.0.0-beta.100",
|
||||
"bs58": "5.0.0",
|
||||
"cosmos-wallet": "1.2.0",
|
||||
"ethers": "5.6.4",
|
||||
"framer-motion": "6.3.0",
|
||||
"ethers": "5.6.6",
|
||||
"framer-motion": "6.3.3",
|
||||
"mnemonic-keyring": "1.4.0",
|
||||
"next": "12.1.5",
|
||||
"react": "17.0.2",
|
||||
@ -27,16 +27,16 @@
|
||||
"react-dom": "17.0.2",
|
||||
"react-qr-reader-es6": "2.2.1-2",
|
||||
"solana-wallet": "1.0.1",
|
||||
"valtio": "1.5.2"
|
||||
"valtio": "1.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "17.0.25",
|
||||
"@types/react": "17.0.40",
|
||||
"@walletconnect/types": "2.0.0-beta.26",
|
||||
"eslint": "8.13.0",
|
||||
"eslint-config-next": "12.1.5",
|
||||
"@types/node": "17.0.35",
|
||||
"@types/react": "18.0.9",
|
||||
"@walletconnect/types": "2.0.0-beta.100",
|
||||
"eslint": "8.15.0",
|
||||
"eslint-config-next": "12.1.6",
|
||||
"eslint-config-prettier": "8.5.0",
|
||||
"prettier": "2.6.2",
|
||||
"typescript": "4.6.3"
|
||||
"typescript": "4.6.4"
|
||||
}
|
||||
}
|
@ -17,6 +17,7 @@
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
height: calc(100% - 220px);
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
|
@ -1,5 +1,6 @@
|
||||
import ChainCard from '@/components/ChainCard'
|
||||
import { truncate } from '@/utils/HelperUtil'
|
||||
import { Avatar, Button, Card, Text, Tooltip } from '@nextui-org/react'
|
||||
import { Avatar, Button, Text, Tooltip } from '@nextui-org/react'
|
||||
import Image from 'next/image'
|
||||
import { useState } from 'react'
|
||||
|
||||
@ -20,25 +21,7 @@ export default function AccountCard({ name, logo, rgb, address }: Props) {
|
||||
}
|
||||
|
||||
return (
|
||||
<Card
|
||||
bordered
|
||||
borderWeight="light"
|
||||
css={{
|
||||
borderColor: `rgba(${rgb}, 0.4)`,
|
||||
boxShadow: `0 0 10px 0 rgba(${rgb}, 0.15)`,
|
||||
backgroundColor: `rgba(${rgb}, 0.25)`,
|
||||
marginBottom: '$6',
|
||||
minHeight: '70px'
|
||||
}}
|
||||
>
|
||||
<Card.Body
|
||||
css={{
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between',
|
||||
overflow: 'hidden'
|
||||
}}
|
||||
>
|
||||
<ChainCard rgb={rgb} flexDirection="row" alignItems="center">
|
||||
<Avatar src={logo} />
|
||||
<div style={{ flex: 1 }}>
|
||||
<Text h5 css={{ marginLeft: '$9' }}>
|
||||
@ -63,7 +46,6 @@ export default function AccountCard({ name, logo, rgb, address }: Props) {
|
||||
/>
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</Card.Body>
|
||||
</Card>
|
||||
</ChainCard>
|
||||
)
|
||||
}
|
||||
|
36
wallets/react-wallet-v2/src/components/ChainCard.tsx
Normal file
36
wallets/react-wallet-v2/src/components/ChainCard.tsx
Normal file
@ -0,0 +1,36 @@
|
||||
import { Card } from '@nextui-org/react'
|
||||
import { ReactNode } from 'react'
|
||||
|
||||
interface Props {
|
||||
children: ReactNode | ReactNode[]
|
||||
rgb: string
|
||||
flexDirection: 'row' | 'col'
|
||||
alignItems: 'center' | 'flex-start'
|
||||
}
|
||||
|
||||
export default function ChainCard({ rgb, children, flexDirection, alignItems }: Props) {
|
||||
return (
|
||||
<Card
|
||||
bordered
|
||||
borderWeight="light"
|
||||
css={{
|
||||
borderColor: `rgba(${rgb}, 0.4)`,
|
||||
boxShadow: `0 0 10px 0 rgba(${rgb}, 0.15)`,
|
||||
backgroundColor: `rgba(${rgb}, 0.25)`,
|
||||
marginBottom: '$6',
|
||||
minHeight: '70px'
|
||||
}}
|
||||
>
|
||||
<Card.Body
|
||||
css={{
|
||||
flexDirection,
|
||||
alignItems,
|
||||
justifyContent: 'space-between',
|
||||
overflow: 'hidden'
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</Card.Body>
|
||||
</Card>
|
||||
)
|
||||
}
|
@ -31,7 +31,7 @@ export default function Layout({ children, initialized }: Props) {
|
||||
bordered={{ '@initial': false, '@xs': true }}
|
||||
borderWeight={{ '@initial': 'light', '@xs': 'light' }}
|
||||
css={{
|
||||
height: '100vh',
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
justifyContent: initialized ? 'normal' : 'center',
|
||||
alignItems: initialized ? 'normal' : 'center',
|
||||
@ -49,8 +49,10 @@ export default function Layout({ children, initialized }: Props) {
|
||||
<RouteTransition>
|
||||
<Card.Body
|
||||
css={{
|
||||
display: 'block',
|
||||
paddingLeft: 2,
|
||||
paddingRight: 2,
|
||||
paddingBottom: '40px',
|
||||
'@xs': {
|
||||
padding: '20px',
|
||||
paddingBottom: '40px'
|
||||
@ -69,6 +71,7 @@ export default function Layout({ children, initialized }: Props) {
|
||||
justifyContent: 'flex-end',
|
||||
alignItems: 'flex-end',
|
||||
boxShadow: '0 -30px 20px #111111',
|
||||
backgroundColor: '#111111',
|
||||
zIndex: 200,
|
||||
bottom: 0,
|
||||
left: 0
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { Avatar, Col, Link, Row, Text } from '@nextui-org/react'
|
||||
import { SessionTypes } from '@walletconnect/types'
|
||||
import { SignClientTypes } from '@walletconnect/types'
|
||||
|
||||
/**
|
||||
* Types
|
||||
*/
|
||||
interface IProps {
|
||||
metadata: SessionTypes.Participant['metadata']
|
||||
metadata: SignClientTypes.Metadata
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,46 +1,39 @@
|
||||
import AccountSelectCard from '@/components/AccountSelectCard'
|
||||
import { Col, Divider, Row, Text } from '@nextui-org/react'
|
||||
import { Fragment } from 'react'
|
||||
import { Col, Row, Text } from '@nextui-org/react'
|
||||
|
||||
/**
|
||||
* Types
|
||||
*/
|
||||
interface IProps {
|
||||
name: string
|
||||
chain: string
|
||||
addresses: string[]
|
||||
selectedAddresses: string[]
|
||||
onSelect: (address: string) => void
|
||||
selectedAddresses: string[] | undefined
|
||||
onSelect: (chain: string, address: string) => void
|
||||
}
|
||||
|
||||
/**
|
||||
* Component
|
||||
*/
|
||||
export default function ProposalSelectSection({
|
||||
name,
|
||||
addresses,
|
||||
selectedAddresses,
|
||||
chain,
|
||||
onSelect
|
||||
}: IProps) {
|
||||
return (
|
||||
<Fragment>
|
||||
<Divider y={2} />
|
||||
|
||||
<Row>
|
||||
<Col>
|
||||
<Text h5>{`Select ${name} Accounts`}</Text>
|
||||
<Text h4 css={{ marginTop: '$5' }}>{`Choose ${chain} accounts`}</Text>
|
||||
{addresses.map((address, index) => (
|
||||
<AccountSelectCard
|
||||
key={address}
|
||||
address={address}
|
||||
index={index}
|
||||
onSelect={() => onSelect(`${chain}:${address}`)}
|
||||
selected={selectedAddresses.includes(`${chain}:${address}`)}
|
||||
onSelect={() => onSelect(chain, address)}
|
||||
selected={selectedAddresses?.includes(address) ?? false}
|
||||
/>
|
||||
))}
|
||||
</Col>
|
||||
</Row>
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
|
86
wallets/react-wallet-v2/src/components/SessionChainCard.tsx
Normal file
86
wallets/react-wallet-v2/src/components/SessionChainCard.tsx
Normal file
@ -0,0 +1,86 @@
|
||||
import ChainCard from '@/components/ChainCard'
|
||||
import { COSMOS_MAINNET_CHAINS } from '@/data/COSMOSData'
|
||||
import { EIP155_MAINNET_CHAINS, EIP155_TEST_CHAINS } from '@/data/EIP155Data'
|
||||
import { SOLANA_MAINNET_CHAINS, SOLANA_TEST_CHAINS } from '@/data/SolanaData'
|
||||
import { formatChainName } from '@/utils/HelperUtil'
|
||||
import { Col, Row, Text } from '@nextui-org/react'
|
||||
import { SessionTypes } from '@walletconnect/types'
|
||||
import { Fragment } from 'react'
|
||||
|
||||
/**
|
||||
* Utilities
|
||||
*/
|
||||
const CHAIN_METADATA = {
|
||||
...COSMOS_MAINNET_CHAINS,
|
||||
...SOLANA_MAINNET_CHAINS,
|
||||
...EIP155_MAINNET_CHAINS,
|
||||
...EIP155_TEST_CHAINS,
|
||||
...SOLANA_TEST_CHAINS
|
||||
}
|
||||
|
||||
/**
|
||||
* Types
|
||||
*/
|
||||
interface IProps {
|
||||
namespace: SessionTypes.Namespace
|
||||
}
|
||||
|
||||
/**
|
||||
* Component
|
||||
*/
|
||||
export default function SessionChainCard({ namespace }: IProps) {
|
||||
const chains: string[] = []
|
||||
|
||||
// WIP
|
||||
|
||||
namespace.accounts.forEach(account => {
|
||||
const [type, chain] = account.split(':')
|
||||
const chainId = `${type}:${chain}`
|
||||
chains.push(chainId)
|
||||
})
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
{chains.map(chainId => {
|
||||
const extensionMethods: SessionTypes.Namespace['methods'] = []
|
||||
const extensionEvents: SessionTypes.Namespace['events'] = []
|
||||
|
||||
namespace.extension?.map(({ accounts, methods, events }) => {
|
||||
accounts.forEach(account => {
|
||||
const [type, chain] = account.split(':')
|
||||
const chainId = `${type}:${chain}`
|
||||
if (chains.includes(chainId)) {
|
||||
extensionMethods.push(...methods)
|
||||
extensionEvents.push(...events)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
const allMethods = [...namespace.methods, ...extensionMethods]
|
||||
const allEvents = [...namespace.events, ...extensionEvents]
|
||||
// @ts-expect-error
|
||||
const rgb = CHAIN_METADATA[chainId]?.rgb
|
||||
|
||||
return (
|
||||
<ChainCard key={chainId} rgb={rgb ?? ''} flexDirection="col" alignItems="flex-start">
|
||||
<Text h5 css={{ marginBottom: '$5' }}>
|
||||
{formatChainName(chainId)}
|
||||
</Text>
|
||||
<Row>
|
||||
<Col>
|
||||
<Text h6>Methods</Text>
|
||||
<Text color="$gray300">{allMethods.length ? allMethods.join(', ') : '-'}</Text>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row css={{ marginTop: '$5' }}>
|
||||
<Col>
|
||||
<Text h6>Events</Text>
|
||||
<Text color="$gray300">{allEvents.length ? allEvents.join(', ') : '-'}</Text>
|
||||
</Col>
|
||||
</Row>
|
||||
</ChainCard>
|
||||
)
|
||||
})}
|
||||
</Fragment>
|
||||
)
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
import ChainCard from '@/components/ChainCard'
|
||||
import { COSMOS_MAINNET_CHAINS } from '@/data/COSMOSData'
|
||||
import { EIP155_MAINNET_CHAINS, EIP155_TEST_CHAINS } from '@/data/EIP155Data'
|
||||
import { SOLANA_MAINNET_CHAINS, SOLANA_TEST_CHAINS } from '@/data/SolanaData'
|
||||
import { formatChainName } from '@/utils/HelperUtil'
|
||||
import { Col, Row, Text } from '@nextui-org/react'
|
||||
import { ProposalTypes } from '@walletconnect/types'
|
||||
import { Fragment } from 'react'
|
||||
|
||||
/**
|
||||
* Utilities
|
||||
*/
|
||||
const CHAIN_METADATA = {
|
||||
...COSMOS_MAINNET_CHAINS,
|
||||
...SOLANA_MAINNET_CHAINS,
|
||||
...EIP155_MAINNET_CHAINS,
|
||||
...EIP155_TEST_CHAINS,
|
||||
...SOLANA_TEST_CHAINS
|
||||
}
|
||||
|
||||
/**
|
||||
* Types
|
||||
*/
|
||||
interface IProps {
|
||||
requiredNamespace: ProposalTypes.RequiredNamespace
|
||||
}
|
||||
|
||||
/**
|
||||
* Component
|
||||
*/
|
||||
export default function SessionProposalChainCard({ requiredNamespace }: IProps) {
|
||||
return (
|
||||
<Fragment>
|
||||
{requiredNamespace.chains.map(chainId => {
|
||||
const extensionMethods: ProposalTypes.RequiredNamespace['methods'] = []
|
||||
const extensionEvents: ProposalTypes.RequiredNamespace['events'] = []
|
||||
|
||||
requiredNamespace.extension?.map(({ chains, methods, events }) => {
|
||||
if (chains.includes(chainId)) {
|
||||
extensionMethods.push(...methods)
|
||||
extensionEvents.push(...events)
|
||||
}
|
||||
})
|
||||
|
||||
const allMethods = [...requiredNamespace.methods, ...extensionMethods]
|
||||
const allEvents = [...requiredNamespace.events, ...extensionEvents]
|
||||
// @ts-expect-error
|
||||
const rgb = CHAIN_METADATA[chainId]?.rgb
|
||||
|
||||
return (
|
||||
<ChainCard key={chainId} rgb={rgb ?? ''} flexDirection="col" alignItems="flex-start">
|
||||
<Text h5 css={{ marginBottom: '$5' }}>
|
||||
{formatChainName(chainId)}
|
||||
</Text>
|
||||
<Row>
|
||||
<Col>
|
||||
<Text h6>Methods</Text>
|
||||
<Text color="$gray300">{allMethods.length ? allMethods.join(', ') : '-'}</Text>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row css={{ marginTop: '$5' }}>
|
||||
<Col>
|
||||
<Text h6>Events</Text>
|
||||
<Text color="$gray300">{allEvents.length ? allEvents.join(', ') : '-'}</Text>
|
||||
</Col>
|
||||
</Row>
|
||||
</ChainCard>
|
||||
)
|
||||
})}
|
||||
</Fragment>
|
||||
)
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
import AccountSelectCard from '@/components/AccountSelectCard'
|
||||
import { Col, Divider, Row, Text } from '@nextui-org/react'
|
||||
import { Fragment } from 'react'
|
||||
|
||||
/**
|
||||
* Types
|
||||
*/
|
||||
interface IProps {
|
||||
name: string
|
||||
chain: string
|
||||
addresses: string[]
|
||||
selectedAddresses: string[]
|
||||
onDelete: (address: string) => void
|
||||
onAdd: (address: string) => void
|
||||
}
|
||||
|
||||
/**
|
||||
* Component
|
||||
*/
|
||||
export default function SessionSelectSection({
|
||||
name,
|
||||
addresses,
|
||||
chain,
|
||||
selectedAddresses,
|
||||
onDelete,
|
||||
onAdd
|
||||
}: IProps) {
|
||||
return (
|
||||
<Fragment>
|
||||
<Divider y={2} />
|
||||
|
||||
<Row>
|
||||
<Col>
|
||||
<Text h5>{`${name} Accounts`}</Text>
|
||||
{addresses.map((address, index) => {
|
||||
const fullAddress = `${chain}:${address}`
|
||||
const selected = selectedAddresses.includes(fullAddress)
|
||||
|
||||
return (
|
||||
<AccountSelectCard
|
||||
key={address}
|
||||
address={address}
|
||||
index={index}
|
||||
onSelect={() => (selected ? onDelete(fullAddress) : onAdd(fullAddress))}
|
||||
selected={selected}
|
||||
/>
|
||||
)
|
||||
})}
|
||||
</Col>
|
||||
</Row>
|
||||
</Fragment>
|
||||
)
|
||||
}
|
@ -55,7 +55,7 @@ export const EIP155_TEST_CHAINS = {
|
||||
name: 'Polygon Mumbai',
|
||||
logo: '/chain-logos/eip155-137.png',
|
||||
rgb: '130, 71, 229',
|
||||
rpc: 'https://rpc-mumbai.maticvigil.com/'
|
||||
rpc: 'https://matic-mumbai.chainstacklabs.com'
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ import SettingsStore from '@/store/SettingsStore'
|
||||
import { createOrRestoreCosmosWallet } from '@/utils/CosmosWalletUtil'
|
||||
import { createOrRestoreEIP155Wallet } from '@/utils/EIP155WalletUtil'
|
||||
import { createOrRestoreSolanaWallet } from '@/utils/SolanaWalletUtil'
|
||||
import { createWalletConnectClient } from '@/utils/WalletConnectUtil'
|
||||
import { createSignClient } from '@/utils/WalletConnectUtil'
|
||||
import { useCallback, useEffect, useState } from 'react'
|
||||
|
||||
export default function useInitialization() {
|
||||
@ -18,7 +18,7 @@ export default function useInitialization() {
|
||||
SettingsStore.setCosmosAddress(cosmosAddresses[0])
|
||||
SettingsStore.setSolanaAddress(solanaAddresses[0])
|
||||
|
||||
await createWalletConnectClient()
|
||||
await createSignClient()
|
||||
|
||||
setInitialized(true)
|
||||
} catch (err: unknown) {
|
||||
|
@ -2,33 +2,32 @@ import { COSMOS_SIGNING_METHODS } from '@/data/COSMOSData'
|
||||
import { EIP155_SIGNING_METHODS } from '@/data/EIP155Data'
|
||||
import { SOLANA_SIGNING_METHODS } from '@/data/SolanaData'
|
||||
import ModalStore from '@/store/ModalStore'
|
||||
import { walletConnectClient } from '@/utils/WalletConnectUtil'
|
||||
import { CLIENT_EVENTS } from '@walletconnect/client'
|
||||
import { SessionTypes } from '@walletconnect/types'
|
||||
import { signClient } from '@/utils/WalletConnectUtil'
|
||||
import { SignClientTypes } from '@walletconnect/types'
|
||||
import { useCallback, useEffect } from 'react'
|
||||
|
||||
export default function useWalletConnectEventsManager(initialized: boolean) {
|
||||
/******************************************************************************
|
||||
* 1. Open session proposal modal for confirmation / rejection
|
||||
*****************************************************************************/
|
||||
const onSessionProposal = useCallback((proposal: SessionTypes.Proposal) => {
|
||||
const onSessionProposal = useCallback(
|
||||
(proposal: SignClientTypes.EventArguments['session_proposal']) => {
|
||||
ModalStore.open('SessionProposalModal', { proposal })
|
||||
}, [])
|
||||
|
||||
/******************************************************************************
|
||||
* 2. [Optional] hanle session created
|
||||
*****************************************************************************/
|
||||
const onSessionCreated = useCallback((created: SessionTypes.Created) => {}, [])
|
||||
},
|
||||
[]
|
||||
)
|
||||
|
||||
/******************************************************************************
|
||||
* 3. Open request handling modal based on method that was used
|
||||
*****************************************************************************/
|
||||
const onSessionRequest = useCallback(async (requestEvent: SessionTypes.RequestEvent) => {
|
||||
const { topic, request } = requestEvent
|
||||
const { method } = request
|
||||
const requestSession = await walletConnectClient.session.get(topic)
|
||||
const onSessionRequest = useCallback(
|
||||
async (requestEvent: SignClientTypes.EventArguments['session_request']) => {
|
||||
console.log('session_request', requestEvent)
|
||||
const { topic, params } = requestEvent
|
||||
const { request } = params
|
||||
const requestSession = signClient.session.get(topic)
|
||||
|
||||
switch (method) {
|
||||
switch (request.method) {
|
||||
case EIP155_SIGNING_METHODS.ETH_SIGN:
|
||||
case EIP155_SIGNING_METHODS.PERSONAL_SIGN:
|
||||
return ModalStore.open('SessionSignModal', { requestEvent, requestSession })
|
||||
@ -53,18 +52,22 @@ export default function useWalletConnectEventsManager(initialized: boolean) {
|
||||
default:
|
||||
return ModalStore.open('SessionUnsuportedMethodModal', { requestEvent, requestSession })
|
||||
}
|
||||
}, [])
|
||||
},
|
||||
[]
|
||||
)
|
||||
|
||||
/******************************************************************************
|
||||
* Set up WalletConnect event listeners
|
||||
*****************************************************************************/
|
||||
useEffect(() => {
|
||||
if (initialized) {
|
||||
walletConnectClient.on(CLIENT_EVENTS.session.proposal, onSessionProposal)
|
||||
|
||||
walletConnectClient.on(CLIENT_EVENTS.session.created, onSessionCreated)
|
||||
|
||||
walletConnectClient.on(CLIENT_EVENTS.session.request, onSessionRequest)
|
||||
signClient.on('session_proposal', onSessionProposal)
|
||||
signClient.on('session_request', onSessionRequest)
|
||||
// TODOs
|
||||
signClient.on('session_ping', data => console.log('ping', data))
|
||||
signClient.on('session_event', data => console.log('event', data))
|
||||
signClient.on('session_update', data => console.log('update', data))
|
||||
signClient.on('session_delete', data => console.log('delete', data))
|
||||
}
|
||||
}, [initialized, onSessionProposal, onSessionCreated, onSessionRequest])
|
||||
}, [initialized, onSessionProposal, onSessionRequest])
|
||||
}
|
||||
|
@ -1,18 +1,15 @@
|
||||
import PageHeader from '@/components/PageHeader'
|
||||
import PairingCard from '@/components/PairingCard'
|
||||
import { walletConnectClient } from '@/utils/WalletConnectUtil'
|
||||
import { signClient } from '@/utils/WalletConnectUtil'
|
||||
import { Text } from '@nextui-org/react'
|
||||
import { ERROR } from '@walletconnect/utils'
|
||||
import { Fragment, useState } from 'react'
|
||||
|
||||
export default function PairingsPage() {
|
||||
const [pairings, setPairings] = useState(walletConnectClient.pairing.values)
|
||||
const [pairings, setPairings] = useState(signClient.pairing.values)
|
||||
|
||||
async function onDelete(topic: string) {
|
||||
await walletConnectClient.pairing.delete({
|
||||
topic,
|
||||
reason: ERROR.DELETED.format()
|
||||
})
|
||||
await signClient.disconnect({ topic, reason: ERROR.DELETED.format() })
|
||||
const newPairings = pairings.filter(pairing => pairing.topic !== topic)
|
||||
setPairings(newPairings)
|
||||
}
|
||||
@ -22,14 +19,14 @@ export default function PairingsPage() {
|
||||
<PageHeader title="Pairings" />
|
||||
{pairings.length ? (
|
||||
pairings.map(pairing => {
|
||||
const { metadata } = pairing.state
|
||||
const { peerMetadata } = pairing
|
||||
|
||||
return (
|
||||
<PairingCard
|
||||
key={pairing.topic}
|
||||
logo={metadata?.icons[0]}
|
||||
url={metadata?.url}
|
||||
name={metadata?.name}
|
||||
logo={peerMetadata?.icons[0]}
|
||||
url={peerMetadata?.url}
|
||||
name={peerMetadata?.name}
|
||||
onDelete={() => onDelete(pairing.topic)}
|
||||
/>
|
||||
)
|
||||
|
@ -1,15 +1,8 @@
|
||||
import PageHeader from '@/components/PageHeader'
|
||||
import ProjectInfoCard from '@/components/ProjectInfoCard'
|
||||
import SessionSelectSection from '@/components/SessionSelectSection'
|
||||
import { COSMOS_MAINNET_CHAINS, TCosmosChain } from '@/data/COSMOSData'
|
||||
import { EIP155_CHAINS, TEIP155Chain } from '@/data/EIP155Data'
|
||||
import { SOLANA_CHAINS, TSolanaChain } from '@/data/SolanaData'
|
||||
import { cosmosAddresses } from '@/utils/CosmosWalletUtil'
|
||||
import { eip155Addresses } from '@/utils/EIP155WalletUtil'
|
||||
import { isCosmosChain, isEIP155Chain, isSolanaChain } from '@/utils/HelperUtil'
|
||||
import { solanaAddresses } from '@/utils/SolanaWalletUtil'
|
||||
import { walletConnectClient } from '@/utils/WalletConnectUtil'
|
||||
import { Button, Col, Divider, Row, Text } from '@nextui-org/react'
|
||||
import SessionChainCard from '@/components/SessionChainCard'
|
||||
import { signClient } from '@/utils/WalletConnectUtil'
|
||||
import { Button, Divider, Loading, Row, Text } from '@nextui-org/react'
|
||||
import { ERROR } from '@walletconnect/utils'
|
||||
import { useRouter } from 'next/router'
|
||||
import { Fragment, useEffect, useState } from 'react'
|
||||
@ -21,6 +14,7 @@ export default function SessionPage() {
|
||||
const [topic, setTopic] = useState('')
|
||||
const [updated, setUpdated] = useState(new Date())
|
||||
const { query, replace } = useRouter()
|
||||
const [loading, setLoading] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
if (query?.topic) {
|
||||
@ -28,7 +22,7 @@ export default function SessionPage() {
|
||||
}
|
||||
}, [query])
|
||||
|
||||
const session = walletConnectClient.session.values.find(s => s.topic === topic)
|
||||
const session = signClient.session.values.find(s => s.topic === topic)
|
||||
|
||||
if (!session) {
|
||||
return null
|
||||
@ -36,116 +30,133 @@ export default function SessionPage() {
|
||||
|
||||
// Get necessary data from session
|
||||
const expiryDate = new Date(session.expiry * 1000)
|
||||
const { chains } = session.permissions.blockchain
|
||||
const { methods } = session.permissions.jsonrpc
|
||||
const { accounts } = session.state
|
||||
const { namespaces } = session
|
||||
|
||||
// Handle deletion of a session
|
||||
async function onDeleteSession() {
|
||||
await walletConnectClient.session.delete({
|
||||
topic,
|
||||
reason: ERROR.DELETED.format()
|
||||
})
|
||||
setLoading(true)
|
||||
await signClient.disconnect({ topic, reason: ERROR.DELETED.format() })
|
||||
replace('/sessions')
|
||||
setLoading(false)
|
||||
}
|
||||
|
||||
// Hanlde deletion of session account
|
||||
async function onDeleteAccount(account: string) {
|
||||
const newAccounts = accounts.filter(a => a !== account)
|
||||
await walletConnectClient.session.update({
|
||||
topic,
|
||||
state: {
|
||||
accounts: newAccounts
|
||||
}
|
||||
})
|
||||
setUpdated(new Date())
|
||||
async function onSessionPing() {
|
||||
setLoading(true)
|
||||
await signClient.ping({ topic })
|
||||
setLoading(false)
|
||||
}
|
||||
|
||||
// Handle addition of account to the session
|
||||
async function onAddAccount(account: string) {
|
||||
await walletConnectClient.session.update({
|
||||
async function onSessionEmit() {
|
||||
setLoading(true)
|
||||
console.log('baleg')
|
||||
await signClient.emit({
|
||||
topic,
|
||||
state: {
|
||||
accounts: [...accounts, account]
|
||||
}
|
||||
event: { name: 'chainChanged', data: 'Hello World' },
|
||||
chainId: 'eip155:1'
|
||||
})
|
||||
setUpdated(new Date())
|
||||
setLoading(false)
|
||||
}
|
||||
|
||||
const newNs = {
|
||||
eip155: {
|
||||
accounts: [
|
||||
'eip155:1:0x70012948c348CBF00806A3C79E3c5DAdFaAa347B',
|
||||
'eip155:137:0x70012948c348CBF00806A3C79E3c5DAdFaAa347B'
|
||||
],
|
||||
methods: ['personal_sign', 'eth_signTypedData', 'eth_sendTransaction'],
|
||||
events: []
|
||||
}
|
||||
}
|
||||
|
||||
async function onSessionUpdate() {
|
||||
setLoading(true)
|
||||
const { acknowledged } = await signClient.update({ topic, namespaces: newNs })
|
||||
await acknowledged()
|
||||
setUpdated(new Date())
|
||||
setLoading(false)
|
||||
}
|
||||
|
||||
// function renderAccountSelection(chain: string) {
|
||||
// if (isEIP155Chain(chain)) {
|
||||
// return (
|
||||
// <ProposalSelectSection
|
||||
// addresses={eip155Addresses}
|
||||
// selectedAddresses={selectedAccounts[chain]}
|
||||
// onSelect={onSelectAccount}
|
||||
// chain={chain}
|
||||
// />
|
||||
// )
|
||||
// } else if (isCosmosChain(chain)) {
|
||||
// return (
|
||||
// <ProposalSelectSection
|
||||
// addresses={cosmosAddresses}
|
||||
// selectedAddresses={selectedAccounts[chain]}
|
||||
// onSelect={onSelectAccount}
|
||||
// chain={chain}
|
||||
// />
|
||||
// )
|
||||
// } else if (isSolanaChain(chain)) {
|
||||
// return (
|
||||
// <ProposalSelectSection
|
||||
// addresses={solanaAddresses}
|
||||
// selectedAddresses={selectedAccounts[chain]}
|
||||
// onSelect={onSelectAccount}
|
||||
// chain={chain}
|
||||
// />
|
||||
// )
|
||||
// }
|
||||
// }
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<PageHeader title="Session Details" />
|
||||
|
||||
<ProjectInfoCard metadata={session.peer.metadata} />
|
||||
|
||||
{chains.map(chain => {
|
||||
if (isEIP155Chain(chain)) {
|
||||
<Divider y={2} />
|
||||
|
||||
{Object.keys(namespaces).map(chain => {
|
||||
return (
|
||||
<SessionSelectSection
|
||||
key={chain}
|
||||
chain={chain}
|
||||
name={EIP155_CHAINS[chain as TEIP155Chain]?.name}
|
||||
addresses={eip155Addresses}
|
||||
selectedAddresses={accounts}
|
||||
onDelete={onDeleteAccount}
|
||||
onAdd={onAddAccount}
|
||||
/>
|
||||
<Fragment key={chain}>
|
||||
<Text h4 css={{ marginBottom: '$5' }}>{`Review ${chain} permissions`}</Text>
|
||||
<SessionChainCard namespace={namespaces[chain]} />
|
||||
{/* {renderAccountSelection(chain)} */}
|
||||
<Divider y={2} />
|
||||
</Fragment>
|
||||
)
|
||||
} else if (isCosmosChain(chain)) {
|
||||
return (
|
||||
<SessionSelectSection
|
||||
key={chain}
|
||||
chain={chain}
|
||||
name={COSMOS_MAINNET_CHAINS[chain as TCosmosChain]?.name}
|
||||
addresses={cosmosAddresses}
|
||||
selectedAddresses={accounts}
|
||||
onDelete={onDeleteAccount}
|
||||
onAdd={onAddAccount}
|
||||
/>
|
||||
)
|
||||
} else if (isSolanaChain(chain)) {
|
||||
return (
|
||||
<SessionSelectSection
|
||||
key={chain}
|
||||
chain={chain}
|
||||
name={SOLANA_CHAINS[chain as TSolanaChain]?.name}
|
||||
addresses={solanaAddresses}
|
||||
selectedAddresses={accounts}
|
||||
onDelete={onDeleteAccount}
|
||||
onAdd={onAddAccount}
|
||||
/>
|
||||
)
|
||||
}
|
||||
})}
|
||||
|
||||
<Divider y={1} />
|
||||
|
||||
<Row>
|
||||
<Col>
|
||||
<Text h5>Methods</Text>
|
||||
<Text color="$gray400">{methods.map(method => method).join(', ')}</Text>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Divider y={1} />
|
||||
|
||||
<Row justify="space-between">
|
||||
<Text h5>Expiry</Text>
|
||||
<Text css={{ color: '$gray400' }}>{expiryDate.toDateString()}</Text>
|
||||
</Row>
|
||||
|
||||
<Divider y={1} />
|
||||
|
||||
<Row justify="space-between">
|
||||
<Text h5>Last Updated</Text>
|
||||
<Text css={{ color: '$gray400' }}>{updated.toDateString()}</Text>
|
||||
</Row>
|
||||
|
||||
<Divider y={1} />
|
||||
|
||||
<Row>
|
||||
<Row css={{ marginTop: '$10' }}>
|
||||
<Button flat css={{ width: '100%' }} color="error" onClick={onDeleteSession}>
|
||||
Delete Session
|
||||
{loading ? <Loading size="sm" color="error" /> : 'Delete'}
|
||||
</Button>
|
||||
</Row>
|
||||
|
||||
<Row css={{ marginTop: '$10' }}>
|
||||
<Button flat css={{ width: '100%' }} color="primary" onClick={onSessionPing}>
|
||||
{loading ? <Loading size="sm" color="primary" /> : 'Ping'}
|
||||
</Button>
|
||||
</Row>
|
||||
|
||||
<Row css={{ marginTop: '$10' }}>
|
||||
<Button flat css={{ width: '100%' }} color="secondary" onClick={onSessionEmit}>
|
||||
{loading ? <Loading size="sm" color="secondary" /> : 'Emit'}
|
||||
</Button>
|
||||
</Row>
|
||||
|
||||
<Row css={{ marginTop: '$10' }}>
|
||||
<Button flat css={{ width: '100%' }} color="warning" onClick={onSessionUpdate}>
|
||||
{loading ? <Loading size="sm" color="warning" /> : 'Update'}
|
||||
</Button>
|
||||
</Row>
|
||||
</Fragment>
|
||||
|
@ -1,11 +1,11 @@
|
||||
import PageHeader from '@/components/PageHeader'
|
||||
import SessionCard from '@/components/SessionCard'
|
||||
import { walletConnectClient } from '@/utils/WalletConnectUtil'
|
||||
import { signClient } from '@/utils/WalletConnectUtil'
|
||||
import { Text } from '@nextui-org/react'
|
||||
import { Fragment, useState } from 'react'
|
||||
|
||||
export default function SessionsPage() {
|
||||
const [sessions, setSessions] = useState(walletConnectClient.session.values)
|
||||
const [sessions, setSessions] = useState(signClient.session.values)
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
|
@ -6,6 +6,7 @@ import { solanaWallets } from '@/utils/SolanaWalletUtil'
|
||||
import { Card, Divider, Row, Switch, Text } from '@nextui-org/react'
|
||||
import { Fragment } from 'react'
|
||||
import { useSnapshot } from 'valtio'
|
||||
import packageJSON from '../../package.json'
|
||||
|
||||
export default function SettingsPage() {
|
||||
const { testNets, eip155Address, cosmosAddress, solanaAddress } = useSnapshot(SettingsStore.state)
|
||||
@ -14,6 +15,24 @@ export default function SettingsPage() {
|
||||
<Fragment>
|
||||
<PageHeader title="Settings" />
|
||||
|
||||
<Text h4 css={{ marginBottom: '$5' }}>
|
||||
Packages
|
||||
</Text>
|
||||
<Row justify="space-between" align="center">
|
||||
<Text color="$gray400">@walletconnect/sign-client</Text>
|
||||
<Text color="$gray400">{packageJSON.dependencies['@walletconnect/sign-client']}</Text>
|
||||
</Row>
|
||||
<Row justify="space-between" align="center">
|
||||
<Text color="$gray400">@walletconnect/utils</Text>
|
||||
<Text color="$gray400">{packageJSON.dependencies['@walletconnect/utils']}</Text>
|
||||
</Row>
|
||||
<Row justify="space-between" align="center">
|
||||
<Text color="$gray400">@walletconnect/types</Text>
|
||||
<Text color="$gray400">{packageJSON.devDependencies['@walletconnect/types']}</Text>
|
||||
</Row>
|
||||
|
||||
<Divider y={2} />
|
||||
|
||||
<Text h4 css={{ marginBottom: '$5' }}>
|
||||
Testnets
|
||||
</Text>
|
||||
|
@ -1,6 +1,6 @@
|
||||
import PageHeader from '@/components/PageHeader'
|
||||
import QrReader from '@/components/QrReader'
|
||||
import { walletConnectClient } from '@/utils/WalletConnectUtil'
|
||||
import { signClient } from '@/utils/WalletConnectUtil'
|
||||
import { Button, Input, Loading, Text } from '@nextui-org/react'
|
||||
import { Fragment, useState } from 'react'
|
||||
|
||||
@ -11,7 +11,7 @@ export default function WalletConnectPage() {
|
||||
async function onConnect(uri: string) {
|
||||
try {
|
||||
setLoading(true)
|
||||
await walletConnectClient.pair({ uri })
|
||||
await signClient.pair({ uri })
|
||||
} catch (err: unknown) {
|
||||
alert(err)
|
||||
} finally {
|
||||
@ -31,6 +31,7 @@ export default function WalletConnectPage() {
|
||||
</Text>
|
||||
|
||||
<Input
|
||||
css={{ width: '100%' }}
|
||||
bordered
|
||||
aria-label="wc url connect input"
|
||||
placeholder="e.g. wc:a281567bb3e4..."
|
||||
|
@ -1,14 +1,13 @@
|
||||
import { SessionTypes } from '@walletconnect/types'
|
||||
import { SessionTypes, SignClientTypes } from '@walletconnect/types'
|
||||
import { proxy } from 'valtio'
|
||||
|
||||
/**
|
||||
* Types
|
||||
*/
|
||||
interface ModalData {
|
||||
proposal?: SessionTypes.Proposal
|
||||
created?: SessionTypes.Created
|
||||
requestEvent?: SessionTypes.RequestEvent
|
||||
requestSession?: SessionTypes.Settled
|
||||
proposal?: SignClientTypes.EventArguments['session_proposal']
|
||||
requestEvent?: SignClientTypes.EventArguments['session_request']
|
||||
requestSession?: SessionTypes.Struct
|
||||
}
|
||||
|
||||
interface State {
|
||||
|
@ -2,24 +2,30 @@ import { COSMOS_SIGNING_METHODS } from '@/data/COSMOSData'
|
||||
import { cosmosAddresses, cosmosWallets } from '@/utils/CosmosWalletUtil'
|
||||
import { getWalletAddressFromParams } from '@/utils/HelperUtil'
|
||||
import { formatJsonRpcError, formatJsonRpcResult } from '@json-rpc-tools/utils'
|
||||
import { RequestEvent } from '@walletconnect/types'
|
||||
import { SignClientTypes } from '@walletconnect/types'
|
||||
import { ERROR } from '@walletconnect/utils'
|
||||
import { parseSignDocValues } from 'cosmos-wallet'
|
||||
|
||||
export async function approveCosmosRequest(requestEvent: RequestEvent) {
|
||||
const { method, params, id } = requestEvent.request
|
||||
export async function approveCosmosRequest(
|
||||
requestEvent: SignClientTypes.EventArguments['session_request']
|
||||
) {
|
||||
const { params, id } = requestEvent
|
||||
const { request } = params
|
||||
const wallet = cosmosWallets[getWalletAddressFromParams(cosmosAddresses, params)]
|
||||
|
||||
switch (method) {
|
||||
switch (request.method) {
|
||||
case COSMOS_SIGNING_METHODS.COSMOS_SIGN_DIRECT:
|
||||
const signedDirect = await wallet.signDirect(
|
||||
params.signerAddress,
|
||||
parseSignDocValues(params.signDoc)
|
||||
request.params.signerAddress,
|
||||
parseSignDocValues(request.params.signDoc)
|
||||
)
|
||||
return formatJsonRpcResult(id, signedDirect.signature)
|
||||
|
||||
case COSMOS_SIGNING_METHODS.COSMOS_SIGN_AMINO:
|
||||
const signedAmino = await wallet.signAmino(params.signerAddress, params.signDoc)
|
||||
const signedAmino = await wallet.signAmino(
|
||||
request.params.signerAddress,
|
||||
request.params.signDoc
|
||||
)
|
||||
return formatJsonRpcResult(id, signedAmino.signature)
|
||||
|
||||
default:
|
||||
@ -27,7 +33,7 @@ export async function approveCosmosRequest(requestEvent: RequestEvent) {
|
||||
}
|
||||
}
|
||||
|
||||
export function rejectCosmosRequest(request: RequestEvent['request']) {
|
||||
export function rejectCosmosRequest(request: SignClientTypes.EventArguments['session_request']) {
|
||||
const { id } = request
|
||||
|
||||
return formatJsonRpcError(id, ERROR.JSONRPC_REQUEST_METHOD_REJECTED.format().message)
|
||||
|
@ -6,26 +6,28 @@ import {
|
||||
getWalletAddressFromParams
|
||||
} from '@/utils/HelperUtil'
|
||||
import { formatJsonRpcError, formatJsonRpcResult } from '@json-rpc-tools/utils'
|
||||
import { RequestEvent } from '@walletconnect/types'
|
||||
import { SignClientTypes } from '@walletconnect/types'
|
||||
import { ERROR } from '@walletconnect/utils'
|
||||
import { providers } from 'ethers'
|
||||
|
||||
export async function approveEIP155Request(requestEvent: RequestEvent) {
|
||||
const { method, params, id } = requestEvent.request
|
||||
const { chainId } = requestEvent
|
||||
export async function approveEIP155Request(
|
||||
requestEvent: SignClientTypes.EventArguments['session_request']
|
||||
) {
|
||||
const { params, id } = requestEvent
|
||||
const { chainId, request } = params
|
||||
const wallet = eip155Wallets[getWalletAddressFromParams(eip155Addresses, params)]
|
||||
|
||||
switch (method) {
|
||||
switch (request.method) {
|
||||
case EIP155_SIGNING_METHODS.PERSONAL_SIGN:
|
||||
case EIP155_SIGNING_METHODS.ETH_SIGN:
|
||||
const message = getSignParamsMessage(params)
|
||||
const message = getSignParamsMessage(request.params)
|
||||
const signedMessage = await wallet.signMessage(message)
|
||||
return formatJsonRpcResult(id, signedMessage)
|
||||
|
||||
case EIP155_SIGNING_METHODS.ETH_SIGN_TYPED_DATA:
|
||||
case EIP155_SIGNING_METHODS.ETH_SIGN_TYPED_DATA_V3:
|
||||
case EIP155_SIGNING_METHODS.ETH_SIGN_TYPED_DATA_V4:
|
||||
const { domain, types, message: data } = getSignTypedDataParamsData(params)
|
||||
const { domain, types, message: data } = getSignTypedDataParamsData(request.params)
|
||||
// https://github.com/ethers-io/ethers.js/issues/687#issuecomment-714069471
|
||||
delete types.EIP712Domain
|
||||
const signedData = await wallet._signTypedData(domain, types, data)
|
||||
@ -33,13 +35,13 @@ export async function approveEIP155Request(requestEvent: RequestEvent) {
|
||||
|
||||
case EIP155_SIGNING_METHODS.ETH_SEND_TRANSACTION:
|
||||
const provider = new providers.JsonRpcProvider(EIP155_CHAINS[chainId as TEIP155Chain].rpc)
|
||||
const sendTransaction = params[0]
|
||||
const sendTransaction = request.params[0]
|
||||
const connectedWallet = wallet.connect(provider)
|
||||
const { hash } = await connectedWallet.sendTransaction(sendTransaction)
|
||||
return formatJsonRpcResult(id, hash)
|
||||
|
||||
case EIP155_SIGNING_METHODS.ETH_SIGN_TRANSACTION:
|
||||
const signTransaction = params[0]
|
||||
const signTransaction = request.params[0]
|
||||
const signature = await wallet.signTransaction(signTransaction)
|
||||
return formatJsonRpcResult(id, signature)
|
||||
|
||||
@ -48,7 +50,7 @@ export async function approveEIP155Request(requestEvent: RequestEvent) {
|
||||
}
|
||||
}
|
||||
|
||||
export function rejectEIP155Request(request: RequestEvent['request']) {
|
||||
export function rejectEIP155Request(request: SignClientTypes.EventArguments['session_request']) {
|
||||
const { id } = request
|
||||
|
||||
return formatJsonRpcError(id, ERROR.JSONRPC_REQUEST_METHOD_REJECTED.format().message)
|
||||
|
@ -1,3 +1,6 @@
|
||||
import { COSMOS_MAINNET_CHAINS, TCosmosChain } from '@/data/COSMOSData'
|
||||
import { EIP155_CHAINS, TEIP155Chain } from '@/data/EIP155Data'
|
||||
import { SOLANA_CHAINS, TSolanaChain } from '@/data/SolanaData'
|
||||
import { utils } from 'ethers'
|
||||
|
||||
/**
|
||||
@ -90,3 +93,15 @@ export function isCosmosChain(chain: string) {
|
||||
export function isSolanaChain(chain: string) {
|
||||
return chain.includes('solana')
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats chainId to its name
|
||||
*/
|
||||
export function formatChainName(chainId: string) {
|
||||
return (
|
||||
EIP155_CHAINS[chainId as TEIP155Chain]?.name ??
|
||||
COSMOS_MAINNET_CHAINS[chainId as TCosmosChain]?.name ??
|
||||
SOLANA_CHAINS[chainId as TSolanaChain]?.name ??
|
||||
chainId
|
||||
)
|
||||
}
|
||||
|
@ -2,23 +2,26 @@ import { SOLANA_SIGNING_METHODS } from '@/data/SolanaData'
|
||||
import { getWalletAddressFromParams } from '@/utils/HelperUtil'
|
||||
import { solanaAddresses, solanaWallets } from '@/utils/SolanaWalletUtil'
|
||||
import { formatJsonRpcError, formatJsonRpcResult } from '@json-rpc-tools/utils'
|
||||
import { RequestEvent } from '@walletconnect/types'
|
||||
import { SignClientTypes } from '@walletconnect/types'
|
||||
import { ERROR } from '@walletconnect/utils'
|
||||
|
||||
export async function approveSolanaRequest(requestEvent: RequestEvent) {
|
||||
const { method, params, id } = requestEvent.request
|
||||
export async function approveSolanaRequest(
|
||||
requestEvent: SignClientTypes.EventArguments['session_request']
|
||||
) {
|
||||
const { params, id } = requestEvent
|
||||
const { request } = params
|
||||
const wallet = solanaWallets[getWalletAddressFromParams(solanaAddresses, params)]
|
||||
|
||||
switch (method) {
|
||||
switch (request.method) {
|
||||
case SOLANA_SIGNING_METHODS.SOLANA_SIGN_MESSAGE:
|
||||
const signedMessage = await wallet.signMessage(params.message)
|
||||
const signedMessage = await wallet.signMessage(request.params.message)
|
||||
return formatJsonRpcResult(id, signedMessage)
|
||||
|
||||
case SOLANA_SIGNING_METHODS.SOLANA_SIGN_TRANSACTION:
|
||||
const signedTransaction = await wallet.signTransaction(
|
||||
params.feePayer,
|
||||
params.recentBlockhash,
|
||||
params.instructions
|
||||
request.params.feePayer,
|
||||
request.params.recentBlockhash,
|
||||
request.params.instructions
|
||||
)
|
||||
|
||||
return formatJsonRpcResult(id, signedTransaction)
|
||||
@ -28,7 +31,7 @@ export async function approveSolanaRequest(requestEvent: RequestEvent) {
|
||||
}
|
||||
}
|
||||
|
||||
export function rejectSolanaRequest(request: RequestEvent['request']) {
|
||||
export function rejectSolanaRequest(request: SignClientTypes.EventArguments['session_request']) {
|
||||
const { id } = request
|
||||
|
||||
return formatJsonRpcError(id, ERROR.JSONRPC_REQUEST_METHOD_REJECTED.format().message)
|
||||
|
@ -1,10 +1,9 @@
|
||||
import WalletConnectClient from '@walletconnect/client'
|
||||
import SignClient from '@walletconnect/sign-client'
|
||||
|
||||
export let walletConnectClient: WalletConnectClient
|
||||
export let signClient: SignClient
|
||||
|
||||
export async function createWalletConnectClient() {
|
||||
walletConnectClient = await WalletConnectClient.init({
|
||||
controller: true,
|
||||
export async function createSignClient() {
|
||||
signClient = await SignClient.init({
|
||||
projectId: process.env.NEXT_PUBLIC_PROJECT_ID,
|
||||
relayUrl: process.env.NEXT_PUBLIC_RELAY_URL ?? 'wss://relay.walletconnect.com',
|
||||
metadata: {
|
||||
|
@ -1,25 +1,21 @@
|
||||
import ProjectInfoCard from '@/components/ProjectInfoCard'
|
||||
import ProposalSelectSection from '@/components/ProposalSelectSection'
|
||||
import RequesDetailsCard from '@/components/RequestDetalilsCard'
|
||||
import RequestMethodCard from '@/components/RequestMethodCard'
|
||||
import RequestModalContainer from '@/components/RequestModalContainer'
|
||||
import { COSMOS_MAINNET_CHAINS, TCosmosChain } from '@/data/COSMOSData'
|
||||
import { EIP155_CHAINS, TEIP155Chain } from '@/data/EIP155Data'
|
||||
import { SOLANA_CHAINS, TSolanaChain } from '@/data/SolanaData'
|
||||
import SessionProposalChainCard from '@/components/SessionProposalChainCard'
|
||||
import ModalStore from '@/store/ModalStore'
|
||||
import { cosmosAddresses } from '@/utils/CosmosWalletUtil'
|
||||
import { eip155Addresses } from '@/utils/EIP155WalletUtil'
|
||||
import { isCosmosChain, isEIP155Chain, isSolanaChain } from '@/utils/HelperUtil'
|
||||
import { solanaAddresses } from '@/utils/SolanaWalletUtil'
|
||||
import { walletConnectClient } from '@/utils/WalletConnectUtil'
|
||||
import { signClient } from '@/utils/WalletConnectUtil'
|
||||
import { Button, Divider, Modal, Text } from '@nextui-org/react'
|
||||
import { SessionTypes } from '@walletconnect/types'
|
||||
import { ERROR } from '@walletconnect/utils'
|
||||
import { Fragment, useState } from 'react'
|
||||
|
||||
export default function SessionProposalModal() {
|
||||
const [selectedEIP155, setSelectedEip155] = useState<string[]>([])
|
||||
const [selectedCosmos, setSelectedCosmos] = useState<string[]>([])
|
||||
const [selectedSolana, setSelectedSolana] = useState<string[]>([])
|
||||
const allSelected = [...selectedEIP155, ...selectedCosmos, ...selectedSolana]
|
||||
const [selectedAccounts, setSelectedAccounts] = useState<Record<string, string[]>>({})
|
||||
const hasSelected = Object.keys(selectedAccounts).length
|
||||
|
||||
// Get proposal data and wallet address from store
|
||||
const proposal = ModalStore.state.data?.proposal
|
||||
@ -30,50 +26,48 @@ export default function SessionProposalModal() {
|
||||
}
|
||||
|
||||
// Get required proposal data
|
||||
const { proposer, permissions, relay } = proposal
|
||||
const { chains } = permissions.blockchain
|
||||
const { methods } = permissions.jsonrpc
|
||||
const { id, params } = proposal
|
||||
const { proposer, requiredNamespaces, relays } = params
|
||||
|
||||
// Add / remove address from EIP155 selection
|
||||
function onSelectEIP155(address: string) {
|
||||
if (selectedEIP155.includes(address)) {
|
||||
const newAddresses = selectedEIP155.filter(a => a !== address)
|
||||
setSelectedEip155(newAddresses)
|
||||
function onSelectAccount(chain: string, account: string) {
|
||||
if (selectedAccounts[chain]?.includes(account)) {
|
||||
const newSelectedAccounts = selectedAccounts[chain]?.filter(a => a !== account)
|
||||
setSelectedAccounts(prev => ({
|
||||
...prev,
|
||||
[chain]: newSelectedAccounts
|
||||
}))
|
||||
} else {
|
||||
setSelectedEip155([...selectedEIP155, address])
|
||||
const prevChainAddresses = selectedAccounts[chain] ?? []
|
||||
setSelectedAccounts(prev => ({
|
||||
...prev,
|
||||
[chain]: [...prevChainAddresses, account]
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
// Add / remove address from Cosmos selection
|
||||
function onSelectCosmos(address: string) {
|
||||
if (selectedCosmos.includes(address)) {
|
||||
const newAddresses = selectedCosmos.filter(a => a !== address)
|
||||
setSelectedCosmos(newAddresses)
|
||||
} else {
|
||||
setSelectedCosmos([...selectedCosmos, address])
|
||||
}
|
||||
}
|
||||
|
||||
// Add / remove address from Solana selection
|
||||
function onSelectSolana(address: string) {
|
||||
if (selectedSolana.includes(address)) {
|
||||
const newAddresses = selectedSolana.filter(a => a !== address)
|
||||
setSelectedSolana(newAddresses)
|
||||
} else {
|
||||
setSelectedSolana([...selectedSolana, address])
|
||||
}
|
||||
}
|
||||
|
||||
// Hanlde approve action
|
||||
// Hanlde approve action, construct session namespace
|
||||
async function onApprove() {
|
||||
if (proposal) {
|
||||
const accounts = allSelected
|
||||
const response = {
|
||||
state: {
|
||||
accounts
|
||||
const namespaces: SessionTypes.Namespaces = {}
|
||||
Object.keys(requiredNamespaces).forEach(key => {
|
||||
const accounts: string[] = []
|
||||
requiredNamespaces[key].chains.map(chain => {
|
||||
selectedAccounts[key].map(acc => accounts.push(`${chain}:${acc}`))
|
||||
})
|
||||
namespaces[key] = {
|
||||
accounts,
|
||||
methods: requiredNamespaces[key].methods,
|
||||
events: requiredNamespaces[key].events
|
||||
}
|
||||
}
|
||||
await walletConnectClient.approve({ proposal, response })
|
||||
})
|
||||
|
||||
const { acknowledged } = await signClient.approve({
|
||||
id,
|
||||
relayProtocol: relays[0].protocol,
|
||||
namespaces
|
||||
})
|
||||
await acknowledged()
|
||||
}
|
||||
ModalStore.close()
|
||||
}
|
||||
@ -81,56 +75,64 @@ export default function SessionProposalModal() {
|
||||
// Hanlde reject action
|
||||
async function onReject() {
|
||||
if (proposal) {
|
||||
await walletConnectClient.reject({ proposal })
|
||||
await signClient.reject({
|
||||
id,
|
||||
reason: ERROR.JSONRPC_REQUEST_METHOD_REJECTED.format()
|
||||
})
|
||||
}
|
||||
ModalStore.close()
|
||||
}
|
||||
|
||||
// Render account selection checkboxes based on chain
|
||||
function renderAccountSelection(chain: string) {
|
||||
if (isEIP155Chain(chain)) {
|
||||
return (
|
||||
<ProposalSelectSection
|
||||
addresses={eip155Addresses}
|
||||
selectedAddresses={selectedAccounts[chain]}
|
||||
onSelect={onSelectAccount}
|
||||
chain={chain}
|
||||
/>
|
||||
)
|
||||
} else if (isCosmosChain(chain)) {
|
||||
return (
|
||||
<ProposalSelectSection
|
||||
addresses={cosmosAddresses}
|
||||
selectedAddresses={selectedAccounts[chain]}
|
||||
onSelect={onSelectAccount}
|
||||
chain={chain}
|
||||
/>
|
||||
)
|
||||
} else if (isSolanaChain(chain)) {
|
||||
return (
|
||||
<ProposalSelectSection
|
||||
addresses={solanaAddresses}
|
||||
selectedAddresses={selectedAccounts[chain]}
|
||||
onSelect={onSelectAccount}
|
||||
chain={chain}
|
||||
/>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<RequestModalContainer title="Session Proposal">
|
||||
<ProjectInfoCard metadata={proposer.metadata} />
|
||||
|
||||
<Divider y={2} />
|
||||
|
||||
<RequesDetailsCard chains={chains} protocol={relay.protocol} />
|
||||
{/* TODO(ilja) Relays selection */}
|
||||
|
||||
<Divider y={2} />
|
||||
|
||||
<RequestMethodCard methods={methods} />
|
||||
|
||||
{chains.map(chain => {
|
||||
if (isEIP155Chain(chain)) {
|
||||
{Object.keys(requiredNamespaces).map(chain => {
|
||||
return (
|
||||
<ProposalSelectSection
|
||||
name={EIP155_CHAINS[chain as TEIP155Chain]?.name}
|
||||
addresses={eip155Addresses}
|
||||
selectedAddresses={selectedEIP155}
|
||||
onSelect={onSelectEIP155}
|
||||
chain={chain}
|
||||
/>
|
||||
<Fragment key={chain}>
|
||||
<Text h4 css={{ marginBottom: '$5' }}>{`Review ${chain} permissions`}</Text>
|
||||
<SessionProposalChainCard requiredNamespace={requiredNamespaces[chain]} />
|
||||
{renderAccountSelection(chain)}
|
||||
<Divider y={2} />
|
||||
</Fragment>
|
||||
)
|
||||
} else if (isCosmosChain(chain)) {
|
||||
return (
|
||||
<ProposalSelectSection
|
||||
name={COSMOS_MAINNET_CHAINS[chain as TCosmosChain]?.name}
|
||||
addresses={cosmosAddresses}
|
||||
selectedAddresses={selectedCosmos}
|
||||
onSelect={onSelectCosmos}
|
||||
chain={chain}
|
||||
/>
|
||||
)
|
||||
} else if (isSolanaChain(chain)) {
|
||||
return (
|
||||
<ProposalSelectSection
|
||||
name={SOLANA_CHAINS[chain as TSolanaChain]?.name}
|
||||
addresses={solanaAddresses}
|
||||
selectedAddresses={selectedSolana}
|
||||
onSelect={onSelectSolana}
|
||||
chain={chain}
|
||||
/>
|
||||
)
|
||||
}
|
||||
})}
|
||||
</RequestModalContainer>
|
||||
|
||||
@ -144,10 +146,8 @@ export default function SessionProposalModal() {
|
||||
flat
|
||||
color="success"
|
||||
onClick={onApprove}
|
||||
disabled={!allSelected.length}
|
||||
css={{
|
||||
opacity: allSelected.length ? 1 : 0.4
|
||||
}}
|
||||
disabled={!hasSelected}
|
||||
css={{ opacity: hasSelected ? 1 : 0.4 }}
|
||||
>
|
||||
Approve
|
||||
</Button>
|
||||
|
@ -5,7 +5,7 @@ import RequestMethodCard from '@/components/RequestMethodCard'
|
||||
import RequestModalContainer from '@/components/RequestModalContainer'
|
||||
import ModalStore from '@/store/ModalStore'
|
||||
import { approveEIP155Request, rejectEIP155Request } from '@/utils/EIP155RequestHandlerUtil'
|
||||
import { walletConnectClient } from '@/utils/WalletConnectUtil'
|
||||
import { signClient } from '@/utils/WalletConnectUtil'
|
||||
import { Button, Divider, Loading, Modal, Text } from '@nextui-org/react'
|
||||
import { Fragment, useState } from 'react'
|
||||
|
||||
@ -23,16 +23,17 @@ export default function SessionSendTransactionModal() {
|
||||
|
||||
// Get required proposal data
|
||||
|
||||
const { method, params } = requestEvent.request
|
||||
const transaction = params[0]
|
||||
const { topic, params } = requestEvent
|
||||
const { request, chainId } = params
|
||||
const transaction = request.params[0]
|
||||
|
||||
// Handle approve action
|
||||
async function onApprove() {
|
||||
if (requestEvent) {
|
||||
setLoading(true)
|
||||
const response = await approveEIP155Request(requestEvent)
|
||||
await walletConnectClient.respond({
|
||||
topic: requestEvent.topic,
|
||||
await signClient.respond({
|
||||
topic,
|
||||
response
|
||||
})
|
||||
ModalStore.close()
|
||||
@ -42,9 +43,9 @@ export default function SessionSendTransactionModal() {
|
||||
// Handle reject action
|
||||
async function onReject() {
|
||||
if (requestEvent) {
|
||||
const response = rejectEIP155Request(requestEvent.request)
|
||||
await walletConnectClient.respond({
|
||||
topic: requestEvent.topic,
|
||||
const response = rejectEIP155Request(requestEvent)
|
||||
await signClient.respond({
|
||||
topic,
|
||||
response
|
||||
})
|
||||
ModalStore.close()
|
||||
@ -62,14 +63,11 @@ export default function SessionSendTransactionModal() {
|
||||
|
||||
<Divider y={2} />
|
||||
|
||||
<RequesDetailsCard
|
||||
chains={[requestEvent.chainId ?? '']}
|
||||
protocol={requestSession.relay.protocol}
|
||||
/>
|
||||
<RequesDetailsCard chains={[chainId ?? '']} protocol={requestSession.relay.protocol} />
|
||||
|
||||
<Divider y={2} />
|
||||
|
||||
<RequestMethodCard methods={[method]} />
|
||||
<RequestMethodCard methods={[request.method]} />
|
||||
</RequestModalContainer>
|
||||
|
||||
<Modal.Footer>
|
||||
|
@ -5,7 +5,7 @@ import RequestMethodCard from '@/components/RequestMethodCard'
|
||||
import RequestModalContainer from '@/components/RequestModalContainer'
|
||||
import ModalStore from '@/store/ModalStore'
|
||||
import { approveCosmosRequest, rejectCosmosRequest } from '@/utils/CosmosRequestHandler'
|
||||
import { walletConnectClient } from '@/utils/WalletConnectUtil'
|
||||
import { signClient } from '@/utils/WalletConnectUtil'
|
||||
import { Button, Divider, Modal, Text } from '@nextui-org/react'
|
||||
import { Fragment } from 'react'
|
||||
|
||||
@ -20,14 +20,15 @@ export default function SessionSignCosmosModal() {
|
||||
}
|
||||
|
||||
// Get required request data
|
||||
const { method, params } = requestEvent.request
|
||||
const { topic, params } = requestEvent
|
||||
const { chainId, request } = params
|
||||
|
||||
// Handle approve action (logic varies based on request method)
|
||||
async function onApprove() {
|
||||
if (requestEvent) {
|
||||
const response = await approveCosmosRequest(requestEvent)
|
||||
await walletConnectClient.respond({
|
||||
topic: requestEvent.topic,
|
||||
await signClient.respond({
|
||||
topic,
|
||||
response
|
||||
})
|
||||
ModalStore.close()
|
||||
@ -37,9 +38,9 @@ export default function SessionSignCosmosModal() {
|
||||
// Handle reject action
|
||||
async function onReject() {
|
||||
if (requestEvent) {
|
||||
const response = rejectCosmosRequest(requestEvent.request)
|
||||
await walletConnectClient.respond({
|
||||
topic: requestEvent.topic,
|
||||
const response = rejectCosmosRequest(requestEvent)
|
||||
await signClient.respond({
|
||||
topic,
|
||||
response
|
||||
})
|
||||
ModalStore.close()
|
||||
@ -53,10 +54,7 @@ export default function SessionSignCosmosModal() {
|
||||
|
||||
<Divider y={2} />
|
||||
|
||||
<RequesDetailsCard
|
||||
chains={[requestEvent.chainId ?? '']}
|
||||
protocol={requestSession.relay.protocol}
|
||||
/>
|
||||
<RequesDetailsCard chains={[chainId ?? '']} protocol={requestSession.relay.protocol} />
|
||||
|
||||
<Divider y={2} />
|
||||
|
||||
@ -64,7 +62,7 @@ export default function SessionSignCosmosModal() {
|
||||
|
||||
<Divider y={2} />
|
||||
|
||||
<RequestMethodCard methods={[method]} />
|
||||
<RequestMethodCard methods={[request.method]} />
|
||||
</RequestModalContainer>
|
||||
|
||||
<Modal.Footer>
|
||||
|
@ -5,7 +5,7 @@ import RequestModalContainer from '@/components/RequestModalContainer'
|
||||
import ModalStore from '@/store/ModalStore'
|
||||
import { approveEIP155Request, rejectEIP155Request } from '@/utils/EIP155RequestHandlerUtil'
|
||||
import { getSignParamsMessage } from '@/utils/HelperUtil'
|
||||
import { walletConnectClient } from '@/utils/WalletConnectUtil'
|
||||
import { signClient } from '@/utils/WalletConnectUtil'
|
||||
import { Button, Col, Divider, Modal, Row, Text } from '@nextui-org/react'
|
||||
import { Fragment } from 'react'
|
||||
|
||||
@ -20,17 +20,18 @@ export default function SessionSignModal() {
|
||||
}
|
||||
|
||||
// Get required request data
|
||||
const { method, params } = requestEvent.request
|
||||
const { topic, params } = requestEvent
|
||||
const { request, chainId } = params
|
||||
|
||||
// Get message, convert it to UTF8 string if it is valid hex
|
||||
const message = getSignParamsMessage(params)
|
||||
const message = getSignParamsMessage(request.params)
|
||||
|
||||
// Handle approve action (logic varies based on request method)
|
||||
async function onApprove() {
|
||||
if (requestEvent) {
|
||||
const response = await approveEIP155Request(requestEvent)
|
||||
await walletConnectClient.respond({
|
||||
topic: requestEvent.topic,
|
||||
await signClient.respond({
|
||||
topic,
|
||||
response
|
||||
})
|
||||
ModalStore.close()
|
||||
@ -40,9 +41,9 @@ export default function SessionSignModal() {
|
||||
// Handle reject action
|
||||
async function onReject() {
|
||||
if (requestEvent) {
|
||||
const response = rejectEIP155Request(requestEvent.request)
|
||||
await walletConnectClient.respond({
|
||||
topic: requestEvent.topic,
|
||||
const response = rejectEIP155Request(requestEvent)
|
||||
await signClient.respond({
|
||||
topic,
|
||||
response
|
||||
})
|
||||
ModalStore.close()
|
||||
@ -56,10 +57,7 @@ export default function SessionSignModal() {
|
||||
|
||||
<Divider y={2} />
|
||||
|
||||
<RequesDetailsCard
|
||||
chains={[requestEvent.chainId ?? '']}
|
||||
protocol={requestSession.relay.protocol}
|
||||
/>
|
||||
<RequesDetailsCard chains={[chainId ?? '']} protocol={requestSession.relay.protocol} />
|
||||
|
||||
<Divider y={2} />
|
||||
|
||||
@ -72,7 +70,7 @@ export default function SessionSignModal() {
|
||||
|
||||
<Divider y={2} />
|
||||
|
||||
<RequestMethodCard methods={[method]} />
|
||||
<RequestMethodCard methods={[request.method]} />
|
||||
</RequestModalContainer>
|
||||
|
||||
<Modal.Footer>
|
||||
|
@ -5,7 +5,7 @@ import RequestMethodCard from '@/components/RequestMethodCard'
|
||||
import RequestModalContainer from '@/components/RequestModalContainer'
|
||||
import ModalStore from '@/store/ModalStore'
|
||||
import { approveSolanaRequest, rejectSolanaRequest } from '@/utils/SolanaRequestHandlerUtil'
|
||||
import { walletConnectClient } from '@/utils/WalletConnectUtil'
|
||||
import { signClient } from '@/utils/WalletConnectUtil'
|
||||
import { Button, Divider, Modal, Text } from '@nextui-org/react'
|
||||
import { Fragment } from 'react'
|
||||
|
||||
@ -20,14 +20,15 @@ export default function SessionSignSolanaModal() {
|
||||
}
|
||||
|
||||
// Get required request data
|
||||
const { method, params } = requestEvent.request
|
||||
const { topic, params } = requestEvent
|
||||
const { request, chainId } = params
|
||||
|
||||
// Handle approve action (logic varies based on request method)
|
||||
async function onApprove() {
|
||||
if (requestEvent) {
|
||||
const response = await approveSolanaRequest(requestEvent)
|
||||
await walletConnectClient.respond({
|
||||
topic: requestEvent.topic,
|
||||
await signClient.respond({
|
||||
topic,
|
||||
response
|
||||
})
|
||||
ModalStore.close()
|
||||
@ -37,9 +38,9 @@ export default function SessionSignSolanaModal() {
|
||||
// Handle reject action
|
||||
async function onReject() {
|
||||
if (requestEvent) {
|
||||
const response = rejectSolanaRequest(requestEvent.request)
|
||||
await walletConnectClient.respond({
|
||||
topic: requestEvent.topic,
|
||||
const response = rejectSolanaRequest(requestEvent)
|
||||
await signClient.respond({
|
||||
topic,
|
||||
response
|
||||
})
|
||||
ModalStore.close()
|
||||
@ -53,10 +54,7 @@ export default function SessionSignSolanaModal() {
|
||||
|
||||
<Divider y={2} />
|
||||
|
||||
<RequesDetailsCard
|
||||
chains={[requestEvent.chainId ?? '']}
|
||||
protocol={requestSession.relay.protocol}
|
||||
/>
|
||||
<RequesDetailsCard chains={[chainId ?? '']} protocol={requestSession.relay.protocol} />
|
||||
|
||||
<Divider y={2} />
|
||||
|
||||
@ -64,7 +62,7 @@ export default function SessionSignSolanaModal() {
|
||||
|
||||
<Divider y={2} />
|
||||
|
||||
<RequestMethodCard methods={[method]} />
|
||||
<RequestMethodCard methods={[request.method]} />
|
||||
</RequestModalContainer>
|
||||
|
||||
<Modal.Footer>
|
||||
|
@ -6,7 +6,7 @@ import RequestModalContainer from '@/components/RequestModalContainer'
|
||||
import ModalStore from '@/store/ModalStore'
|
||||
import { approveEIP155Request, rejectEIP155Request } from '@/utils/EIP155RequestHandlerUtil'
|
||||
import { getSignTypedDataParamsData } from '@/utils/HelperUtil'
|
||||
import { walletConnectClient } from '@/utils/WalletConnectUtil'
|
||||
import { signClient } from '@/utils/WalletConnectUtil'
|
||||
import { Button, Divider, Modal, Text } from '@nextui-org/react'
|
||||
import { Fragment } from 'react'
|
||||
|
||||
@ -21,17 +21,18 @@ export default function SessionSignTypedDataModal() {
|
||||
}
|
||||
|
||||
// Get required request data
|
||||
const { method, params } = requestEvent.request
|
||||
const { topic, params } = requestEvent
|
||||
const { request, chainId } = params
|
||||
|
||||
// Get data
|
||||
const data = getSignTypedDataParamsData(params)
|
||||
const data = getSignTypedDataParamsData(request.params)
|
||||
|
||||
// Handle approve action (logic varies based on request method)
|
||||
async function onApprove() {
|
||||
if (requestEvent) {
|
||||
const response = await approveEIP155Request(requestEvent)
|
||||
await walletConnectClient.respond({
|
||||
topic: requestEvent.topic,
|
||||
await signClient.respond({
|
||||
topic,
|
||||
response
|
||||
})
|
||||
ModalStore.close()
|
||||
@ -41,9 +42,9 @@ export default function SessionSignTypedDataModal() {
|
||||
// Handle reject action
|
||||
async function onReject() {
|
||||
if (requestEvent) {
|
||||
const response = rejectEIP155Request(requestEvent.request)
|
||||
await walletConnectClient.respond({
|
||||
topic: requestEvent.topic,
|
||||
const response = rejectEIP155Request(requestEvent)
|
||||
await signClient.respond({
|
||||
topic,
|
||||
response
|
||||
})
|
||||
ModalStore.close()
|
||||
@ -57,10 +58,7 @@ export default function SessionSignTypedDataModal() {
|
||||
|
||||
<Divider y={2} />
|
||||
|
||||
<RequesDetailsCard
|
||||
chains={[requestEvent.chainId ?? '']}
|
||||
protocol={requestSession.relay.protocol}
|
||||
/>
|
||||
<RequesDetailsCard chains={[chainId ?? '']} protocol={requestSession.relay.protocol} />
|
||||
|
||||
<Divider y={2} />
|
||||
|
||||
@ -68,7 +66,7 @@ export default function SessionSignTypedDataModal() {
|
||||
|
||||
<Divider y={2} />
|
||||
|
||||
<RequestMethodCard methods={[method]} />
|
||||
<RequestMethodCard methods={[request.method]} />
|
||||
</RequestModalContainer>
|
||||
|
||||
<Modal.Footer>
|
||||
|
@ -17,7 +17,8 @@ export default function SessionUnsuportedMethodModal() {
|
||||
}
|
||||
|
||||
// Get required request data
|
||||
const { method } = requestEvent.request
|
||||
const { topic, params } = requestEvent
|
||||
const { chainId, request } = params
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
@ -26,14 +27,11 @@ export default function SessionUnsuportedMethodModal() {
|
||||
|
||||
<Divider y={2} />
|
||||
|
||||
<RequesDetailsCard
|
||||
chains={[requestEvent.chainId ?? '']}
|
||||
protocol={requestSession.relay.protocol}
|
||||
/>
|
||||
<RequesDetailsCard chains={[chainId ?? '']} protocol={requestSession.relay.protocol} />
|
||||
|
||||
<Divider y={2} />
|
||||
|
||||
<RequestMethodCard methods={[method]} />
|
||||
<RequestMethodCard methods={[request.method]} />
|
||||
</RequestModalContainer>
|
||||
|
||||
<Modal.Footer>
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user