@hot-labs/kit 1.0.33
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/.eslintrc.cjs +11 -0
- package/.github/workflows/deploy-example.yml +55 -0
- package/.github/workflows/release.yml +74 -0
- package/.prettierrc +4 -0
- package/.prototools +2 -0
- package/.vscode/settings.json +3 -0
- package/CHANGELOG.md +1 -0
- package/README.md +67 -0
- package/build/GoogleConnector.d.ts +20 -0
- package/build/GoogleConnector.js +76 -0
- package/build/GoogleConnector.js.map +1 -0
- package/build/HotConnector.d.ts +91 -0
- package/build/HotConnector.js +285 -0
- package/build/HotConnector.js.map +1 -0
- package/build/OmniConnector.d.ts +95 -0
- package/build/OmniConnector.js +123 -0
- package/build/OmniConnector.js.map +1 -0
- package/build/OmniWallet.d.ts +57 -0
- package/build/OmniWallet.js +56 -0
- package/build/OmniWallet.js.map +1 -0
- package/build/cosmos/connector.d.ts +53 -0
- package/build/cosmos/connector.js +207 -0
- package/build/cosmos/connector.js.map +1 -0
- package/build/cosmos/wallet.d.ts +28 -0
- package/build/cosmos/wallet.js +59 -0
- package/build/cosmos/wallet.js.map +1 -0
- package/build/events.d.ts +42 -0
- package/build/events.js +64 -0
- package/build/events.js.map +1 -0
- package/build/evm/abi.d.ts +17 -0
- package/build/evm/abi.js +38 -0
- package/build/evm/abi.js.map +1 -0
- package/build/evm/connector.d.ts +35 -0
- package/build/evm/connector.js +124 -0
- package/build/evm/connector.js.map +1 -0
- package/build/evm/wallet.d.ts +47 -0
- package/build/evm/wallet.js +136 -0
- package/build/evm/wallet.js.map +1 -0
- package/build/exchange.d.ts +63 -0
- package/build/exchange.js +384 -0
- package/build/exchange.js.map +1 -0
- package/build/hot-wallet/evm.d.ts +1 -0
- package/build/hot-wallet/evm.js +33 -0
- package/build/hot-wallet/evm.js.map +1 -0
- package/build/hot-wallet/hot.d.ts +3 -0
- package/build/hot-wallet/hot.js +40 -0
- package/build/hot-wallet/hot.js.map +1 -0
- package/build/hot-wallet/index.d.ts +4 -0
- package/build/hot-wallet/index.js +5 -0
- package/build/hot-wallet/index.js.map +1 -0
- package/build/hot-wallet/solana/account.d.ts +11 -0
- package/build/hot-wallet/solana/account.js +42 -0
- package/build/hot-wallet/solana/account.js.map +1 -0
- package/build/hot-wallet/solana/index.d.ts +1 -0
- package/build/hot-wallet/solana/index.js +85 -0
- package/build/hot-wallet/solana/index.js.map +1 -0
- package/build/hot-wallet/solana/register.d.ts +2 -0
- package/build/hot-wallet/solana/register.js +41 -0
- package/build/hot-wallet/solana/register.js.map +1 -0
- package/build/hot-wallet/solana/solana-wallet.d.ts +34 -0
- package/build/hot-wallet/solana/solana-wallet.js +223 -0
- package/build/hot-wallet/solana/solana-wallet.js.map +1 -0
- package/build/hot-wallet/solana/utils.d.ts +32 -0
- package/build/hot-wallet/solana/utils.js +36 -0
- package/build/hot-wallet/solana/utils.js.map +1 -0
- package/build/hot-wallet/stellar.d.ts +38 -0
- package/build/hot-wallet/stellar.js +32 -0
- package/build/hot-wallet/stellar.js.map +1 -0
- package/build/hot-wallet/ton.d.ts +1 -0
- package/build/hot-wallet/ton.js +49 -0
- package/build/hot-wallet/ton.js.map +1 -0
- package/build/hot-wallet/wallet.d.ts +1 -0
- package/build/hot-wallet/wallet.js +40 -0
- package/build/hot-wallet/wallet.js.map +1 -0
- package/build/index.d.ts +24 -0
- package/build/index.js +25 -0
- package/build/index.js.map +1 -0
- package/build/near/connector.d.ts +28 -0
- package/build/near/connector.js +56 -0
- package/build/near/connector.js.map +1 -0
- package/build/near/wallet.d.ts +62 -0
- package/build/near/wallet.js +233 -0
- package/build/near/wallet.js.map +1 -0
- package/build/omni/Intents.d.ts +93 -0
- package/build/omni/Intents.js +395 -0
- package/build/omni/Intents.js.map +1 -0
- package/build/omni/bridge.d.ts +3 -0
- package/build/omni/bridge.js +34 -0
- package/build/omni/bridge.js.map +1 -0
- package/build/omni/config.d.ts +99 -0
- package/build/omni/config.js +126 -0
- package/build/omni/config.js.map +1 -0
- package/build/omni/defaultTokens.d.ts +17 -0
- package/build/omni/defaultTokens.js +1079 -0
- package/build/omni/defaultTokens.js.map +1 -0
- package/build/omni/index.d.ts +8 -0
- package/build/omni/index.js +9 -0
- package/build/omni/index.js.map +1 -0
- package/build/omni/nearRpc.d.ts +24 -0
- package/build/omni/nearRpc.js +167 -0
- package/build/omni/nearRpc.js.map +1 -0
- package/build/omni/recipient.d.ts +10 -0
- package/build/omni/recipient.js +40 -0
- package/build/omni/recipient.js.map +1 -0
- package/build/omni/token.d.ts +36 -0
- package/build/omni/token.js +136 -0
- package/build/omni/token.js.map +1 -0
- package/build/omni/tokens.d.ts +14 -0
- package/build/omni/tokens.js +57 -0
- package/build/omni/tokens.js.map +1 -0
- package/build/omni/types.d.ts +41 -0
- package/build/omni/types.js +2 -0
- package/build/omni/types.js.map +1 -0
- package/build/omni/utils.d.ts +24 -0
- package/build/omni/utils.js +150 -0
- package/build/omni/utils.js.map +1 -0
- package/build/settings.d.ts +5 -0
- package/build/settings.js +6 -0
- package/build/settings.js.map +1 -0
- package/build/solana/connector.d.ts +31 -0
- package/build/solana/connector.js +138 -0
- package/build/solana/connector.js.map +1 -0
- package/build/solana/protocol.d.ts +25 -0
- package/build/solana/protocol.js +56 -0
- package/build/solana/protocol.js.map +1 -0
- package/build/solana/wallet.d.ts +47 -0
- package/build/solana/wallet.js +188 -0
- package/build/solana/wallet.js.map +1 -0
- package/build/solana/wallets.d.ts +102 -0
- package/build/solana/wallets.js +150 -0
- package/build/solana/wallets.js.map +1 -0
- package/build/stellar/connector.d.ts +25 -0
- package/build/stellar/connector.js +56 -0
- package/build/stellar/connector.js.map +1 -0
- package/build/stellar/wallet.d.ts +70 -0
- package/build/stellar/wallet.js +225 -0
- package/build/stellar/wallet.js.map +1 -0
- package/build/storage.d.ts +10 -0
- package/build/storage.js +12 -0
- package/build/storage.js.map +1 -0
- package/build/ton/connector.d.ts +25 -0
- package/build/ton/connector.js +119 -0
- package/build/ton/connector.js.map +1 -0
- package/build/ton/utils.d.ts +45 -0
- package/build/ton/utils.js +64 -0
- package/build/ton/utils.js.map +1 -0
- package/build/ton/wallet.d.ts +70 -0
- package/build/ton/wallet.js +154 -0
- package/build/ton/wallet.js.map +1 -0
- package/build/ui/Popup.d.ts +10 -0
- package/build/ui/Popup.js +38 -0
- package/build/ui/Popup.js.map +1 -0
- package/build/ui/connect/AuthPopup.d.ts +2 -0
- package/build/ui/connect/AuthPopup.js +48 -0
- package/build/ui/connect/AuthPopup.js.map +1 -0
- package/build/ui/connect/ConnectWallet.d.ts +9 -0
- package/build/ui/connect/ConnectWallet.js +22 -0
- package/build/ui/connect/ConnectWallet.js.map +1 -0
- package/build/ui/connect/LogoutPopup.d.ts +10 -0
- package/build/ui/connect/LogoutPopup.js +8 -0
- package/build/ui/connect/LogoutPopup.js.map +1 -0
- package/build/ui/connect/WCPopup.d.ts +13 -0
- package/build/ui/connect/WCPopup.js +81 -0
- package/build/ui/connect/WCPopup.js.map +1 -0
- package/build/ui/connect/WCRequest.d.ts +9 -0
- package/build/ui/connect/WCRequest.js +13 -0
- package/build/ui/connect/WCRequest.js.map +1 -0
- package/build/ui/connect/WalletPicker.d.ts +11 -0
- package/build/ui/connect/WalletPicker.js +48 -0
- package/build/ui/connect/WalletPicker.js.map +1 -0
- package/build/ui/icons/arrow-right.d.ts +1 -0
- package/build/ui/icons/arrow-right.js +5 -0
- package/build/ui/icons/arrow-right.js.map +1 -0
- package/build/ui/icons/exchange.d.ts +6 -0
- package/build/ui/icons/exchange.js +6 -0
- package/build/ui/icons/exchange.js.map +1 -0
- package/build/ui/icons/logout.d.ts +1 -0
- package/build/ui/icons/logout.js +3 -0
- package/build/ui/icons/logout.js.map +1 -0
- package/build/ui/icons/pending.d.ts +1 -0
- package/build/ui/icons/pending.js +5 -0
- package/build/ui/icons/pending.js.map +1 -0
- package/build/ui/icons/qr.d.ts +1 -0
- package/build/ui/icons/qr.js +5 -0
- package/build/ui/icons/qr.js.map +1 -0
- package/build/ui/icons/search.d.ts +1 -0
- package/build/ui/icons/search.js +5 -0
- package/build/ui/icons/search.js.map +1 -0
- package/build/ui/icons/switch.d.ts +1 -0
- package/build/ui/icons/switch.js +5 -0
- package/build/ui/icons/switch.js.map +1 -0
- package/build/ui/icons/wallet.d.ts +1 -0
- package/build/ui/icons/wallet.js +5 -0
- package/build/ui/icons/wallet.js.map +1 -0
- package/build/ui/payment/Bridge.d.ts +27 -0
- package/build/ui/payment/Bridge.js +340 -0
- package/build/ui/payment/Bridge.js.map +1 -0
- package/build/ui/payment/DepositQR.d.ts +9 -0
- package/build/ui/payment/DepositQR.js +56 -0
- package/build/ui/payment/DepositQR.js.map +1 -0
- package/build/ui/payment/Payment.d.ts +16 -0
- package/build/ui/payment/Payment.js +50 -0
- package/build/ui/payment/Payment.js.map +1 -0
- package/build/ui/payment/Profile.d.ts +7 -0
- package/build/ui/payment/Profile.js +88 -0
- package/build/ui/payment/Profile.js.map +1 -0
- package/build/ui/payment/SelectRecipient.d.ts +14 -0
- package/build/ui/payment/SelectRecipient.js +68 -0
- package/build/ui/payment/SelectRecipient.js.map +1 -0
- package/build/ui/payment/SelectSender.d.ts +13 -0
- package/build/ui/payment/SelectSender.js +23 -0
- package/build/ui/payment/SelectSender.js.map +1 -0
- package/build/ui/payment/SelectToken.d.ts +13 -0
- package/build/ui/payment/SelectToken.js +92 -0
- package/build/ui/payment/SelectToken.js.map +1 -0
- package/build/ui/payment/TokenCard.d.ts +23 -0
- package/build/ui/payment/TokenCard.js +50 -0
- package/build/ui/payment/TokenCard.js.map +1 -0
- package/build/ui/router.d.ts +37 -0
- package/build/ui/router.js +56 -0
- package/build/ui/router.js.map +1 -0
- package/build/ui/styles.d.ts +11 -0
- package/build/ui/styles.js +273 -0
- package/build/ui/styles.js.map +1 -0
- package/package.json +60 -0
- package/skill.md +989 -0
- package/src/GoogleConnector.ts +102 -0
- package/src/HotConnector.ts +344 -0
- package/src/OmniConnector.ts +161 -0
- package/src/OmniWallet.ts +94 -0
- package/src/cosmos/connector.ts +242 -0
- package/src/cosmos/wallet.ts +77 -0
- package/src/events.ts +66 -0
- package/src/evm/abi.ts +39 -0
- package/src/evm/connector.ts +139 -0
- package/src/evm/wallet.ts +156 -0
- package/src/exchange.ts +426 -0
- package/src/hot-wallet/evm.ts +38 -0
- package/src/hot-wallet/hot.ts +39 -0
- package/src/hot-wallet/index.ts +4 -0
- package/src/hot-wallet/solana/account.ts +52 -0
- package/src/hot-wallet/solana/index.ts +98 -0
- package/src/hot-wallet/solana/register.ts +48 -0
- package/src/hot-wallet/solana/solana-wallet.ts +280 -0
- package/src/hot-wallet/solana/utils.ts +56 -0
- package/src/hot-wallet/stellar.ts +39 -0
- package/src/hot-wallet/ton.ts +56 -0
- package/src/hot-wallet/wallet.ts +44 -0
- package/src/index.ts +30 -0
- package/src/near/connector.ts +71 -0
- package/src/near/wallet.ts +255 -0
- package/src/omni/Intents.ts +454 -0
- package/src/omni/bridge.ts +38 -0
- package/src/omni/config.ts +130 -0
- package/src/omni/defaultTokens.ts +1078 -0
- package/src/omni/index.ts +8 -0
- package/src/omni/nearRpc.ts +187 -0
- package/src/omni/recipient.ts +41 -0
- package/src/omni/token.ts +125 -0
- package/src/omni/tokens.ts +68 -0
- package/src/omni/types.ts +46 -0
- package/src/omni/utils.ts +163 -0
- package/src/settings.ts +5 -0
- package/src/solana/connector.ts +151 -0
- package/src/solana/protocol.ts +66 -0
- package/src/solana/wallet.ts +230 -0
- package/src/solana/wallets.ts +243 -0
- package/src/stellar/connector.ts +69 -0
- package/src/stellar/wallet.ts +267 -0
- package/src/storage.ts +19 -0
- package/src/ton/connector.ts +138 -0
- package/src/ton/utils.ts +73 -0
- package/src/ton/wallet.ts +178 -0
- package/src/ui/Popup.tsx +62 -0
- package/src/ui/connect/AuthPopup.tsx +78 -0
- package/src/ui/connect/ConnectWallet.tsx +63 -0
- package/src/ui/connect/LogoutPopup.tsx +20 -0
- package/src/ui/connect/WCPopup.tsx +122 -0
- package/src/ui/connect/WCRequest.tsx +28 -0
- package/src/ui/connect/WalletPicker.tsx +92 -0
- package/src/ui/icons/arrow-right.tsx +8 -0
- package/src/ui/icons/exchange.tsx +17 -0
- package/src/ui/icons/logout.tsx +18 -0
- package/src/ui/icons/pending.tsx +18 -0
- package/src/ui/icons/qr.tsx +12 -0
- package/src/ui/icons/search.tsx +18 -0
- package/src/ui/icons/switch.tsx +10 -0
- package/src/ui/icons/wallet.tsx +18 -0
- package/src/ui/payment/Bridge.tsx +582 -0
- package/src/ui/payment/DepositQR.tsx +88 -0
- package/src/ui/payment/Payment.tsx +78 -0
- package/src/ui/payment/Profile.tsx +140 -0
- package/src/ui/payment/SelectRecipient.tsx +111 -0
- package/src/ui/payment/SelectSender.tsx +60 -0
- package/src/ui/payment/SelectToken.tsx +134 -0
- package/src/ui/payment/TokenCard.tsx +83 -0
- package/src/ui/router.tsx +92 -0
- package/src/ui/styles.ts +284 -0
- package/tsconfig.json +22 -0
- package/vite.config.ts +17 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { HotConnector } from "../HotConnector";
|
|
2
|
+
import { OmniConnector } from "../OmniConnector";
|
|
3
|
+
import { BridgeReview } from "../exchange";
|
|
4
|
+
import { Token } from "../omni/token";
|
|
5
|
+
import { OmniWallet } from "../OmniWallet";
|
|
6
|
+
import { WalletType } from "../omni/config";
|
|
7
|
+
import { Recipient } from "../omni/recipient";
|
|
8
|
+
|
|
9
|
+
import { present } from "./Popup";
|
|
10
|
+
import { Payment } from "./payment/Payment";
|
|
11
|
+
import { LogoutPopup } from "./connect/LogoutPopup";
|
|
12
|
+
import { Bridge } from "./payment/Bridge";
|
|
13
|
+
import { Profile } from "./payment/Profile";
|
|
14
|
+
import { SelectTokenPopup } from "./payment/SelectToken";
|
|
15
|
+
import { WalletPicker } from "./connect/WalletPicker";
|
|
16
|
+
import { BridgeProps } from "./payment/Bridge";
|
|
17
|
+
import { Connector } from "./connect/ConnectWallet";
|
|
18
|
+
import { SelectSender } from "./payment/SelectSender";
|
|
19
|
+
import { SelectRecipient } from "./payment/SelectRecipient";
|
|
20
|
+
import { WCRequest } from "./connect/WCRequest";
|
|
21
|
+
|
|
22
|
+
export const openPayment = (connector: HotConnector, token: Token, amount: bigint, recipient?: Recipient) => {
|
|
23
|
+
return new Promise<Promise<BridgeReview>>((resolve, reject) => {
|
|
24
|
+
present((close) => (
|
|
25
|
+
<Payment //
|
|
26
|
+
onClose={() => (close(), reject(new Error("User rejected")))}
|
|
27
|
+
onProcess={(task) => (close(), resolve(task))}
|
|
28
|
+
connector={connector}
|
|
29
|
+
token={token}
|
|
30
|
+
amount={amount}
|
|
31
|
+
recipient={recipient}
|
|
32
|
+
/>
|
|
33
|
+
));
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const openLogoutPopup = (connector: OmniConnector) => {
|
|
38
|
+
return new Promise<void>((resolve, reject) => {
|
|
39
|
+
present((close) => {
|
|
40
|
+
return (
|
|
41
|
+
<LogoutPopup //
|
|
42
|
+
connector={connector}
|
|
43
|
+
onApprove={() => (close(), resolve())}
|
|
44
|
+
onReject={() => (close(), reject(new Error("User rejected")))}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const openBridge = (hot: HotConnector, setup?: BridgeProps["setup"]) => {
|
|
52
|
+
return new Promise<BridgeReview>((resolve, reject) => {
|
|
53
|
+
present((close) => (
|
|
54
|
+
<Bridge //
|
|
55
|
+
hot={hot}
|
|
56
|
+
setup={setup}
|
|
57
|
+
onProcess={resolve}
|
|
58
|
+
onClose={() => (close(), reject(new Error("User rejected")))}
|
|
59
|
+
/>
|
|
60
|
+
));
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const openConnector = (hot: HotConnector) => {
|
|
65
|
+
present((close) => <Connector hot={hot} onClose={close} />);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const openProfile = (hot: HotConnector) => {
|
|
69
|
+
present((close) => <Profile hot={hot} onClose={close} />);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const openSelectTokenPopup = ({ hot, initialChain, onSelect }: { hot: HotConnector; initialChain?: number; onSelect: (token: Token, wallet?: OmniWallet) => void }) => {
|
|
73
|
+
present((close) => <SelectTokenPopup hot={hot} initialChain={initialChain} onClose={close} onSelect={(t, w) => (onSelect(t, w), close())} />);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const openWalletPicker = (connector: OmniConnector, onSelect?: (wallet: OmniWallet) => void) => {
|
|
77
|
+
present((close) => <WalletPicker initialConnector={connector} onSelect={onSelect} onClose={close} />);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const openSelectSender = (props: { hot: HotConnector; type: WalletType; onSelect: (wallet?: OmniWallet | "qr") => void }) => {
|
|
81
|
+
present((close) => <SelectSender {...props} onClose={close} />);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const openSelectRecipient = (props: { hot: HotConnector; recipient?: Recipient; type: WalletType; onSelect: (wallet?: Recipient) => void }) => {
|
|
85
|
+
present((close) => <SelectRecipient {...props} onClose={close} />);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const openWCRequest = <T,>(args: { task: () => Promise<T>; deeplink?: string; name: string; icon: string; request: any }): Promise<T> => {
|
|
89
|
+
const taskPromise = args.task();
|
|
90
|
+
present((close) => <WCRequest deeplink={args.deeplink} name={args.name} icon={args.icon} onClose={close} task={taskPromise} />);
|
|
91
|
+
return taskPromise;
|
|
92
|
+
};
|
package/src/ui/styles.ts
ADDED
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
const font = `-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"`;
|
|
4
|
+
|
|
5
|
+
export const ModalContainer = styled.div`
|
|
6
|
+
position: fixed;
|
|
7
|
+
top: 0;
|
|
8
|
+
left: 0;
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 100%;
|
|
11
|
+
z-index: 100000000;
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
align-items: center;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
transition: opacity 0.2s ease-in-out;
|
|
17
|
+
pointer-events: all;
|
|
18
|
+
|
|
19
|
+
@media (max-width: 600px) {
|
|
20
|
+
justify-content: flex-end;
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
export const ModalOverlay = styled.div`
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: 0;
|
|
27
|
+
left: 0;
|
|
28
|
+
width: 100%;
|
|
29
|
+
height: 100%;
|
|
30
|
+
z-index: 100000000;
|
|
31
|
+
background-color: rgba(0, 0, 0, 0.2);
|
|
32
|
+
backdrop-filter: blur(10px);
|
|
33
|
+
z-index: 1;
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
export const ModalContent = styled.div`
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
align-items: center;
|
|
40
|
+
max-width: 420px;
|
|
41
|
+
max-height: 660px;
|
|
42
|
+
width: 100%;
|
|
43
|
+
border-radius: 24px;
|
|
44
|
+
background: #0d0d0d;
|
|
45
|
+
border: 1.5px solid rgba(255, 255, 255, 0.1);
|
|
46
|
+
transition: transform 0.2s ease-in-out;
|
|
47
|
+
z-index: 2;
|
|
48
|
+
|
|
49
|
+
@media (max-width: 600px) {
|
|
50
|
+
max-width: 100%;
|
|
51
|
+
width: 100%;
|
|
52
|
+
max-height: 90%;
|
|
53
|
+
border-bottom-left-radius: 0;
|
|
54
|
+
border-bottom-right-radius: 0;
|
|
55
|
+
border: none;
|
|
56
|
+
border-top: 1.5px solid rgba(255, 255, 255, 0.1);
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
|
|
60
|
+
export const ModalHeader = styled.div`
|
|
61
|
+
display: flex;
|
|
62
|
+
padding: 16px;
|
|
63
|
+
gap: 16px;
|
|
64
|
+
align-self: stretch;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
position: relative;
|
|
68
|
+
|
|
69
|
+
button {
|
|
70
|
+
position: absolute;
|
|
71
|
+
right: 16px;
|
|
72
|
+
top: 16px;
|
|
73
|
+
width: 32px;
|
|
74
|
+
height: 32px;
|
|
75
|
+
border-radius: 12px;
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
transition: background 0.2s ease-in-out;
|
|
78
|
+
border: none;
|
|
79
|
+
background: none;
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
justify-content: center;
|
|
83
|
+
|
|
84
|
+
&:hover {
|
|
85
|
+
background: rgba(255, 255, 255, 0.04);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
p {
|
|
90
|
+
color: #fff;
|
|
91
|
+
text-align: center;
|
|
92
|
+
font-size: 24px;
|
|
93
|
+
font-style: normal;
|
|
94
|
+
font-weight: 600;
|
|
95
|
+
line-height: normal;
|
|
96
|
+
margin: 0;
|
|
97
|
+
}
|
|
98
|
+
`;
|
|
99
|
+
|
|
100
|
+
export const ModalBody = styled.div`
|
|
101
|
+
display: flex;
|
|
102
|
+
padding: 16px;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
align-items: flex-start;
|
|
105
|
+
text-align: center;
|
|
106
|
+
gap: 4px;
|
|
107
|
+
overflow: auto;
|
|
108
|
+
border-radius: 24px;
|
|
109
|
+
background: rgba(255, 255, 255, 0.08);
|
|
110
|
+
width: 100%;
|
|
111
|
+
flex: 1;
|
|
112
|
+
|
|
113
|
+
textarea {
|
|
114
|
+
width: 100%;
|
|
115
|
+
padding: 12px;
|
|
116
|
+
border-radius: 12px;
|
|
117
|
+
background: #0d0d0d;
|
|
118
|
+
color: #fff;
|
|
119
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
120
|
+
outline: none;
|
|
121
|
+
font-size: 12px;
|
|
122
|
+
transition: background 0.2s ease-in-out;
|
|
123
|
+
font-family: monospace;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
p {
|
|
127
|
+
color: rgba(255, 255, 255, 0.9);
|
|
128
|
+
text-align: center;
|
|
129
|
+
font-size: 16px;
|
|
130
|
+
font-style: normal;
|
|
131
|
+
font-weight: 500;
|
|
132
|
+
line-height: normal;
|
|
133
|
+
letter-spacing: -0.8px;
|
|
134
|
+
}
|
|
135
|
+
`;
|
|
136
|
+
|
|
137
|
+
export const Footer = styled.div`
|
|
138
|
+
width: 100%;
|
|
139
|
+
display: flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
justify-content: flex-start;
|
|
142
|
+
padding: 16px 24px;
|
|
143
|
+
color: #fff;
|
|
144
|
+
gap: 12px;
|
|
145
|
+
|
|
146
|
+
img {
|
|
147
|
+
width: 24px;
|
|
148
|
+
height: 24px;
|
|
149
|
+
border-radius: 50%;
|
|
150
|
+
object-fit: cover;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
* {
|
|
154
|
+
white-space: nowrap;
|
|
155
|
+
overflow: hidden;
|
|
156
|
+
text-overflow: ellipsis;
|
|
157
|
+
}
|
|
158
|
+
`;
|
|
159
|
+
|
|
160
|
+
export const GetWalletLink = styled.a`
|
|
161
|
+
color: rgba(255, 255, 255, 0.5);
|
|
162
|
+
text-align: center;
|
|
163
|
+
font-size: 16px;
|
|
164
|
+
font-style: normal;
|
|
165
|
+
font-weight: 500;
|
|
166
|
+
margin-left: auto;
|
|
167
|
+
text-decoration: none;
|
|
168
|
+
transition: color 0.2s ease-in-out;
|
|
169
|
+
|
|
170
|
+
&:hover {
|
|
171
|
+
color: rgba(255, 255, 255, 1);
|
|
172
|
+
}
|
|
173
|
+
`;
|
|
174
|
+
|
|
175
|
+
export const PopupOption = styled.button`
|
|
176
|
+
display: flex;
|
|
177
|
+
padding: 8px;
|
|
178
|
+
align-items: center;
|
|
179
|
+
align-self: stretch;
|
|
180
|
+
cursor: pointer;
|
|
181
|
+
transition: background 0.2s ease-in-out;
|
|
182
|
+
border-radius: 24px;
|
|
183
|
+
outline: none;
|
|
184
|
+
border: none;
|
|
185
|
+
background: transparent;
|
|
186
|
+
gap: 12px;
|
|
187
|
+
|
|
188
|
+
img {
|
|
189
|
+
width: 44px;
|
|
190
|
+
height: 44px;
|
|
191
|
+
border-radius: 16px;
|
|
192
|
+
object-fit: cover;
|
|
193
|
+
flex-shrink: 0;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
&:hover {
|
|
197
|
+
background: rgba(255, 255, 255, 0.04);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
p {
|
|
201
|
+
color: rgba(255, 255, 255, 0.9);
|
|
202
|
+
text-align: center;
|
|
203
|
+
font-size: 18px;
|
|
204
|
+
font-style: normal;
|
|
205
|
+
font-weight: 600;
|
|
206
|
+
line-height: normal;
|
|
207
|
+
letter-spacing: -0.36px;
|
|
208
|
+
margin: 0;
|
|
209
|
+
}
|
|
210
|
+
`;
|
|
211
|
+
|
|
212
|
+
export const PopupOptionInfo = styled.div`
|
|
213
|
+
display: flex;
|
|
214
|
+
flex-direction: column;
|
|
215
|
+
align-items: flex-start;
|
|
216
|
+
text-align: left;
|
|
217
|
+
flex: 1;
|
|
218
|
+
margin-top: -2px;
|
|
219
|
+
|
|
220
|
+
.wallet-address {
|
|
221
|
+
color: rgba(255, 255, 255, 0.5);
|
|
222
|
+
font-size: 14px;
|
|
223
|
+
font-style: normal;
|
|
224
|
+
font-weight: 400;
|
|
225
|
+
line-height: normal;
|
|
226
|
+
}
|
|
227
|
+
`;
|
|
228
|
+
|
|
229
|
+
export const PopupButton = styled.button`
|
|
230
|
+
width: 100%;
|
|
231
|
+
padding: 12px;
|
|
232
|
+
border-radius: 24px;
|
|
233
|
+
background: rgb(221, 221, 221);
|
|
234
|
+
color: rgb(20, 20, 20) !important;
|
|
235
|
+
font-weight: bold;
|
|
236
|
+
border: none;
|
|
237
|
+
cursor: pointer;
|
|
238
|
+
font-size: 16px;
|
|
239
|
+
transition: background 0.2s ease-in-out;
|
|
240
|
+
margin-top: 16px;
|
|
241
|
+
height: 56px;
|
|
242
|
+
|
|
243
|
+
&:hover {
|
|
244
|
+
background: rgb(160, 160, 160);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
&:disabled {
|
|
248
|
+
opacity: 0.5;
|
|
249
|
+
cursor: not-allowed;
|
|
250
|
+
}
|
|
251
|
+
`;
|
|
252
|
+
|
|
253
|
+
export const PopupRoot = styled.div`
|
|
254
|
+
height: 100%;
|
|
255
|
+
h1,
|
|
256
|
+
h2,
|
|
257
|
+
h3,
|
|
258
|
+
h4,
|
|
259
|
+
h5,
|
|
260
|
+
h6,
|
|
261
|
+
p {
|
|
262
|
+
font-family: ${font};
|
|
263
|
+
margin: 0;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/* Hide scrollbar for all scrollable elements inside PopupRoot */
|
|
267
|
+
&::-webkit-scrollbar {
|
|
268
|
+
display: none;
|
|
269
|
+
}
|
|
270
|
+
scrollbar-width: none; /* Firefox */
|
|
271
|
+
-ms-overflow-style: none; /* Internet Explorer 10+ */
|
|
272
|
+
|
|
273
|
+
/* Also hide scrollbars for all inner elements */
|
|
274
|
+
* {
|
|
275
|
+
font-family: ${font};
|
|
276
|
+
scrollbar-width: none;
|
|
277
|
+
-ms-overflow-style: none;
|
|
278
|
+
box-sizing: border-box;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
*::-webkit-scrollbar {
|
|
282
|
+
display: none;
|
|
283
|
+
}
|
|
284
|
+
`;
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"esModuleInterop": true,
|
|
4
|
+
"moduleResolution": "bundler",
|
|
5
|
+
"alwaysStrict": true,
|
|
6
|
+
"allowJs": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"rootDir": "./src",
|
|
9
|
+
"outDir": "./build",
|
|
10
|
+
"declaration": true,
|
|
11
|
+
"sourceMap": true,
|
|
12
|
+
"allowSyntheticDefaultImports": true,
|
|
13
|
+
"target": "ESNext",
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"module": "ESNext",
|
|
16
|
+
"lib": ["ESNext", "dom"],
|
|
17
|
+
"jsx": "react-jsx",
|
|
18
|
+
"jsxImportSource": "react",
|
|
19
|
+
"resolveJsonModule": true
|
|
20
|
+
},
|
|
21
|
+
"include": ["src"]
|
|
22
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
build: {
|
|
5
|
+
outDir: "build",
|
|
6
|
+
minify: true,
|
|
7
|
+
lib: {
|
|
8
|
+
name: "Wibe3",
|
|
9
|
+
entry: "src/index.ts",
|
|
10
|
+
formats: ["es", "cjs", "iife"],
|
|
11
|
+
fileName: (format) => `wibe3.${format}.js`,
|
|
12
|
+
},
|
|
13
|
+
rollupOptions: {
|
|
14
|
+
external: ["react", "react-dom"],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
});
|