solid-algo-wallets
Version:
Integrate multiple Algorand wallets with a SolidJS web application client
1,070 lines (1,063 loc) • 145 kB
JSX
// src/useSolidAlgoWallets.tsx
import { makePersisted } from "@solid-primitives/storage";
import { createRoot as createRoot9, createSignal as createSignal9 } from "solid-js";
// src/wallets/exodus.tsx
import { createRoot, createSignal } from "solid-js";
function UseExodus() {
const [walletClient, setWalletClient] = createSignal();
const [accounts, setAccounts] = createSignal([]);
const name = "Exodus";
function icon() {
return <svg
height="32"
viewBox="0 0 300 300"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M298.203 83.7645L170.449 0V46.8332L252.405 100.089L242.763 130.598H170.449V169.402H242.763L252.405 199.911L170.449 253.167V300L298.203 216.503L277.313 150.134L298.203 83.7645Z"
fill="url(#paint0_linear_1661_295)"
/>
<path
d="M59.3007 169.402H131.346V130.598H59.0329L49.6589 100.089L131.346 46.8332V0L3.59253 83.7645L24.4831 150.134L3.59253 216.503L131.614 300V253.167L49.6589 199.911L59.3007 169.402Z"
fill="url(#paint1_linear_1661_295)"
/>
<mask
id="mask0_1661_295"
style="mask-type:alpha"
maskUnits="userSpaceOnUse"
x="3"
y="0"
width="296"
height="300"
>
<path
d="M298.204 83.7645L170.45 0V46.8332L252.405 100.089L242.763 130.598H170.45V169.402H242.763L252.405 199.911L170.45 253.167V300L298.204 216.503L277.313 150.134L298.204 83.7645Z"
fill="url(#paint2_linear_1661_295)"
/>
<path
d="M59.301 169.402H131.347V130.598H59.0332L49.6592 100.089L131.347 46.8332V0L3.59277 83.7645L24.4834 150.134L3.59277 216.503L131.615 300V253.167L49.6592 199.911L59.301 169.402Z"
fill="url(#paint3_linear_1661_295)"
/>
</mask>
<g mask="url(#mask0_1661_295)"><rect
x="3.75024"
width="292.5"
height="300"
fill="url(#paint4_linear_1661_295)"
/></g>
<defs>
<linearGradient
id="paint0_linear_1661_295"
x1="256.875"
y1="320.625"
x2="171.3"
y2="-32.9459"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#0B46F9" />
<stop
offset="1"
stop-color="#BBFBE0"
/>
</linearGradient>
<linearGradient
id="paint1_linear_1661_295"
x1="256.875"
y1="320.625"
x2="171.3"
y2="-32.9459"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#0B46F9" />
<stop
offset="1"
stop-color="#BBFBE0"
/>
</linearGradient>
<linearGradient
id="paint2_linear_1661_295"
x1="256.875"
y1="320.625"
x2="171.3"
y2="-32.9459"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#0B46F9" />
<stop
offset="1"
stop-color="#BBFBE0"
/>
</linearGradient>
<linearGradient
id="paint3_linear_1661_295"
x1="256.875"
y1="320.625"
x2="171.3"
y2="-32.9459"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#0B46F9" />
<stop
offset="1"
stop-color="#BBFBE0"
/>
</linearGradient>
<linearGradient
id="paint4_linear_1661_295"
x1="22.5002"
y1="67.5"
x2="170.625"
y2="178.125"
gradientUnits="userSpaceOnUse"
>
<stop
offset="0.119792"
stop-color="#8952FF"
stop-opacity="0.87"
/>
<stop
offset="1"
stop-color="#DABDFF"
stop-opacity="0"
/>
</linearGradient>
</defs>
</svg>;
}
function image() {
return <svg
height="32"
viewBox="0 0 1000 206"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M204.107 57.3331L116.665 0V32.0552L172.76 68.5066L166.161 89.3883H116.665V115.948H166.161L172.76 136.83L116.665 173.281V205.337L204.107 148.187L189.808 102.76L204.107 57.3331Z"
fill="url(#paint0_linear_1661_261)"
/>
<path
d="M40.5888 115.948H89.9009V89.3883H40.4055L33.9894 68.5066L89.9009 32.0552V0L2.45898 57.3331L16.7577 102.76L2.45898 148.187L90.0842 205.337V173.281L33.9894 136.83L40.5888 115.948Z"
fill="url(#paint1_linear_1661_261)"
/>
<mask
id="mask0_1661_261"
style="mask-type:alpha"
maskUnits="userSpaceOnUse"
x="2"
y="0"
width="203"
height="206"
>
<path
d="M204.107 57.3331L116.665 0V32.0552L172.76 68.5066L166.161 89.3883H116.665V115.948H166.161L172.76 136.83L116.665 173.281V205.337L204.107 148.187L189.809 102.76L204.107 57.3331Z"
fill="url(#paint2_linear_1661_261)"
/>
<path
d="M40.589 115.948H89.9012V89.3883H40.4057L33.9897 68.5066L89.9012 32.0552V0L2.45923 57.3331L16.7579 102.76L2.45923 148.187L90.0845 205.337V173.281L33.9897 136.83L40.589 115.948Z"
fill="url(#paint3_linear_1661_261)"
/>
</mask>
<g mask="url(#mask0_1661_261)"><rect
x="2.56689"
width="200.203"
height="205.337"
fill="url(#paint4_linear_1661_261)"
/></g>
<path
d="M378.076 56.4673V74.4188H295.347V92.7878H365.639V110.739H295.347V130.917H378.076V148.869H274.124V56.4673H378.076Z"
fill="#1F2033"
/>
<path
d="M389.809 148.869L437.339 102.111L391.156 56.4673H420.374L452.959 89.4479L484.197 56.4673H511.53L465.481 102.111L513.011 148.869H483.523L452.959 114.914L418.085 148.869H389.809V148.869Z"
fill="#1F2033"
/>
<path
d="M570.006 56.4673C608.515 56.4673 631.673 75.7511 631.673 102.668C631.673 129.585 608.515 148.869 570.006 148.869C531.497 148.869 508.471 129.585 508.471 102.668C508.471 75.7511 531.497 56.4673 570.006 56.4673ZM570.006 73.7423C546.848 73.7423 529.777 85.393 529.777 102.668C529.777 119.943 546.848 131.594 570.006 131.594C593.297 131.594 610.368 119.943 610.368 102.668C610.368 85.393 593.297 73.7423 570.006 73.7423Z"
fill="#1F2033"
/>
<path
d="M708.434 56.4673C739.276 56.4673 757.862 73.5838 757.862 102.529C757.862 131.752 739.411 148.869 708.703 148.869H646.211V56.4673H708.434ZM736.044 102.529C736.044 84.4382 725.269 74.4188 705.74 74.4188H667.356V130.917H705.74C725.269 130.917 736.044 120.759 736.044 102.529Z"
fill="#1F2033"
/>
<path
d="M827.799 148.869C795.32 148.869 770.69 134.128 770.69 106.967V56.4673H791.937V104.92C791.937 121.708 809.394 129.488 827.799 129.488C846.339 129.488 863.797 121.844 863.797 104.92V56.4673H884.908V106.967C884.908 134.128 860.414 148.869 827.799 148.869Z"
fill="#1F2033"
/>
<path
d="M944.383 148.869C926.935 148.869 908.124 145.655 894.765 139.629L901.717 122.487C913.713 127.978 930.207 131.46 945.065 131.46C962.104 131.46 978.053 127.844 978.053 121.416C978.053 116.729 973.01 114.72 962.513 113.113L932.797 109.899C909.896 106.819 898.718 98.9184 898.718 84.9912C898.718 67.0466 917.666 56.4673 945.474 56.4673C962.241 56.4673 985.278 59.5473 997.137 64.9039L990.185 81.2416C978.462 76.4206 958.56 74.0102 944.52 74.0102C930.07 74.0102 920.528 77.3581 920.528 83.5182C920.528 87.8034 925.299 89.9461 937.568 91.687L966.466 94.9009C988.549 97.981 1000 105.48 1000 120.077C1000 138.557 975.736 148.869 944.383 148.869Z"
fill="#1F2033"
/>
<defs>
<linearGradient
id="paint0_linear_1661_261"
x1="175.82"
y1="219.454"
x2="117.247"
y2="-22.55"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#0B46F9" />
<stop
offset="1"
stop-color="#BBFBE0"
/>
</linearGradient>
<linearGradient
id="paint1_linear_1661_261"
x1="175.82"
y1="219.454"
x2="117.247"
y2="-22.55"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#0B46F9" />
<stop
offset="1"
stop-color="#BBFBE0"
/>
</linearGradient>
<linearGradient
id="paint2_linear_1661_261"
x1="175.82"
y1="219.454"
x2="117.247"
y2="-22.55"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#0B46F9" />
<stop
offset="1"
stop-color="#BBFBE0"
/>
</linearGradient>
<linearGradient
id="paint3_linear_1661_261"
x1="175.82"
y1="219.454"
x2="117.247"
y2="-22.55"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#0B46F9" />
<stop
offset="1"
stop-color="#BBFBE0"
/>
</linearGradient>
<linearGradient
id="paint4_linear_1661_261"
x1="15.4004"
y1="46.2008"
x2="116.785"
y2="121.919"
gradientUnits="userSpaceOnUse"
>
<stop
offset="0.119792"
stop-color="#8952FF"
stop-opacity="0.87"
/>
<stop
offset="1"
stop-color="#DABDFF"
stop-opacity="0"
/>
</linearGradient>
</defs>
</svg>;
}
async function getClient() {
const client = walletClient();
if (client !== void 0) {
return client;
} else {
if (typeof window == "undefined" || window.algorand === void 0) {
throw new Error("Exodus is not available");
}
const client2 = window.algorand;
setWalletClient(client2);
return client2;
}
}
async function connect() {
console.debug("Exodus: connect");
const client = await getClient();
const resp = await client.enable();
const accounts2 = resp.accounts;
if (accounts2.length === 0) {
throw new Error(`No accounts found`);
}
const walletAccounts = accounts2.map((account, index) => ({
address: account,
name: `Exodus ${index}`
}));
setAccounts(walletAccounts);
console.debug(walletAccounts);
return walletAccounts;
}
async function reconnect() {
console.debug("Exodus: reconnect");
return await connect();
}
function disconnect() {
setWalletClient(void 0);
setAccounts([]);
}
async function transactionSigner(txnGroup, indexesToSign) {
console.debug("txnGroup: ", txnGroup);
console.debug("indexesToSign: ", indexesToSign);
const client = walletClient();
if (client) {
const txnsToSign = txnGroup.reduce((acc, txn, idx) => {
if (indexesToSign.includes(idx)) {
const walletTxn = {
txn: Buffer.from(txn.toByte()).toString("base64")
};
acc.push(walletTxn);
}
return acc;
}, []);
console.debug("txnsToSign: ", txnsToSign);
const signingResult = await client.signTxns(txnsToSign);
console.debug("Signing result: ", signingResult);
const signedTxnGroup = txnGroup.reduce((acc, txn, idx) => {
if (indexesToSign.includes(idx)) {
const nextSignedTxn = signingResult.shift();
if (nextSignedTxn) {
acc.push(new Uint8Array(Buffer.from(nextSignedTxn, "base64")));
} else {
throw new Error("Error reconstructing signedTxns array");
}
} else {
acc.push(txn.toByte());
}
return acc;
}, []);
return signedTxnGroup;
} else {
throw new Error("Wallet client is not initialized");
}
}
return {
name,
icon,
image,
accounts,
connect,
disconnect,
reconnect,
transactionSigner
};
}
var exodus_default = createRoot(UseExodus);
// src/wallets/ledger.tsx
import { encodeAddress } from "algosdk";
import { createRoot as createRoot2, createSignal as createSignal2 } from "solid-js";
function UseLedger() {
const [walletClient, setWalletClient] = createSignal2();
const [accounts, setAccounts] = createSignal2([]);
const name = "Ledger";
function icon() {
return <svg
version="1.1"
id="Layer_1"
xmlns="http://www.w3.org/2000/svg"
x="0px"
y="0px"
viewBox="0 0 768.91 669.35"
style="enable-background:new 0 0 768.91 669.35;"
fill="black"
height="32"
><path
d={"M0,479.29v190.06h289.22V627.2H42.14V479.29H0z M726.77,479.29V627.2H479.69v42.14h289.22V479.29H726.77z M289.64,190.06\n v289.22h190.05v-38.01H331.78V190.06H289.64z M0,0v190.06h42.14V42.14h247.08V0H0z M479.69,0v42.14h247.08v147.92h42.14V0H479.69z"}
/></svg>;
}
function image() {
return <svg
enable-background="new 0 0 2000.58 669.35"
viewBox="0 0 2000.58 669.35"
height="32"
xmlns="http://www.w3.org/2000/svg"
><path d="m1711.35 627.2v42.14h289.22v-190.05h-42.14v147.91zm0-627.2v42.14h247.08v147.92h42.14v-190.06zm-149.15 326v-97.92h66.11c32.23 0 43.8 10.74 43.8 40.08v17.35c0 30.16-11.16 40.49-43.8 40.49zm104.94 17.35c30.16-7.85 51.23-35.95 51.23-69.41 0-21.07-8.26-40.08-23.96-55.37-19.83-19.01-46.28-28.51-80.57-28.51h-92.96v289.22h41.32v-115.27h61.98c31.81 0 44.62 13.22 44.62 46.28v69h42.14v-62.39c0-45.45-10.74-62.8-43.8-67.76zm-347.88 9.5h127.26v-38.01h-127.26v-86.77h139.65v-38.01h-181.8v289.22h188v-38.01h-145.85zm-138.42 15.29v19.83c0 41.73-15.29 55.37-53.71 55.37h-9.09c-38.43 0-57.02-12.4-57.02-69.83v-77.68c0-57.84 19.42-69.83 57.84-69.83h8.26c37.6 0 49.58 14.05 49.99 52.89h45.45c-4.13-57.02-42.14-92.96-99.16-92.96-27.68 0-50.82 8.68-68.17 25.2-26.03 24.38-40.49 65.7-40.49 123.54 0 55.78 12.4 97.1 38.01 122.71 17.35 16.94 41.32 26.03 64.87 26.03 24.79 0 47.52-9.92 59.08-31.4h5.78v27.27h38.01v-149.15h-111.97v38.01zm-364.41-140.07h45.04c42.56 0 65.7 10.74 65.7 68.59v76.02c0 57.84-23.14 68.59-65.7 68.59h-45.04zm48.75 251.22c78.92 0 108.25-59.91 108.25-144.61 0-85.94-31.4-144.61-109.08-144.61h-89.25v289.22zm-289.63-126.44h127.26v-38.01h-127.26v-86.77h139.65v-38.01h-181.8v289.22h188v-38.01h-145.85zm-243.77-162.79h-42.14v289.22h190.06v-38.01h-147.92zm-331.78 289.23v190.06h289.22v-42.15h-247.08v-147.91zm0-479.29v190.06h42.14v-147.92h247.08v-42.14z" /></svg>;
}
async function getClient() {
const client = walletClient();
if (client) {
return client;
} else {
const Algorand = (await import("@ledgerhq/hw-app-algorand")).default;
const TransportWebUSB = (await import("@ledgerhq/hw-transport-webusb")).default;
try {
const transport = await TransportWebUSB.create();
const client2 = new Algorand(transport);
setWalletClient(client2);
return client2;
} catch (e) {
console.error(e);
}
}
}
async function connect() {
console.debug("Ledger: connect");
const client = await getClient();
const numOfAccs = 3;
const walletAccounts = [];
if (client) {
for (let i = 0; i < numOfAccs; i++) {
const name2 = `Ledger ${i}`;
const path = `44'/283'/${i}'/0/0`;
try {
const { address } = await client.getAddress(path);
walletAccounts.push({ address, name: name2 });
} catch (e) {
const confirmResp = window.confirm(
"Your Ledger device is locked. To connect it, unlock it first and then click OK."
);
if (confirmResp) {
const { address } = await client.getAddress(path);
walletAccounts.push({ address, name: name2 });
} else {
disconnect();
break;
}
}
}
}
setAccounts(walletAccounts);
return walletAccounts;
}
async function reconnect() {
console.debug("Ledger: reconnect");
return await connect();
}
function disconnect() {
setWalletClient(void 0);
setAccounts([]);
}
async function transactionSigner(txnGroup, indexesToSign) {
console.debug("txnGroup: ", txnGroup);
console.debug("indexesToSign: ", indexesToSign);
const client = walletClient();
if (client) {
const signedtxnGroup = [];
for (const [idx, txn] of txnGroup.entries()) {
if (indexesToSign.includes(idx)) {
const senderAddr = encodeAddress(txn.from.publicKey);
const pathIndex = accounts().findIndex((acc) => acc.address === senderAddr);
if (pathIndex >= 0) {
const unsignedTxnHex = Buffer.from(txn.toByte()).toString("hex");
const { signature } = await client.sign(`44'/283'/${pathIndex}'/0/0`, unsignedTxnHex);
if (signature) {
const sigBytes = new Uint8Array(signature).slice(0, 64);
const signedTxn = txn.attachSignature(senderAddr, sigBytes);
signedtxnGroup.push(signedTxn);
} else
throw new Error("Error signing with Ledger");
} else
throw new Error(`Ledger signing path not found for sender ${senderAddr}`);
} else
signedtxnGroup.push(txn.toByte());
}
return signedtxnGroup;
} else {
throw new Error("Wallet client is not initialized");
}
}
return {
name,
icon,
image,
accounts,
connect,
disconnect,
reconnect,
transactionSigner
};
}
var ledger_default = createRoot2(UseLedger);
// src/wallets/pera.tsx
import { PeraWalletConnect } from "@perawallet/connect";
import { createRoot as createRoot3, createSignal as createSignal3 } from "solid-js";
function UsePera() {
const [walletClient, setWalletClient] = createSignal3();
const [accounts, setAccounts] = createSignal3([]);
const name = "Pera";
function icon() {
return <svg
height="32"
viewBox="0 0 86 96"
fill="black"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M48.5471 14.107C50.5942 22.5886 49.9022 30.0494 47.0014 30.771C44.1007 31.4926 40.0896 25.202 38.0425 16.7203C35.9953 8.23873 36.6874 0.778021 39.5881 0.056374C42.4889 -0.665273 46.4999 5.62542 48.5471 14.107Z" />
<path d="M82.3504 21.3992C77.8168 16.5942 68.7972 17.8966 62.2045 24.3081C55.6118 30.7196 53.9426 39.8123 58.4762 44.6173C63.0098 49.4222 72.0294 48.1199 78.6221 41.7084C85.2148 35.2969 86.884 26.2041 82.3504 21.3992Z" />
<path d="M46.2926 94.9747C49.1934 94.253 49.7835 86.3702 47.6107 77.368C45.4379 68.3657 41.325 61.653 38.4242 62.3746C35.5235 63.0963 34.9333 70.9791 37.1061 79.9813C39.2789 88.9836 43.3918 95.6963 46.2926 94.9747Z" />
<path d="M16.7223 25.7982C25.0912 28.2661 31.2064 32.5958 30.3809 35.4687C29.5555 38.3417 22.1021 38.67 13.7332 36.2021C5.36438 33.7341 -0.750778 29.4045 0.0746392 26.5315C0.900056 23.6586 8.35349 23.3302 16.7223 25.7982Z" />
<path d="M71.0398 58.2396C79.9223 60.859 86.4539 65.3115 85.6285 68.1844C84.8031 71.0574 76.9332 71.2629 68.0507 68.6435C59.1681 66.024 52.6365 61.5716 53.4619 58.6986C54.2873 55.8257 62.1572 55.6201 71.0398 58.2396Z" />
<path d="M26.1392 52.2116C24.0639 50.0603 17.2567 53.1913 10.935 59.205C4.61326 65.2187 1.17089 71.8377 3.24624 73.989C5.32159 76.1403 12.1288 73.0093 18.4505 66.9956C24.7722 60.9819 28.2146 54.3629 26.1392 52.2116Z" />
</svg>;
}
function image() {
return <svg
height="32"
viewBox="0 0 660 246"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
>
<title>pera-logo-black@1x</title>
<g
id="Page-1"
stroke="none"
stroke-width="1"
fill="none"
fill-rule="evenodd"
><g
id="pera-logo-black"
transform="translate(0, -0)"
fill-rule="nonzero"
>
<path
d="M125.396286,36.4381132 C130.683286,58.3459132 128.896286,77.6163132 121.403286,79.4803132 C113.911286,81.3443132 103.550286,65.0961132 98.2632858,43.1883132 C92.9752858,21.2805132 94.7622858,2.00961322 102.255286,0.145613215 C109.748286,-1.71838678 120.108286,14.5303132 125.396286,36.4381132 Z"
id="Path"
fill="#000000"
/>
<path
d="M212.709286,55.2736132 C200.999286,42.8625132 177.701286,46.2264132 160.672286,62.7872132 C143.644286,79.3483132 139.332286,102.834313 151.042286,115.245313 C162.753286,127.656313 186.050286,124.292313 203.079286,107.731313 C220.107286,91.1713132 224.419286,67.6847132 212.709286,55.2736132 Z"
id="Path"
fill="#000000"
/>
<path
d="M119.572286,245.317313 C127.065286,243.453313 128.589286,223.092313 122.977286,199.839313 C117.365286,176.587313 106.741286,159.248313 99.2492858,161.112313 C91.7562858,162.976313 90.2322858,183.337313 95.8442858,206.590313 C101.456286,229.842313 112.080286,247.181313 119.572286,245.317313 Z"
id="Path"
fill="#000000"
/>
<path
d="M43.1933858,66.6361132 C64.8102858,73.0103132 80.6052858,84.1943132 78.4732858,91.6153132 C76.3412858,99.0353132 57.0891858,99.8833132 35.4726858,93.5093132 C13.8560858,87.1343132 -1.93921418,75.9513132 0.192785819,68.5303132 C2.32488582,61.1096132 21.5768858,60.2615132 43.1933858,66.6361132 Z"
id="Path"
fill="#000000"
/>
<path
d="M183.494286,150.431313 C206.437286,157.197313 223.308286,168.698313 221.176286,176.118313 C219.044286,183.539313 198.716286,184.070313 175.773286,177.304313 C152.830286,170.538313 135.959286,159.038313 138.091286,151.617313 C140.223286,144.196313 160.550286,143.665313 183.494286,150.431313 Z"
id="Path"
fill="#000000"
/>
<path
d="M67.5172858,134.861313 C62.1562858,129.304313 44.5736858,137.392313 28.2448858,152.925313 C11.9159858,168.458313 3.02438582,185.555313 8.38498582,191.112313 C13.7455858,196.668313 31.3282858,188.581313 47.6571858,173.048313 C63.9862858,157.515313 72.8772858,140.418313 67.5172858,134.861313 Z"
id="Path"
fill="#000000"
/>
<path
d="M307.475286,68.9323132 L307.475286,64.1800132 L287.886286,64.1800132 L287.886286,190.909313 L307.475286,190.909313 L307.475286,156.762313 C307.475286,153.066313 307.475286,150.074313 307.118286,146.026313 L307.475286,146.026313 C314.598286,157.643313 326.707286,163.803313 340.952286,163.803313 C364.992286,163.803313 386.005286,145.674313 386.005286,112.055313 C386.005286,79.1413132 364.992286,61.3638132 340.952286,61.3638132 C327.241286,61.3638132 315.132286,67.3482132 307.475286,79.1413132 L307.118286,79.1413132 C307.475286,75.2683132 307.475286,72.4526132 307.475286,68.9323132 Z M335.966286,147.082313 C317.803286,146.906313 307.296286,131.593313 307.296286,111.879313 C307.296286,93.2223132 317.803286,78.2613132 335.966286,78.0853132 C353.774286,77.9093132 365.527286,91.6383132 365.527286,112.055313 C365.527286,133.001313 353.774286,147.258313 335.966286,147.082313 Z"
id="Shape"
fill="#0D0D0D"
/>
<path
d="M488.865286,103.783313 C488.865286,79.4933132 469.277286,61.3638132 442.566286,61.3638132 C414.074286,61.3638132 394.308286,80.5493132 394.308286,112.583313 C394.308286,143.385313 413.718286,163.803313 442.566286,163.803313 C466.249286,163.803313 483.879286,150.074313 487.974286,131.241313 L466.606286,131.241313 C463.222286,140.745313 453.962286,147.082313 442.566286,147.082313 C427.964286,147.082313 417.279286,136.697313 414.964286,119.448313 L488.865286,119.448313 L488.865286,103.783313 Z M442.566286,78.0853132 C456.990286,78.0853132 466.962286,87.9413132 469.099286,102.198313 L415.142286,102.198313 C417.635286,88.4693132 427.786286,78.0853132 442.566286,78.0853132 Z"
id="Shape"
fill="#0D0D0D"
/>
<path
d="M503.265286,160.987313 L522.853286,160.987313 L522.853286,106.423313 C522.853286,87.7653132 533.181286,78.0853132 549.208286,78.0853132 L559.714286,78.0853132 L559.714286,61.3638132 L551.345286,61.3638132 C536.921286,61.3638132 528.017286,70.8685132 522.853286,79.1413132 L522.497286,79.1413132 L522.497286,64.1800132 L503.265286,64.1800132 L503.265286,160.987313 Z"
id="Path"
fill="#0D0D0D"
/>
<path
d="M651.286286,144.090313 C648.615286,144.090313 647.368286,142.505313 647.368286,139.337313 L647.368286,96.7423132 C647.368286,76.3253132 637.396286,61.3638132 608.014286,61.3638132 C579.522286,61.3638132 566.523286,75.4453132 565.098286,95.5103132 L584.686286,95.5103132 C585.933286,84.5973132 594.659286,78.0853132 608.014286,78.0853132 C619.411286,78.0853132 627.246286,83.0133132 627.246286,90.7583132 C627.246286,97.0943132 622.794286,100.966313 608.192286,100.966313 L600.357286,100.966313 C577.029286,100.966313 561.359286,110.295313 561.359286,131.593313 C561.359286,153.946313 577.920286,164.155313 597.330286,164.155313 C611.754286,164.155313 624.041286,157.819313 628.849286,144.266313 C629.383286,154.122313 635.972286,160.987313 648.437286,160.987313 L659.477286,160.987313 L659.477286,144.090313 L651.286286,144.090313 Z M627.780286,115.927313 C627.780286,137.753313 615.849286,147.258313 600.535286,147.258313 C587.179286,147.258313 581.837286,139.513313 581.837286,131.593313 C581.837286,124.024313 586.467286,117.864313 600.713286,117.864313 L603.562286,117.864313 C617.274286,117.864313 625.821286,113.111313 627.602286,104.839313 L627.780286,104.839313 L627.780286,115.927313 Z"
id="Shape"
fill="#0D0D0D"
/>
</g></g>
</svg>;
}
async function getClient() {
const client = walletClient();
if (client) {
return client;
} else {
const client2 = new PeraWalletConnect({
// shouldShowSignTxnToast: false, // Enabled by default
// chainId,
// chainId: 416001, // MainNet
// chainId: 416002, // TestNet
// chainId: 416003, // BetaNet
// chainId: 4160, // All networks
});
console.debug("Pera Client: ", client2);
setWalletClient(client2);
return client2;
}
}
async function connect(onDisconnect) {
console.debug("Pera: connect");
const client = await getClient();
try {
const accounts2 = await client.connect();
if (accounts2.length === 0) {
throw new Error("No accounts found");
}
const walletAccounts = accounts2.map((address, index) => ({
name: `Pera Wallet ${index + 1}`,
address
}));
client.connector?.on("disconnect", (event) => {
console.debug("Disconnect from Pera");
event && console.debug("Event message: ", event.message);
onDisconnect();
});
setAccounts(walletAccounts);
return walletAccounts;
} catch (error) {
if (error?.data?.type !== "CONNECT_MODAL_CLOSED") {
console.log(error);
}
return [];
}
}
async function reconnect(onDisconnect) {
console.debug("Pera: reconnect");
const client = await getClient();
try {
const accounts2 = await client.reconnectSession();
if (accounts2.length === 0) {
throw new Error("No accounts found");
}
const walletAccounts = accounts2.map((address, index) => ({
name: `Pera Wallet ${index + 1}`,
address
}));
client.connector?.on("disconnect", (event) => {
console.debug("Disconnect from Pera");
event && console.debug("Event message: ", event.message);
onDisconnect();
});
setAccounts(walletAccounts);
return walletAccounts;
} catch (error) {
if (error?.data?.type !== "CONNECT_MODAL_CLOSED") {
console.log(error);
}
onDisconnect();
return [];
}
}
async function disconnect(onDisconnect) {
console.debug("Disconnecting Pera");
const client = walletClient();
if (client) {
await client.disconnect().catch((error) => {
console.error("Error disconnecting Pera", error);
});
}
console.debug("Pera disconnected");
setAccounts([]);
onDisconnect();
}
async function transactionSigner(txnGroup, indexesToSign) {
const client = walletClient();
if (client) {
const txnsToSign = txnGroup.reduce((acc, txn, idx) => {
if (indexesToSign.includes(idx)) {
acc.push({ txn });
} else {
acc.push({ txn, signers: [] });
}
return acc;
}, []);
console.debug("txnsToSign: ", txnsToSign);
const signingResult = await client.signTransaction([txnsToSign]);
return signingResult;
} else {
throw new Error("Wallet client is not initialized");
}
}
return {
name,
icon,
image,
accounts,
connect,
disconnect,
reconnect,
transactionSigner
};
}
var pera_default = createRoot3(UsePera);
// src/wallets/defly.tsx
import { DeflyWalletConnect } from "@blockshake/defly-connect";
import { createRoot as createRoot4, createSignal as createSignal4 } from "solid-js";
function UseDefly() {
const [walletClient, setWalletClient] = createSignal4();
const [accounts, setAccounts] = createSignal4([]);
const name = "Defly";
function icon() {
return <svg
height="32"
viewBox="0 0 340 320"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M327.049 280.192L169.524 13L12 280.192L169.524 189.084L327.049 280.192Z" />
<path d="M299.546 307L169.525 238.473L39.5039 307L169.525 264.67L299.546 307Z" />
</svg>;
}
function image() {
return <svg
height="32"
viewBox="0 0 980 340"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M446 279.676C435.568 279.676 426.603 276.865 419.105 271.241C411.607 265.536 405.861 257.508 401.868 247.158C397.956 236.808 396 224.664 396 210.728C396 196.303 398.2 183.996 402.601 173.809C407.002 163.54 413.156 155.716 421.061 150.337C428.966 144.877 438.094 142.146 448.445 142.146C455.128 142.146 460.873 143.287 465.682 145.569C470.572 147.851 474.524 150.908 477.54 154.738C480.555 158.568 482.552 162.766 483.53 167.33L487.931 179.799L481.941 188.479C481.126 185.382 479.74 182.733 477.784 180.532C475.91 178.251 473.465 176.498 470.449 175.276C467.516 174.053 464.011 173.442 459.936 173.442C451.705 173.442 445.307 176.58 440.743 182.855C436.261 189.049 434.019 198.585 434.019 211.461C434.019 223.768 436.179 233.018 440.499 239.212C444.899 245.406 451.256 248.503 459.569 248.503C463.563 248.503 467.149 247.932 470.327 246.791C473.587 245.569 476.236 244.102 478.273 242.39C480.311 240.597 481.533 238.845 481.941 237.134L483.408 238.723L481.941 246.791C480.8 251.681 479.251 256.164 477.295 260.239C475.339 264.232 472.935 267.696 470.083 270.63C467.23 273.482 463.807 275.724 459.814 277.354C455.902 278.902 451.297 279.676 446 279.676ZM482.063 278.087L481.941 87.8679H519.838V278.087H482.063Z" />
<path d="M607.332 279.921C593.803 279.921 582.271 277.231 572.735 271.852C563.2 266.473 555.906 258.69 550.853 248.503C545.8 238.234 543.273 225.846 543.273 211.339C543.273 196.343 545.963 183.711 551.342 173.442C556.721 163.092 564.3 155.268 574.08 149.97C583.86 144.673 595.311 142.024 608.432 142.024C621.146 142.024 631.822 144.428 640.461 149.237C649.182 154.045 655.783 161.136 660.265 170.508C664.748 179.88 666.989 191.413 666.989 205.104C666.989 206.816 666.908 208.813 666.745 211.095C666.663 213.295 666.541 215.822 666.378 218.674H580.559C581.456 229.758 584.145 237.867 588.628 243.002C593.11 248.055 599.386 250.581 607.454 250.581C614.137 250.581 619.19 249.114 622.613 246.18C626.117 243.246 628.196 239.375 628.848 234.566H665.278C664.544 243.776 661.732 251.804 656.842 258.649C652.034 265.414 645.433 270.671 637.038 274.42C628.644 278.087 618.742 279.921 607.332 279.921ZM596.085 197.281H630.437C630.111 188.723 628.033 182.325 624.202 178.088C620.453 173.85 614.667 171.731 606.843 171.731C597.633 171.731 590.91 175.031 586.672 181.633C582.434 188.153 580.274 197.444 580.193 209.505C580.845 204.86 582.434 201.682 584.96 199.97C587.487 198.177 591.195 197.281 596.085 197.281Z" />
<path d="M697.196 278.087V186.767C697.196 182.692 697.889 179.758 699.274 177.965C700.741 176.172 702.779 174.95 705.387 174.298L697.196 150.093V128.821C697.196 118.389 699.274 109.71 703.431 102.782C707.587 95.8549 713.17 90.6797 720.179 87.2567C727.188 83.7522 734.889 82 743.284 82C749.07 82 753.431 82.163 756.364 82.489C759.38 82.7335 762.355 83.141 765.289 83.7115V116.352C763.496 115.7 761.214 115.211 758.443 114.885C755.672 114.477 752.616 114.274 749.274 114.274C746.503 114.274 744.058 114.803 741.939 115.863C739.82 116.841 738.149 118.675 736.927 121.364C735.786 123.972 735.215 127.68 735.215 132.489V278.087H697.196ZM680.815 174.298V144.591H760.032V174.298H680.815ZM782.281 278.087V87.1345H820.423V278.087H782.281Z" />
<path d="M852.8 330.776V298.503H867.347C873.215 298.503 877.698 298.014 880.795 297.036C883.892 296.139 886.173 294.794 887.64 293.001C889.189 291.29 890.411 289.252 891.308 286.889C892.367 284.118 893.386 282.08 894.364 280.776C895.342 279.472 896.605 278.576 898.154 278.087H883.362L838.985 144.714H880.061L897.787 215.985L903.9 241.901H905L910.623 216.107L927.616 144.714H968.447L926.149 278.087C923.541 286.237 920.607 293.572 917.347 300.092C914.087 306.612 910.216 312.154 905.733 316.718C901.251 321.282 895.872 324.745 889.596 327.109C883.321 329.554 875.905 330.776 867.347 330.776H852.8Z" />
<path d="M329.049 290.192L171.524 23L14 290.192L171.524 199.084L329.049 290.192Z" />
<path d="M301.546 317L171.525 248.473L41.5039 317L171.525 274.67L301.546 317Z" />
</svg>;
}
async function getClient() {
const client = walletClient();
if (client) {
return client;
} else {
const client2 = new DeflyWalletConnect({
// shouldShowSignTxnToast: false, // Enabled by default
// chainId: getChainId(),
// chainId: 416001, // MainNet
// chainId: 416002, // TestNet
// chainId: 416003, // BetaNet
// chainId: 4160, // All networks
});
setWalletClient(client2);
return client2;
}
}
async function connect(onDisconnect) {
console.debug("Defly: connect");
const client = await getClient();
try {
const accounts2 = await client.connect();
if (accounts2.length === 0) {
throw new Error("No accounts found");
}
const walletAccounts = accounts2.map((address, index) => ({
name: `Defly Wallet ${index + 1}`,
address
}));
client.connector?.on("disconnect", (event) => {
console.debug("Disconnect from Defly");
event && console.debug("Event message: ", event.message);
onDisconnect();
});
setAccounts(walletAccounts);
return walletAccounts;
} catch (error) {
if (error?.data?.type !== "CONNECT_MODAL_CLOSED") {
console.log(error);
}
return [];
}
}
async function reconnect(onDisconnect) {
console.debug("Defly: reconnect");
const client = await getClient();
try {
const accounts2 = await client.reconnectSession();
if (accounts2.length === 0) {
throw new Error("No accounts found");
}
const walletAccounts = accounts2.map((address, index) => ({
name: `Defly Wallet ${index + 1}`,
address
}));
client.connector?.on("disconnect", (event) => {
console.debug("Disconnect from Defly");
event && console.debug("Event message: ", event.message);
onDisconnect();
});
setAccounts(walletAccounts);
return walletAccounts;
} catch (error) {
if (error?.data?.type !== "CONNECT_MODAL_CLOSED") {
console.log(error);
}
onDisconnect();
return [];
}
}
async function disconnect(onDisconnect) {
console.debug("Disconnecting Defly");
const client = walletClient();
if (client) {
await client.disconnect().catch((error) => {
console.error("Error disconnecting Defly", error);
});
}
console.debug("Defly disconnected");
setAccounts([]);
onDisconnect();
}
async function transactionSigner(txnGroup, indexesToSign) {
const client = walletClient();
if (client) {
const txnsToSign = txnGroup.reduce((acc, txn, idx) => {
if (indexesToSign.includes(idx)) {
acc.push({ txn });
} else {
acc.push({ txn, signers: [] });
}
return acc;
}, []);
console.debug("txnsToSign: ", txnsToSign);
const signingResult = await client.signTransaction([txnsToSign]);
return signingResult;
} else {
throw new Error("Wallet client is not initialized");
}
}
return {
name,
icon,
image,
accounts,
connect,
disconnect,
reconnect,
transactionSigner
};
}
var defly_default = createRoot4(UseDefly);
// src/wallets/walletConnectV2.tsx
import { createRoot as createRoot6, createSignal as createSignal6 } from "solid-js";
// src/useNetwork.ts
import { Algodv2, waitForConfirmation } from "algosdk";
import { createMemo, createRoot as createRoot5, createSignal as createSignal5 } from "solid-js";
function UseNetwork() {
const MAINNET_ALGOD_TOKEN = import.meta.env.VITE_MAINNET_ALGOD_TOKEN;
const MAINNET_ALGOD_SERVER = import.meta.env.VITE_MAINNET_ALGOD_SERVER;
const MAINNET_ALGOD_PORT = import.meta.env.VITE_MAINNET_ALGOD_PORT;
const MAINNET_BLOCK_EXPLORER = import.meta.env.VITE_MAINNET_BLOCK_EXPLORER;
const TESTNET_ALGOD_TOKEN = import.meta.env.VITE_TESTNET_ALGOD_TOKEN;
const TESTNET_ALGOD_SERVER = import.meta.env.VITE_TESTNET_ALGOD_SERVER;
const TESTNET_ALGOD_PORT = import.meta.env.VITE_TESTNET_ALGOD_PORT;
const TESTNET_BLOCK_EXPLORER = import.meta.env.VITE_TESTNET_BLOCK_EXPLORER;
const BETANET_ALGOD_TOKEN = import.meta.env.VITE_BETANET_ALGOD_TOKEN;
const BETANET_ALGOD_SERVER = import.meta.env.VITE_BETANET_ALGOD_SERVER;
const BETANET_ALGOD_PORT = import.meta.env.VITE_BETANET_ALGOD_PORT;
const BETANET_BLOCK_EXPLORER = import.meta.env.VITE_BETANET_BLOCK_EXPLORER;
const LOCALNET_ALGOD_TOKEN = import.meta.env.VITE_LOCALNET_ALGOD_TOKEN;
const LOCALNET_ALGOD_SERVER = import.meta.env.VITE_LOCALNET_ALGOD_SERVER;
const LOCALNET_ALGOD_PORT = import.meta.env.VITE_LOCALNET_ALGOD_PORT;
const LOCALNET_BLOCK_EXPLORER = import.meta.env.VITE_LOCALNET_BLOCK_EXPLORER;
const MAINNET_CONFIG = {
algodToken: MAINNET_ALGOD_TOKEN,
algodServer: MAINNET_ALGOD_SERVER,
algodPort: MAINNET_ALGOD_PORT,
blockExplorer: MAINNET_BLOCK_EXPLORER
};
const TESTNET_CONFIG = {
algodToken: TESTNET_ALGOD_TOKEN,
algodServer: TESTNET_ALGOD_SERVER,
algodPort: TESTNET_ALGOD_PORT,
blockExplorer: TESTNET_BLOCK_EXPLORER
};
const BETANET_CONFIG = {
algodToken: BETANET_ALGOD_TOKEN,
algodServer: BETANET_ALGOD_SERVER,
algodPort: BETANET_ALGOD_PORT,
blockExplorer: BETANET_BLOCK_EXPLORER
};
const LOCALNET_CONFIG = {
algodToken: LOCALNET_ALGOD_TOKEN,
algodServer: LOCALNET_ALGOD_SERVER,
algodPort: LOCALNET_ALGOD_PORT,
blockExplorer: LOCALNET_BLOCK_EXPLORER
};
const networkConfigs = {
MainNet: MAINNET_CONFIG,
TestNet: TESTNET_CONFIG,
BetaNet: BETANET_CONFIG,
LocalNet: LOCALNET_CONFIG
};
const networkNames = Object.keys(networkConfigs);
const [activeNetwork, setActiveNetwork] = createSignal5("MainNet");
const algodClient = createMemo(() => {
const config = networkConfigs[activeNetwork()];
const token = config.algodToken ? config.algodToken : "";
const server = config.algodServer ? config.algodServer : "";
const port = config.algodPort ? config.algodPort : "";
return new Algodv2(token, server, port);
});
function getAddrUrl(addr) {
const config = networkConfigs[activeNetwork()];
const url = config.blockExplorer;
if (url === "https://app.dappflow.org") {
if (activeNetwork() === "LocalNet") {
return `${url}/setnetwork?name=sandbox&redirect=explorer/account/${addr}`;
} else {
return `${url}/setnetwork?name=algonode_${activeNetwork().toLowerCase()}&redirect=explorer/account/${addr}`;
}
} else {
return `${url}/account/${addr}`;
}
}
function getAsaUrl(index) {
const config = networkConfigs[activeNetwork()];
const url = config.blockExplorer;
if (url === "https://app.dappflow.org") {
if (activeNetwork() === "LocalNet") {
return `${url}/setnetwork?name=sandbox&redirect=explorer/asset/${index}`;
} else {
return `${url}/setnetwork?name=algonode_${activeNetwork().toLowerCase()}&redirect=explorer/asset/${index}`;
}
} else {
return `${url}/asset/${index}`;
}
}
function getTxUrl(txId) {
const config = networkConfigs[activeNetwork()];
const url = config.blockExplorer;
if (url === "https://app.dappflow.org") {
if (activeNetwork() === "LocalNet") {
return `${url}/setnetwork?name=sandbox&redirect=explorer/transaction/${txId}`;
} else {
return `${url}/setnetwork?name=algonode_${activeNetwork().toLowerCase()}&redirect=explorer/transaction/${txId}`;
}
} else {
return `${url}/tx/${txId}`;
}
}
function getAppUrl(appId) {
const config = networkConfigs[activeNetwork()];
const url = config.blockExplorer;
if (url === "https://app.dappflow.org") {
if (activeNetwork() === "LocalNet") {
return `${url}/setnetwork?name=sandbox&redirect=explorer/application/${appId}`;
} else {
return `${url}/setnetwork?name=algonode_${activeNetwork().toLowerCase()}&redirect=explorer/application/${appId}`;
}
} else {
return `${url}/application/${appId}`;
}
}
async function confirmTransaction(txId, timeout = 4) {
const confirmation = await waitForConfirmation(algodClient(), txId, timeout);
return { txId, ...confirmation };
}
async function getAccountInfo(address) {
const accountInfo = await algodClient().accountInformation(address).do();
return accountInfo;
}
async function getAssetData(assetData) {
if (assetData.id > 0) {
try {
const asset = { ...assetData };
const { params } = await algodClient().getAssetByID(asset.id).do();
asset.name = params.name;
asset.unitName = params["unit-name"];
asset.url = params.url;
asset.decimals = params.decimals;
return asset;
} catch (e) {
console.error("Error getting asset data: ", e);
return assetData;
}
} else {
return assetData;
}
}
return {
algodClient,
activeNetwork,
setActiveNetwork,
getAddrUrl,
getAppUrl,
getAsaUrl,
getTxUrl,
getAccountInfo,
getAssetData,
confirmTransaction,
networkConfigs,
networkNames
};
}
var useNetwork_default = createRoot5(UseNetwork);
// src/wallets/walletConnectV2.tsx
var getPayloadId = () => {
const date = Date.now() * Math.pow(10, 3);
const extra = Math.floor(Math.random() * Math.pow(10, 3));
return date + extra;
};
var formatJsonRpcRequest = (method, params) => {
return {
id: getPayloadId(),
jsonrpc: "2.0",
method,
params
};
};
function UseWalletConnect() {
const [walletClient, setWalletClient] = createSignal6();
const [accounts, setAccounts] = createSignal6([]);
const { activeNetwork } = useNetwork_default;
const name = "WalletConnect";
const projectId = import.meta.env.VITE_WALLETCONNECT_PROJECT_ID;
const metadata = {
name: import.meta.env.VITE_WALLETCONNECT_PROJECT_NAME,
description: import.meta.env.VITE_WALLETCONNECT_PROJECT_DESCRIPTION,
url: import.meta.env.VITE_WALLETCONNECT_PROJECT_URL,
icons: [import.meta.env.VITE_WALLETCONNECT_PROJECT_ICON]
};
const relayUrl = "wss://relay.walletconnect.com";
const modalOptions = {
themeMode: "light",
explorerRecommendedWalletIds: "NONE",
explorerExcludedWalletIds: "ALL",
enableExplorer: false
};
const clientOptions = {
projectId,
metadata,
relayUrl,
modalOptions
};
let algorand_chains;
((algorand_chains2) => {
algorand_chains2["MainNet"] = "algorand:wGHE2Pwdvd7S12BL5FaOP20EGYesN73k";
algorand_chains2["TestNet"] = "algorand:SGO1GKSzyE7IEPItTxCByw9x8FmnrCDe";
algorand_chains2["BetaNet"] = "algorand:mFgazF-2uRS1tMiL9dsj01hJGySEmPN2";
algorand_chains2["LocalNet"] = "";
})(algorand_chains || (algorand_chains = {}));
const chains = ["algorand:wGHE2Pwdvd7S12BL5FaOP20EGYesN73k" /* MainNet */, "algorand:SGO1GKSzyE7IEPItTxCByw9x8FmnrCDe" /* TestNet */, "algorand:mFgazF-2uRS1tMiL9dsj01hJGySEmPN2" /* BetaNet */];
const requiredNamespaces = {
algorand: {
chains,
methods: ["algo_signTxn"],
events: []
}
};
function icon() {
return <svg
fill="black"
viewBox="0 0 480 332"
height="32"
xmlns="http://www.w3.org/2000/svg"
><path d="m126.613 93.9842c62.622-61.3123 164.152-61.3123 226.775 0l7.536 7.3788c3.131 3.066 3.131 8.036 0 11.102l-25.781 25.242c-1.566 1.533-4.104 1.533-5.67 0l-10.371-10.154c-43.687-42.7734-114.517-42.7734-158.204 0l-11.107 10.874c-1.565 1.533-4.103 1.533-5.669 0l-25.781-25.242c-3.132-3.066-3.132-8.036 0-11.102zm280.093 52.2038 22.946 22.465c3.131 3.066 3.131 8.036 0 11.102l-103.463 101.301c-3.131 3.065-8.208 3.065-11.339 0l-73.432-71.896c-.783-.767-2.052-.767-2.835 0l-73.43 71.896c-3.131 3.065-8.208 3.065-11.339 0l-103.4657-101.302c-3.1311-3.066-3.1311-8.036 0-11.102l22.9456-22.466c3.1311-3.065 8.2077-3.065 11.3388 0l73.4333 71.897c.782.767 2.051.767 2.834 0l73.429-71.897c3.131-3.065 8.208-3.065 11.339 0l73.433 71.897c.783.767 2.052.767 2.835 0l73.431-71.895c3.132-3.066 8.208-3.066 11.339 0z" /></svg>;
}
function image() {
return <svg
height="32"
viewBox="0 0 203 32"
fill="black"
xmlns="http://www.w3.org/2000/svg"
>
<g clip-path="url(#a)"><path d="M12.209 9.059c6.038-5.91 15.829-5.91 21.867 0l.727.711a.745.745 0 0 1 0 1.07l-2.486 2.433a.393.393 0 0 1-.547 0l-1-.979c-4.212-4.122-11.042-4.122-15.255 0l-1.071 1.048a.393.393 0 0 1-.547 0l-2.486-2.433a.745.745 0 0 1 0-1.07l.798-.78Zm27.009 5.031 2.212 2.166a.745.745 0 0 1 0 1.07l-9.976 9.764a.785.785 0 0 1-1.094 0l-7.08-6.93a.196.196 0 0 0-.274 0l-7.08 6.93a.785.785 0 0 1-1.094 0l-9.977-9.764a.745.745 0 0 1 0-1.07l2.213-2.166a.785.785 0 0 1 1.093 0l7.08 6.93a.196.196 0 0 0 .274 0l7.08-6.93a.785.785 0 0 1 1.094 0l7.081 6.93a.196.196 0 0 0 .274 0l7.08-6.93a.785.785 0 0 1 1.094 0ZM54.963 23.94l2.673-10.69c.158-.59.294-1.224.475-2.22.136.996.295 1.63.408 2.22l2.31 10.69h4.78L69.64 8.085h-3.67l-2.219 9.74a28.38 28.38 0 0 0-.52 2.808c-.182-1.064-.363-1.857-.567-2.786l-2.152-9.762H55.71l-2.333 9.762a47.123 47.123 0 0 0-.543 2.786 47.042 47.042 0 0 0-.544-2.786l-2.174-9.762h-3.828l4.009 15.855h4.666ZM72.376 24.348c1.812 0 2.967-.748 3.556-1.835-.068.34-.09.68-.09 1.02v.407h3.035v-6.546c0-3.125-1.427-4.937-4.915-4.937-3.013 0-4.983 1.676-5.164 3.986h3.33c.112-1.02.837-1.63 1.947-1.63 1.042 0 1.608.588 1.608 1.268 0 .498-.294.792-1.178.905l-1.585.182c-2.356.294-4.371 1.155-4.371 3.646 0 2.265 1.88 3.534 3.827 3.534Zm1.02-2.333c-.884 0-1.54-.498-1.54-1.36 0-.837.747-1.245 1.88-1.449l.77-.136c.656-.136 1.019-.249 1.245-.453v1.042c0 1.405-1.02 2.356-2.356 2.356ZM80.455 8.085V23.94h3.284V8.085h-3.284ZM85.639 8.085V23.94h3.284V8.085h-3.284ZM96.092 24.348c3.126 0 5.141-1.767 5.368-4.077h-3.307c-.159 1.019-1.02 1.585-2.061 1.585-1.404 0-2.424-1.132-2.446-2.695h7.882v-.634c0-3.67-2.016-6.07-5.504-6.07-3.352 0-5.708 2.355-5.708 5.911 0 3.85 2.424 5.98 5.776 5.98Zm-2.47-7.339c.137-1.268 1.066-2.197 2.38-2.197 1.268 0 2.15.883 2.174 2.197h-4.553ZM108.479 24.166c.725 0 1.427-.113 1.744-.203V21.47a4.678 4.678 0 0 1-.793.068c-1.2 0-1.63-.68-1.63-1.79v-4.348h2.672v-2.56H107.8v-3.94h-3.262v3.94h-2.401v2.56h2.401v4.802c0 2.627 1.314 3.963 3.941 3.963ZM119.565 24.348c4.485 0 7.203-2.628 7.543-6.41h-3.556c-.272 2.06-1.722 3.465-3.851 3.465-2.514 0-4.281-2.038-4.281-5.481 0-3.375 1.835-5.3 4.349-5.3 2.152 0 3.375 1.314 3.624 3.239h3.647c-.363-3.941-3.262-6.184-7.248-6.184-4.553 0-8.041 3.08-8.041 8.245 0 5.345 3.058 8.426 7.814 8.426ZM134.228 24.348c3.42 0 5.844-2.152 5.844-5.912 0-3.692-2.424-5.98-5.844-5.98-3.398 0-5.821 2.288-5.821 5.98 0 3.76 2.401 5.912 5.821 5.912Zm0-2.537c-1.518 0-2.492-1.246-2.492-3.375 0-2.174 1.02-3.397 2.492-3.397 1.495 0 2.514 1.223 2.514 3.397 0 2.13-.997 3.375-2.514 3.375ZM144.65 23.94v-6.5c0-1.382.861-2.401 2.084-2.401 1.155 0 1.835.883 1.835 2.355v6.546h3.284v-7.021c0-2.673-1.404-4.463-3.919-4.463-1.744 0-2.808.838-3.374 1.835a6.11 6.11 0 0 0 .09-1.02v-.43h-3.284V23.94h3.284ZM157.102 23.94v-6.5c0-1.382.86-2.401 2.083-2.401 1.156 0 1.835.883 1.835 2.355v6.546h3.284v-7.021c0-2.673-1.404-4.463-3.918-4.463-1.744 0-2.809.838-3.375 1.835.068-.408.091-.725.091-1.02v-.43h-3.285V23.94h3.285ZM171.371 24.348c3.125 0 5.141-1.767 5.368-4.077h-3.307c-.159 1.019-1.019 1.585-2.061 1.585-1.405 0-2.424-1.132-2.446-2.695h7.882v-.634c0-3.67-2.016-6.07-5.504-6.07-3.352 0-5.708 2.355-5.708 5.911 0 3.85 2.424 5.98 5.776 5.98Zm-2.469-7.339c.136-1.268 1.064-2.197 2.378-2.197 1.268 0 2.152.883 2.174 2.197h-4.552ZM183.859 24.348c3.443 0 5.323-1.88 5.685-4.802h-3.284c-.114 1.223-.816 2.265-2.288 2.265-1.495 0-2.514-1.382-2.514-3.42 0-2.22 1.178-3.352 2.582-3.352 1.382 0 2.061.996 2.152 2.151h3.284c-.249-2.695-2.084-4.734-5.459-4.734-3.284 0-5.889 2.175-5.889 5.935 0 3.714 2.197 5.957 5.731 5.957ZM196.648 24.166c.725 0 1.427-.113 1.744-.203V21.47a4.687 4.687 0 0 1-.793.068c-1.2 0-1.631-.68-1.631-1.79v-4.348h2.673v-2.56h-2.673v-3.94h-3.261v3.94h-2.401v2.56h2.401v4.802c0 2.627 1.313 3.963 3.941 3.963Z" /></g>
<defs><clipPath id="a"><path d="M0 0h202.602v32H0z" /></clipPath></defs>
</svg>;
}
async function getClient(onDisconnect) {
const client = walletClient();
if (client) {
return client;
} else {
const SignClient = (await import("@walletconnect/sign-client")).SignClient;
const client2 = await SignClient.in