@hot-labs/kit 1.0.57 → 1.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -9
- package/build/HotConnector.d.ts +6 -6
- package/build/HotConnector.js +18 -23
- package/build/HotConnector.js.map +1 -1
- package/build/OmniConnector.d.ts +4 -0
- package/build/OmniConnector.js +5 -5
- package/build/OmniConnector.js.map +1 -1
- package/build/OmniWallet.d.ts +10 -17
- package/build/OmniWallet.js +14 -19
- package/build/OmniWallet.js.map +1 -1
- package/build/core/Intents.d.ts +23 -39
- package/build/core/Intents.js +104 -115
- package/build/core/Intents.js.map +1 -1
- package/build/core/api.d.ts +1 -0
- package/build/core/api.js +10 -2
- package/build/core/api.js.map +1 -1
- package/build/core/bridge.js +1 -1
- package/build/core/bridge.js.map +1 -1
- package/build/core/index.d.ts +1 -1
- package/build/core/index.js +1 -1
- package/build/core/index.js.map +1 -1
- package/build/core/types.d.ts +17 -0
- package/build/core/utils.d.ts +1 -0
- package/build/core/utils.js +10 -0
- package/build/core/utils.js.map +1 -1
- package/build/cosmos/connector.js +2 -2
- package/build/cosmos/connector.js.map +1 -1
- package/build/cosmos/wallet.d.ts +2 -4
- package/build/cosmos/wallet.js +3 -8
- package/build/cosmos/wallet.js.map +1 -1
- package/build/evm/connector.d.ts +1 -0
- package/build/evm/connector.js +4 -0
- package/build/evm/connector.js.map +1 -1
- package/build/evm/wallet.d.ts +2 -1
- package/build/evm/wallet.js +7 -5
- package/build/evm/wallet.js.map +1 -1
- package/build/exchange.d.ts +4 -1
- package/build/exchange.js +21 -20
- package/build/exchange.js.map +1 -1
- package/build/hot-wallet/google.js +10 -5
- package/build/hot-wallet/google.js.map +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/near/connector.js +2 -2
- package/build/near/connector.js.map +1 -1
- package/build/{core/nearRpc.d.ts → near/rpc.d.ts} +0 -1
- package/build/{core/nearRpc.js → near/rpc.js} +5 -11
- package/build/near/rpc.js.map +1 -0
- package/build/near/wallet.d.ts +2 -4
- package/build/near/wallet.js +4 -9
- package/build/near/wallet.js.map +1 -1
- package/build/solana/{protocol.d.ts → WalletStandard.d.ts} +1 -1
- package/build/solana/{protocol.js → WalletStandard.js} +1 -1
- package/build/solana/WalletStandard.js.map +1 -0
- package/build/solana/connector.d.ts +1 -1
- package/build/solana/connector.js +9 -8
- package/build/solana/connector.js.map +1 -1
- package/build/solana/injected/solana-wallet.js.map +1 -1
- package/build/solana/wallet.d.ts +3 -5
- package/build/solana/wallet.js +3 -8
- package/build/solana/wallet.js.map +1 -1
- package/build/solana/{wallets.js → walletStandartList.js} +1 -1
- package/build/solana/walletStandartList.js.map +1 -0
- package/build/stellar/connector.d.ts +0 -2
- package/build/stellar/connector.js +1 -4
- package/build/stellar/connector.js.map +1 -1
- package/build/stellar/wallet.d.ts +10 -8
- package/build/stellar/wallet.js +12 -16
- package/build/stellar/wallet.js.map +1 -1
- package/build/ton/connector.d.ts +0 -1
- package/build/ton/connector.js +1 -4
- package/build/ton/connector.js.map +1 -1
- package/build/ton/wallet.d.ts +2 -3
- package/build/ton/wallet.js +3 -4
- package/build/ton/wallet.js.map +1 -1
- package/build/tron/connector.d.ts +51 -0
- package/build/tron/connector.js +65 -0
- package/build/tron/connector.js.map +1 -0
- package/build/tron/index.d.ts +6 -0
- package/build/tron/index.js +5 -0
- package/build/tron/index.js.map +1 -0
- package/build/tron/wallet.d.ts +52 -0
- package/build/tron/wallet.js +122 -0
- package/build/tron/wallet.js.map +1 -0
- package/build/ui/connect/AuthPopup.js +1 -1
- package/build/ui/connect/AuthPopup.js.map +1 -1
- package/build/ui/connect/ConnectWallet.d.ts +2 -1
- package/build/ui/connect/ConnectWallet.js +2 -2
- package/build/ui/connect/ConnectWallet.js.map +1 -1
- package/build/ui/icons/arrow-right.js +1 -1
- package/build/ui/icons/arrow-right.js.map +1 -1
- package/build/ui/icons/close.js +1 -1
- package/build/ui/icons/close.js.map +1 -1
- package/build/ui/icons/exchange.js +1 -1
- package/build/ui/icons/exchange.js.map +1 -1
- package/build/ui/icons/logout.js +1 -1
- package/build/ui/icons/logout.js.map +1 -1
- package/build/ui/icons/pending.js +1 -1
- package/build/ui/icons/pending.js.map +1 -1
- package/build/ui/icons/qr.js +1 -1
- package/build/ui/icons/qr.js.map +1 -1
- package/build/ui/icons/search.js +1 -1
- package/build/ui/icons/search.js.map +1 -1
- package/build/ui/icons/switch.js +1 -1
- package/build/ui/icons/switch.js.map +1 -1
- package/build/ui/icons/wallet.js +1 -1
- package/build/ui/icons/wallet.js.map +1 -1
- package/build/ui/payment/Bridge.js +7 -2
- package/build/ui/payment/Bridge.js.map +1 -1
- package/build/ui/payment/Payment.d.ts +16 -8
- package/build/ui/payment/Payment.js +116 -21
- package/build/ui/payment/Payment.js.map +1 -1
- package/build/ui/payment/Profile.js +1 -1
- package/build/ui/payment/Profile.js.map +1 -1
- package/build/ui/payment/SelectToken.js +1 -1
- package/build/ui/payment/SelectToken.js.map +1 -1
- package/build/ui/payment/TokenCard.js +1 -1
- package/build/ui/payment/TokenCard.js.map +1 -1
- package/build/ui/router.d.ts +2 -1
- package/build/ui/router.js +2 -2
- package/build/ui/router.js.map +1 -1
- package/package.json +8 -4
- package/src/HotConnector.ts +21 -29
- package/src/OmniConnector.ts +9 -9
- package/src/OmniWallet.ts +24 -25
- package/src/core/Intents.ts +123 -139
- package/src/core/api.ts +13 -2
- package/src/core/bridge.ts +3 -2
- package/src/core/index.ts +1 -1
- package/src/core/types.ts +21 -0
- package/src/core/utils.ts +11 -0
- package/src/cosmos/connector.ts +2 -2
- package/src/cosmos/wallet.ts +3 -7
- package/src/evm/connector.ts +5 -0
- package/src/evm/wallet.ts +9 -6
- package/src/exchange.ts +20 -20
- package/src/hot-wallet/google.ts +12 -5
- package/src/index.ts +2 -0
- package/src/near/connector.ts +2 -2
- package/src/{core/nearRpc.ts → near/rpc.ts} +4 -11
- package/src/near/wallet.ts +4 -9
- package/src/solana/{protocol.ts → WalletStandard.ts} +2 -4
- package/src/solana/connector.ts +9 -8
- package/src/solana/injected/solana-wallet.ts +6 -6
- package/src/solana/wallet.ts +4 -8
- package/src/stellar/connector.ts +1 -6
- package/src/stellar/wallet.ts +17 -17
- package/src/ton/connector.ts +1 -5
- package/src/ton/wallet.ts +3 -3
- package/src/tron/connector.ts +89 -0
- package/src/tron/index.ts +7 -0
- package/src/tron/wallet.ts +146 -0
- package/src/ui/connect/AuthPopup.tsx +2 -1
- package/src/ui/connect/ConnectWallet.tsx +3 -2
- package/src/ui/icons/arrow-right.tsx +2 -2
- package/src/ui/icons/close.tsx +1 -1
- package/src/ui/icons/exchange.tsx +4 -4
- package/src/ui/icons/logout.tsx +6 -6
- package/src/ui/icons/pending.tsx +2 -4
- package/src/ui/icons/qr.tsx +1 -2
- package/src/ui/icons/search.tsx +4 -4
- package/src/ui/icons/switch.tsx +4 -4
- package/src/ui/icons/wallet.tsx +2 -4
- package/src/ui/payment/Bridge.tsx +9 -2
- package/src/ui/payment/Payment.tsx +259 -31
- package/src/ui/payment/Profile.tsx +10 -8
- package/src/ui/payment/SelectToken.tsx +1 -1
- package/src/ui/payment/TokenCard.tsx +1 -1
- package/src/ui/router.tsx +5 -6
- package/build/core/nearRpc.js.map +0 -1
- package/build/solana/protocol.js.map +0 -1
- package/build/solana/wallets.js.map +0 -1
- /package/build/solana/{wallets.d.ts → walletStandartList.d.ts} +0 -0
- /package/src/solana/{wallets.ts → walletStandartList.ts} +0 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { base58, base64, hex } from "@scure/base";
|
|
2
|
+
|
|
3
|
+
import { Network, WalletType } from "../core/chains";
|
|
4
|
+
import { ReviewFee } from "../core/bridge";
|
|
5
|
+
import { Token } from "../core/token";
|
|
6
|
+
import { Commitment } from "../core";
|
|
7
|
+
|
|
8
|
+
import type { OmniConnector } from "../OmniConnector";
|
|
9
|
+
import { OmniWallet } from "../OmniWallet";
|
|
10
|
+
|
|
11
|
+
interface TronWebLike {
|
|
12
|
+
ready?: boolean;
|
|
13
|
+
defaultAddress?: { base58?: string; hex?: string };
|
|
14
|
+
address?: { toHex?: (address: string) => string };
|
|
15
|
+
trx?: {
|
|
16
|
+
getBalance?: (address: string) => Promise<number | string>;
|
|
17
|
+
sendTransaction?: (to: string, amount: number | string) => Promise<any>;
|
|
18
|
+
signMessageV2?: (message: string) => Promise<string>;
|
|
19
|
+
signMessage?: (message: string) => Promise<string>;
|
|
20
|
+
};
|
|
21
|
+
contract?: () => { at: (address: string) => Promise<any> };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
class TronWallet extends OmniWallet {
|
|
25
|
+
readonly publicKey?: string;
|
|
26
|
+
readonly type = WalletType.Tron;
|
|
27
|
+
|
|
28
|
+
constructor(readonly connector: OmniConnector, readonly address: string, readonly tronWeb: TronWebLike) {
|
|
29
|
+
super();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
get icon() {
|
|
33
|
+
return this.connector.icon;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
get omniAddress() {
|
|
37
|
+
// Convert TRON base58 address -> EVM-like hex (0x + 20 bytes) for signer_id.
|
|
38
|
+
const hexAddrRaw =
|
|
39
|
+
this.tronWeb.address?.toHex?.(this.address) || //
|
|
40
|
+
this.tronWeb.defaultAddress?.hex ||
|
|
41
|
+
"";
|
|
42
|
+
|
|
43
|
+
const clean = hexAddrRaw.startsWith("0x") ? hexAddrRaw.slice(2) : hexAddrRaw;
|
|
44
|
+
if (!clean) return this.address.toLowerCase();
|
|
45
|
+
|
|
46
|
+
// Tron addresses are typically: 41 + 20 bytes (hex).
|
|
47
|
+
if (clean.length >= 42 && clean.startsWith("41")) return `0x${clean.slice(2, 42)}`.toLowerCase();
|
|
48
|
+
if (clean.length === 40) return `0x${clean}`.toLowerCase();
|
|
49
|
+
return `0x${clean}`.toLowerCase();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
private async trc20Balance(contractAddress: string): Promise<bigint> {
|
|
53
|
+
if (!this.tronWeb.contract) throw new Error("TronLink not available");
|
|
54
|
+
const contract = await this.tronWeb.contract().at(contractAddress);
|
|
55
|
+
const res = await contract.balanceOf(this.address).call();
|
|
56
|
+
const value = typeof res === "string" ? res : res?._hex ?? res?.toString?.() ?? "0";
|
|
57
|
+
return BigInt(value);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async fetchBalance(chain: number, address: string): Promise<bigint> {
|
|
61
|
+
if (chain !== Network.Tron) throw "Invalid chain";
|
|
62
|
+
if (!this.tronWeb.trx) throw new Error("TronLink not available");
|
|
63
|
+
|
|
64
|
+
if (address === "native") {
|
|
65
|
+
const balance = await this.tronWeb.trx.getBalance?.(this.address);
|
|
66
|
+
return BigInt(balance || 0);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return await this.trc20Balance(address);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async fetchBalances(chain: number, whitelist: string[]): Promise<Record<string, bigint>> {
|
|
73
|
+
const native = await this.fetchBalance(chain, "native");
|
|
74
|
+
|
|
75
|
+
try {
|
|
76
|
+
const res = await fetch(`https://api0.herewallet.app/api/v1/user/balances/${chain}/${this.address}`, { body: JSON.stringify({ whitelist, chain_id: chain }), method: "POST" });
|
|
77
|
+
if (!res.ok) throw new Error("Failed to fetch balances");
|
|
78
|
+
const { balances } = await res.json();
|
|
79
|
+
return { ...balances, native };
|
|
80
|
+
} catch {
|
|
81
|
+
const balances = await Promise.all(
|
|
82
|
+
whitelist.map(async (token) => {
|
|
83
|
+
const balance = await this.fetchBalance(chain, token);
|
|
84
|
+
return [token, balance] as const;
|
|
85
|
+
})
|
|
86
|
+
);
|
|
87
|
+
return { ...Object.fromEntries(balances), native };
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
async transferFee(token: Token): Promise<ReviewFee> {
|
|
92
|
+
// Tron fees depend on bandwidth/energy; for UX we return "0" and let wallet handle it.
|
|
93
|
+
return new ReviewFee({ baseFee: 0n, gasLimit: 0n, chain: token.chain });
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
async transfer(args: { token: Token; receiver: string; amount: bigint; comment?: string; gasFee?: ReviewFee }): Promise<string> {
|
|
97
|
+
if (!this.tronWeb.trx) throw new Error("TronLink not available");
|
|
98
|
+
|
|
99
|
+
if (args.token.address === "native") {
|
|
100
|
+
const result = await this.tronWeb.trx.sendTransaction?.(args.receiver, args.amount.toString());
|
|
101
|
+
return result?.txid || result?.transaction?.txID || result?.txID || result?.id || "";
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (!this.tronWeb.contract) throw new Error("TronLink not available");
|
|
105
|
+
const contract = await this.tronWeb.contract().at(args.token.address);
|
|
106
|
+
const result = await contract.transfer(args.receiver, args.amount.toString()).send();
|
|
107
|
+
return typeof result === "string" ? result : result?.txid || result?.transaction?.txID || result?.txID || "";
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
private async signMessageTIP191(message: string): Promise<Uint8Array> {
|
|
111
|
+
if (!this.tronWeb.trx?.signMessageV2 && !this.tronWeb.trx?.signMessage) throw "not impl";
|
|
112
|
+
const signatureHex = (await (this.tronWeb.trx.signMessageV2?.(message) || this.tronWeb.trx.signMessage?.(message))) as string;
|
|
113
|
+
if (!signatureHex) throw new Error("Failed to sign message");
|
|
114
|
+
|
|
115
|
+
const clean = signatureHex.startsWith("0x") ? signatureHex.slice(2) : signatureHex;
|
|
116
|
+
if (clean.length < 130) throw new Error("Invalid signature");
|
|
117
|
+
|
|
118
|
+
const rsv = clean.slice(0, 130);
|
|
119
|
+
const v = parseInt(rsv.slice(128, 130), 16);
|
|
120
|
+
const parity = v === 27 || v === 0 ? 0 : v === 28 || v === 1 ? 1 : v % 2;
|
|
121
|
+
const normalized = rsv.slice(0, 128) + (parity === 0 ? "00" : "01");
|
|
122
|
+
return hex.decode(normalized);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
async signIntents(intents: Record<string, any>[], options?: { deadline?: number; nonce?: Uint8Array }): Promise<Commitment> {
|
|
126
|
+
const nonce = new Uint8Array(options?.nonce || window.crypto.getRandomValues(new Uint8Array(32)));
|
|
127
|
+
|
|
128
|
+
const message = JSON.stringify({
|
|
129
|
+
deadline: options?.deadline ? new Date(options.deadline).toISOString() : "2100-01-01T00:00:00.000Z",
|
|
130
|
+
verifying_contract: "intents.near",
|
|
131
|
+
signer_id: this.omniAddress,
|
|
132
|
+
nonce: base64.encode(nonce),
|
|
133
|
+
intents: intents,
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
// TronLink signs messages using TIP-191 ("\x19TRON Signed Message:\n").
|
|
137
|
+
const buffer = await this.signMessageTIP191(message);
|
|
138
|
+
return {
|
|
139
|
+
signature: `secp256k1:${base58.encode(buffer)}`,
|
|
140
|
+
payload: message,
|
|
141
|
+
standard: "tip191",
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export default TronWallet;
|
|
@@ -2,6 +2,7 @@ import React, { useState } from "react";
|
|
|
2
2
|
import { OmniWallet } from "../../OmniWallet";
|
|
3
3
|
import Popup, { present } from "../Popup";
|
|
4
4
|
import { PopupButton } from "../styles";
|
|
5
|
+
import { chains } from "../../core";
|
|
5
6
|
|
|
6
7
|
interface AuthIntentPopupProps {
|
|
7
8
|
wallet: OmniWallet;
|
|
@@ -34,7 +35,7 @@ const AuthIntentPopupComponent: React.FC<AuthIntentPopupProps> = ({ wallet, onAp
|
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
return (
|
|
37
|
-
<Popup header={<p>Authorize
|
|
38
|
+
<Popup header={<p>Authorize wallet</p>} onClose={onReject}>
|
|
38
39
|
<p style={{ textAlign: "center", color: "#fff" }}>To verify your account, you need to sign a message, this action is safe, the platform does not have access to your assets.</p>
|
|
39
40
|
<PopupButton
|
|
40
41
|
disabled={loading}
|
|
@@ -13,9 +13,10 @@ import Popup from "../Popup";
|
|
|
13
13
|
interface MultichainPopupProps {
|
|
14
14
|
hot: HotConnector;
|
|
15
15
|
onClose: () => void;
|
|
16
|
+
title?: string;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
export const Connector = observer(({ hot, onClose }: MultichainPopupProps) => {
|
|
19
|
+
export const Connector = observer(({ hot, onClose, title }: MultichainPopupProps) => {
|
|
19
20
|
const onechain = hot.connectors.filter((t) => t.type === ConnectorType.WALLET);
|
|
20
21
|
const social = hot.connectors.filter((t) => t.type === ConnectorType.SOCIAL);
|
|
21
22
|
|
|
@@ -26,7 +27,7 @@ export const Connector = observer(({ hot, onClose }: MultichainPopupProps) => {
|
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
return (
|
|
29
|
-
<Popup header={<p>Select network</p>} onClose={onClose}>
|
|
30
|
+
<Popup header={<p>{title || "Select network"}</p>} onClose={onClose}>
|
|
30
31
|
{onechain.map((t) => (
|
|
31
32
|
<PopupOption key={t.id} onClick={() => selectConnector(t)}>
|
|
32
33
|
<ImageView src={t.icon} alt={t.name} size={44} />
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const ArrowRightIcon = (props: React.SVGProps<SVGSVGElement>) => {
|
|
2
2
|
return (
|
|
3
3
|
<svg xmlns="http://www.w3.org/2000/svg" width={24} height={24} viewBox="0 0 16 16" fill="none" {...props}>
|
|
4
|
-
<path d="M10.6667 8C10.1282 8 6.66669 8.56 6.66669 12.6667" stroke="#eaeaea"
|
|
5
|
-
<path d="M10.6667 8.00001C10.1282 8.00001 6.66669 7.44001 6.66669 3.33334" stroke="#eaeaea"
|
|
4
|
+
<path d="M10.6667 8C10.1282 8 6.66669 8.56 6.66669 12.6667" stroke="#eaeaea" strokeWidth="1.2" strokeLinecap="round" />
|
|
5
|
+
<path d="M10.6667 8.00001C10.1282 8.00001 6.66669 7.44001 6.66669 3.33334" stroke="#eaeaea" strokeWidth="1.2" strokeLinecap="round" />
|
|
6
6
|
</svg>
|
|
7
7
|
);
|
|
8
8
|
};
|
package/src/ui/icons/close.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const CloseIcon = (props: React.SVGProps<SVGSVGElement>) => {
|
|
2
2
|
return (
|
|
3
3
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
4
|
-
<path d="M5 19L19 5M5 5L19 19" stroke="#dddddd"
|
|
4
|
+
<path d="M5 19L19 5M5 5L19 19" stroke="#dddddd" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round" />
|
|
5
5
|
</svg>
|
|
6
6
|
);
|
|
7
7
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
const ExchangeIcon = ({ size, color, strokeColor }: { size?: number; color?: string; strokeColor?: string }) => {
|
|
2
2
|
return (
|
|
3
3
|
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
-
<path
|
|
4
|
+
<path fillRule="evenodd" clipRule="evenodd" d="M14 3.5H9C5.41015 3.5 2.5 6.41015 2.5 10V14C2.5 17.5899 5.41015 20.5 9 20.5H14C17.5899 20.5 20.5 17.5899 20.5 14V10C20.5 6.41015 17.5899 3.5 14 3.5Z" fill={color} />
|
|
5
5
|
<path d="M9 3.5H14C17.5899 3.5 20.5 6.41015 20.5 10V14C20.5 17.5899 17.5899 20.5 14 20.5H9C5.41015 20.5 2.5 17.5899 2.5 14V10C2.5 6.41015 5.41015 3.5 9 3.5Z" fill={color} />
|
|
6
|
-
<path d="M9 2.75H15C19.0041 2.75 22.25 5.99594 22.25 10V15C22.25 19.0041 19.0041 22.25 15 22.25H9C4.99594 22.25 1.75 19.0041 1.75 15V10C1.75 5.99594 4.99594 2.75 9 2.75Z" stroke={strokeColor}
|
|
6
|
+
<path d="M9 2.75H15C19.0041 2.75 22.25 5.99594 22.25 10V15C22.25 19.0041 19.0041 22.25 15 22.25H9C4.99594 22.25 1.75 19.0041 1.75 15V10C1.75 5.99594 4.99594 2.75 9 2.75Z" stroke={strokeColor} strokeWidth="1.5" />
|
|
7
7
|
<path
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
fillRule="evenodd"
|
|
9
|
+
clipRule="evenodd"
|
|
10
10
|
d="M14 3.5H9C5.41015 3.5 2.5 6.41015 2.5 10V14C2.5 17.5899 5.41015 20.5 9 20.5H14C17.5899 20.5 20.5 17.5899 20.5 14V10C20.5 6.41015 17.5899 3.5 14 3.5ZM9 2C4.58172 2 1 5.58172 1 10V14C1 18.4183 4.58172 22 9 22H14C18.4183 22 22 18.4183 22 14V10C22 5.58172 18.4183 2 14 2H9ZM9.43398 6.25678C9.84444 6.31237 10.1321 6.69018 10.0765 7.10064C9.88688 8.5013 9.31567 9.52614 8.588 10.25H18C18.4142 10.25 18.75 10.5858 18.75 11C18.75 11.4142 18.4142 11.75 18 11.75H5C4.58579 11.75 4.25 11.4142 4.25 11C4.25 10.5858 4.58579 10.25 5 10.25C5.50127 10.25 6.3231 10.0848 7.05272 9.58232C7.75624 9.09779 8.40283 8.28236 8.59012 6.89936C8.6457 6.48889 9.02351 6.2012 9.43398 6.25678ZM12.9235 17.8994C12.8679 18.3098 13.1556 18.6876 13.566 18.7432C13.9765 18.7988 14.3543 18.5111 14.4099 18.1006C14.5972 16.7176 15.2438 15.9022 15.9473 15.4177C16.6769 14.9152 17.4987 14.75 18 14.75C18.4142 14.75 18.75 14.4142 18.75 14C18.75 13.5858 18.4142 13.25 18 13.25H5C4.58579 13.25 4.25 13.5858 4.25 14C4.25 14.4142 4.58579 14.75 5 14.75H14.412C13.6843 15.4739 13.1131 16.4987 12.9235 17.8994Z"
|
|
11
11
|
fill={strokeColor}
|
|
12
12
|
/>
|
package/src/ui/icons/logout.tsx
CHANGED
|
@@ -3,16 +3,16 @@ export const LogoutIcon = (props: React.SVGProps<SVGSVGElement>) => (
|
|
|
3
3
|
<path
|
|
4
4
|
d="M7.125 4.12506V3.12506C7.125 2.71085 6.78921 2.37506 6.375 2.37506H2.625C2.21079 2.37506 1.875 2.71085 1.875 3.12506V8.94997C1.875 9.36418 2.21079 9.69997 2.625 9.69997H6.375C6.78921 9.69997 7.125 9.36418 7.125 8.94997V8.62506"
|
|
5
5
|
stroke="#b8b8b8"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
strokeWidth="0.75"
|
|
7
|
+
strokeLinecap="round"
|
|
8
|
+
strokeLinejoin="round"
|
|
9
9
|
/>
|
|
10
10
|
<path
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
fillRule="evenodd"
|
|
12
|
+
clipRule="evenodd"
|
|
13
13
|
d="M2.625 2.00006C2.00368 2.00006 1.5 2.50374 1.5 3.12506V8.62506C1.5 9.24638 2.00368 9.75006 2.625 9.75006H6.125C6.6513 9.75006 7.09319 9.38866 7.21604 8.90049C7.21979 8.89938 7.22349 8.89811 7.22714 8.89665C7.43737 8.81297 7.62507 8.62509 7.37504 8.12509C7.28246 7.9399 7.18987 7.8576 7.10907 7.83207C7.04492 7.78075 6.96354 7.75006 6.875 7.75006C6.66789 7.75006 6.5 7.91795 6.5 8.12506V8.62506C6.5 8.83217 6.33211 9.00006 6.125 9.00006H2.625C2.41789 9.00006 2.25 8.83217 2.25 8.62506V3.12506C2.25 2.91795 2.41789 2.75006 2.625 2.75006H6.125C6.33211 2.75006 6.5 2.91795 6.5 3.12506V3.62506C6.5 3.64361 6.50135 3.66184 6.50395 3.67966C6.50066 3.78168 6.54545 3.90373 6.58628 4.015C6.60039 4.05343 6.61402 4.09059 6.62504 4.12518C6.7401 4.4039 7.12503 4.62518 7.16669 4.40389C7.29825 4.362 7.33697 4.11473 7.25318 3.85161C7.24388 3.8224 7.23346 3.79422 7.2221 3.76726C7.24008 3.72341 7.25 3.67539 7.25 3.62506V3.12506C7.25 2.50374 6.74632 2.00006 6.125 2.00006H2.625Z"
|
|
14
14
|
fill="#b8b8b8"
|
|
15
15
|
/>
|
|
16
|
-
<path d="M4.62499 6L10.1383 6M10.1383 6C9.4301 5.99403 8.10413 6.45886 8.37868 7.5M10.1383 6C9.46912 6.03371 8.18027 5.6316 8.37868 4.5" stroke="#b8b8b8"
|
|
16
|
+
<path d="M4.62499 6L10.1383 6M10.1383 6C9.4301 5.99403 8.10413 6.45886 8.37868 7.5M10.1383 6C9.46912 6.03371 8.18027 5.6316 8.37868 4.5" stroke="#b8b8b8" strokeWidth="0.75" strokeLinecap="round" strokeLinejoin="round" />
|
|
17
17
|
</svg>
|
|
18
18
|
);
|
package/src/ui/icons/pending.tsx
CHANGED
|
@@ -2,14 +2,12 @@ export const PendingIcon = (props: React.SVGProps<SVGSVGElement>) => {
|
|
|
2
2
|
return (
|
|
3
3
|
<svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 11 11" fill="none" {...props}>
|
|
4
4
|
<path
|
|
5
|
-
|
|
6
|
-
clip-rule="evenodd"
|
|
5
|
+
clipRule="evenodd"
|
|
7
6
|
d="M5.00001 2.49994C5.20712 2.49994 5.37501 2.66783 5.37501 2.87494V5.3534C5.37501 5.61658 5.28274 5.87143 5.11426 6.07361L4.03809 7.36501C3.90551 7.52411 3.66904 7.54561 3.50994 7.41302C3.35084 7.28044 3.32934 7.04397 3.46193 6.88487L4.53809 5.59347C4.59425 5.52608 4.62501 5.44113 4.62501 5.3534V2.87494C4.62501 2.66783 4.7929 2.49994 5.00001 2.49994Z"
|
|
8
7
|
fill="#2C3034"
|
|
9
8
|
/>
|
|
10
9
|
<path
|
|
11
|
-
|
|
12
|
-
clip-rule="evenodd"
|
|
10
|
+
clipRule="evenodd"
|
|
13
11
|
d="M2.11248 8.11847C2.87055 8.82074 3.88514 9.25 5 9.25C7.34721 9.25 9.25 7.34721 9.25 5C9.25 3.88514 8.82073 2.87054 8.11847 2.11248C7.21578 1.26718 6.08279 0.75 5 0.75C2.65279 0.75 0.75 2.65279 0.75 5C0.75 6.08279 1.26718 7.21578 2.11248 8.11847ZM10.5 5.5C10.5 8.26142 8.26142 10.5 5.5 10.5C4.0598 10.5 2.62582 9.75509 1.58332 8.65054C0.608904 7.73817 0 6.4402 0 5C0 2.23858 2.23858 0 5 0C6.44019 0 7.73817 0.608903 8.65054 1.58331C9.75509 2.62582 10.5 4.0598 10.5 5.5Z"
|
|
14
12
|
fill="#2C3034"
|
|
15
13
|
/>
|
package/src/ui/icons/qr.tsx
CHANGED
|
@@ -2,8 +2,7 @@ export const QRIcon = (props: any) => {
|
|
|
2
2
|
return (
|
|
3
3
|
<svg xmlns="http://www.w3.org/2000/svg" width={24} height={24} viewBox="0 0 12 12" fill="none" {...props}>
|
|
4
4
|
<path
|
|
5
|
-
|
|
6
|
-
clip-rule="evenodd"
|
|
5
|
+
clipRule="evenodd"
|
|
7
6
|
d="M1.75412 1.95569C1.93703 1.68471 2.21228 1.5 2.55882 1.5H2.69118H5.47059L5.73529 1.92507V5.60294H2.02941L1.5 5.20588V2.82353V2.69118C1.5 2.4136 1.59494 2.15821 1.75412 1.95569ZM2.82353 2.42647C2.60424 2.42647 2.42647 2.60424 2.42647 2.82353V4.41176H4.67647V2.42647H2.82353ZM6.26468 1.5H6.26474H9.04409H9.17651C9.83438 1.5 10.5 2.16566 10.5 2.82353V5.60294H10.103H6.6618L6.26474 5.20588H6.26468V1.5ZM9.44115 2.69118C9.44115 2.59011 9.40339 2.49786 9.3412 2.42777C9.33054 2.42691 9.31975 2.42647 9.30886 2.42647H7.32357V4.41176H9.44115V2.69118ZM5.20588 6.26477L5.20598 6.26487H5.33824L5.73529 6.66193V9.94274V10.3678H2.82353C2.16566 10.3678 1.5 9.70215 1.5 9.04428V8.77948V6.26487V6.26477H5.20588ZM2.5758 9.15951C2.61231 9.17058 2.65105 9.17654 2.69118 9.17654H4.67647V7.05899H2.55882V9.04428C2.55882 9.08435 2.56476 9.12304 2.5758 9.15951ZM6.26468 6.26477H8.38233V7.32359H6.52938L6.26468 7.05889V6.26477ZM9.44121 7.32359H10.5V6.52948L10.2353 6.26477H9.44119V7.32349H8.38239V8.38231H9.44121V7.32359ZM7.3235 8.38239H6.26468V9.44121V10.2353L6.49183 10.3702H7.3235V9.44121H8.38233V8.38239H7.3235ZM10.2353 8.38239L10.5 8.64709V9.44121V9.61103C10.5 10.0252 10.1642 10.361 9.75003 10.361H8.62347L8.38239 10.2353V9.44121H9.44121V8.38239H10.2353Z"
|
|
8
7
|
fill="#ececec"
|
|
9
8
|
/>
|
package/src/ui/icons/search.tsx
CHANGED
|
@@ -4,15 +4,15 @@ export const SearchIcon = (props: React.SVGProps<SVGSVGElement>) => {
|
|
|
4
4
|
<path
|
|
5
5
|
d="M5 1.875C5.81162 1.875 6.65905 2.2748 7.30957 2.91699C7.95937 3.55852 8.375 4.40467 8.375 5.25C8.375 7.01349 7.19019 8.375 5.5 8.375C3.44557 8.37499 1.875 6.71455 1.875 5C1.875 3.27411 3.27411 1.875 5 1.875Z"
|
|
6
6
|
stroke="#2C3034"
|
|
7
|
-
|
|
7
|
+
strokeWidth="0.75"
|
|
8
8
|
/>
|
|
9
9
|
<path
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
fillRule="evenodd"
|
|
11
|
+
clipRule="evenodd"
|
|
12
12
|
d="M5 7.75C6.51878 7.75 7.75 6.51878 7.75 5C7.75 3.48122 6.51878 2.25 5 2.25C3.48122 2.25 2.25 3.48122 2.25 5C2.25 6.51878 3.48122 7.75 5 7.75ZM5 8.5C6.933 8.5 8.5 6.933 8.5 5C8.5 3.067 6.933 1.5 5 1.5C3.067 1.5 1.5 3.067 1.5 5C1.5 6.933 3.067 8.5 5 8.5Z"
|
|
13
13
|
fill="#2C3034"
|
|
14
14
|
/>
|
|
15
|
-
<path d="M7.25 7.25006L10.25 10.2501" stroke="#2C3034"
|
|
15
|
+
<path d="M7.25 7.25006L10.25 10.2501" stroke="#2C3034" strokeWidth="0.75" strokeLinecap="round" />
|
|
16
16
|
</svg>
|
|
17
17
|
);
|
|
18
18
|
};
|
package/src/ui/icons/switch.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export const SwitchIcon = (props: React.SVGProps<SVGSVGElement>) => {
|
|
2
2
|
return (
|
|
3
3
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
4
|
-
<path d="M10 4L10 19" stroke="#EBDEDC"
|
|
5
|
-
<path d="M14 19L14 4" stroke="#EBDEDC"
|
|
6
|
-
<path d="M10 19C10 18.3269 9.52 14 6 14" stroke="#EBDEDC"
|
|
7
|
-
<path d="M14 4C14 4.67308 14.48 9 18 9" stroke="#EBDEDC"
|
|
4
|
+
<path d="M10 4L10 19" stroke="#EBDEDC" strokeWidth="2" strokeLinecap="round" />
|
|
5
|
+
<path d="M14 19L14 4" stroke="#EBDEDC" strokeWidth="2" strokeLinecap="round" />
|
|
6
|
+
<path d="M10 19C10 18.3269 9.52 14 6 14" stroke="#EBDEDC" strokeWidth="2" stroke-linecap="round" />
|
|
7
|
+
<path d="M14 4C14 4.67308 14.48 9 18 9" stroke="#EBDEDC" strokeWidth="2" stroke-linecap="round" />
|
|
8
8
|
</svg>
|
|
9
9
|
);
|
|
10
10
|
};
|
package/src/ui/icons/wallet.tsx
CHANGED
|
@@ -2,14 +2,12 @@ export const WalletIcon = (props: React.SVGProps<SVGSVGElement>) => {
|
|
|
2
2
|
return (
|
|
3
3
|
<svg xmlns="http://www.w3.org/2000/svg" width={24} height={24} viewBox="0 0 12 12" fill="none" {...props}>
|
|
4
4
|
<path
|
|
5
|
-
|
|
6
|
-
clip-rule="evenodd"
|
|
5
|
+
clipRule="evenodd"
|
|
7
6
|
d="M2.25 1.125C1.62868 1.125 1.125 1.62868 1.125 2.25V3.25V10C1.125 10.6213 1.62868 11.125 2.25 11.125H9.75C10.3713 11.125 10.875 10.6213 10.875 10V8.5C10.875 8.47885 10.8732 8.4581 10.8699 8.43791C11.3095 8.28493 11.625 7.86688 11.625 7.37512V6.66092C11.625 6.24411 11.2859 5.86414 10.875 5.65915V4C10.875 3.37868 10.3713 2.875 9.75 2.875H9.625V2.25C9.625 1.62868 9.12132 1.125 8.5 1.125H2.25ZM10.2206 6.25012C10.2893 6.32677 10.389 6.375 10.5 6.375C10.5051 6.375 10.5103 6.3749 10.5154 6.37469C10.6967 6.51463 10.875 6.73984 10.875 6.87512V7.37512C10.875 7.58223 10.7071 7.75012 10.5 7.75012H9.00003C8.65485 7.75012 8.25003 7.4703 8.25003 7.12512C8.25003 6.77994 8.65485 6.25012 9.00003 6.25012H10.2206ZM10.125 5.52513V4C10.125 3.79289 9.95711 3.625 9.75 3.625H9.25H1.875V10C1.875 10.2071 2.04289 10.375 2.25 10.375H9.75C9.95711 10.375 10.125 10.2071 10.125 10V8.5C10.125 8.47904 10.1267 8.45848 10.13 8.43845L9.00003 8.25012C8.24064 8.25012 7.75003 7.88451 7.75003 7.12512C7.75003 6.36573 8.24064 5.75012 9.00003 5.75012L10.125 5.52513ZM8.875 2.875H1.875V2.25C1.875 2.04289 2.04289 1.875 2.25 1.875H8.5C8.70711 1.875 8.875 2.04289 8.875 2.25V2.875Z"
|
|
8
7
|
fill="#ececec"
|
|
9
8
|
/>
|
|
10
9
|
<path
|
|
11
|
-
|
|
12
|
-
clip-rule="evenodd"
|
|
10
|
+
clipRule="evenodd"
|
|
13
11
|
d="M2.25 1.125C1.62868 1.125 1.125 1.62868 1.125 2.25V3.25V9.5C1.125 10.1213 1.62868 10.625 2.25 10.625H9.25C9.87132 10.625 10.375 10.1213 10.375 9.5V8.36813C10.9375 8.30594 11.375 7.82906 11.375 7.25V6.75C11.375 6.17094 10.9375 5.69406 10.375 5.63187V4C10.375 3.37868 9.87132 2.875 9.25 2.875H9.125V2.25C9.125 1.62868 8.62132 1.125 8 1.125H2.25ZM9.625 5.625V4C9.625 3.79289 9.45711 3.625 9.25 3.625H8.75H1.875V9.5C1.875 9.70711 2.04289 9.875 2.25 9.875H9.25C9.45711 9.875 9.625 9.70711 9.625 9.5V8.375H8.99997C8.24058 8.375 7.62497 7.75939 7.62497 7C7.62497 6.24061 8.24058 5.625 8.99997 5.625H9.625ZM10 7.625H10.25C10.4571 7.625 10.625 7.45711 10.625 7.25V6.75C10.625 6.54289 10.4571 6.375 10.25 6.375H10H8.99997C8.65479 6.375 8.37497 6.65482 8.37497 7C8.37497 7.34518 8.65479 7.625 8.99997 7.625H10ZM8.375 2.875H1.875V2.25C1.875 2.04289 2.04289 1.875 2.25 1.875H8C8.20711 1.875 8.375 2.04289 8.375 2.25V2.875Z"
|
|
14
12
|
fill="#ececec"
|
|
15
13
|
/>
|
|
@@ -170,9 +170,16 @@ export const Bridge = observer(({ hot, widget, setup, onClose, onProcess, onSele
|
|
|
170
170
|
log("Signing transaction");
|
|
171
171
|
|
|
172
172
|
const result = await hot.exchange.makeSwap(review, { log });
|
|
173
|
-
|
|
173
|
+
let resultReview = result.review;
|
|
174
|
+
|
|
175
|
+
if (result.processing) {
|
|
176
|
+
log("Waiting for transaction to be confirmed");
|
|
177
|
+
resultReview = await result.processing();
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
setProcessing({ status: "success", message: "Transaction signed", review: resultReview });
|
|
174
181
|
if (setup?.autoClose) onClose();
|
|
175
|
-
return
|
|
182
|
+
return resultReview;
|
|
176
183
|
} catch (e) {
|
|
177
184
|
setProcessing({ status: "error", message: e?.toString?.() ?? "Unknown error", review });
|
|
178
185
|
throw e;
|