@hot-labs/kit 1.0.56 → 1.0.57

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.
Files changed (54) hide show
  1. package/build/core/chains.js +1 -1
  2. package/build/core/chains.js.map +1 -1
  3. package/build/evm/connector.d.ts +1 -3
  4. package/build/evm/connector.js +3 -11
  5. package/build/evm/connector.js.map +1 -1
  6. package/build/evm/injected.js +3 -3
  7. package/build/evm/injected.js.map +1 -1
  8. package/build/hot-wallet/iframe.d.ts +36 -3
  9. package/build/hot-wallet/iframe.js +134 -27
  10. package/build/hot-wallet/iframe.js.map +1 -1
  11. package/build/hot-wallet/proxy.d.ts +8 -0
  12. package/build/hot-wallet/proxy.js +45 -0
  13. package/build/hot-wallet/proxy.js.map +1 -0
  14. package/build/solana/connector.js +2 -2
  15. package/build/solana/connector.js.map +1 -1
  16. package/build/solana/injected/account.js +1 -2
  17. package/build/solana/injected/account.js.map +1 -1
  18. package/build/solana/injected/index.js +16 -19
  19. package/build/solana/injected/index.js.map +1 -1
  20. package/build/stellar/connector.d.ts +10 -4
  21. package/build/stellar/connector.js +39 -28
  22. package/build/stellar/connector.js.map +1 -1
  23. package/build/stellar/freigher.d.ts +46 -0
  24. package/build/stellar/freigher.js +110 -0
  25. package/build/stellar/freigher.js.map +1 -0
  26. package/build/stellar/{injected.d.ts → hotWallet.d.ts} +1 -6
  27. package/build/stellar/hotWallet.js +28 -0
  28. package/build/stellar/hotWallet.js.map +1 -0
  29. package/build/ton/connector.js +6 -3
  30. package/build/ton/connector.js.map +1 -1
  31. package/build/ton/injected.js +6 -6
  32. package/build/ton/injected.js.map +1 -1
  33. package/build/ui/Popup.js +1 -1
  34. package/build/ui/Popup.js.map +1 -1
  35. package/build/ui/styles.js +4 -3
  36. package/build/ui/styles.js.map +1 -1
  37. package/package.json +3 -2
  38. package/src/core/chains.ts +1 -1
  39. package/src/evm/connector.ts +4 -12
  40. package/src/evm/injected.ts +3 -3
  41. package/src/hot-wallet/iframe.ts +151 -24
  42. package/src/hot-wallet/proxy.ts +54 -0
  43. package/src/solana/connector.ts +2 -2
  44. package/src/solana/injected/account.ts +1 -2
  45. package/src/solana/injected/index.ts +15 -18
  46. package/src/stellar/connector.ts +42 -29
  47. package/src/stellar/freigher.ts +119 -0
  48. package/src/stellar/{injected.ts → hotWallet.ts} +8 -12
  49. package/src/ton/connector.ts +14 -10
  50. package/src/ton/injected.ts +6 -6
  51. package/src/ui/Popup.tsx +7 -3
  52. package/src/ui/styles.ts +4 -3
  53. package/build/stellar/injected.js +0 -32
  54. package/build/stellar/injected.js.map +0 -1
@@ -1,10 +1,10 @@
1
- import { TonConnectUI, TonConnect } from "@tonconnect/ui";
1
+ import { TonConnectUI, TonConnect, Feature } from "@tonconnect/ui";
2
2
  import { runInAction } from "mobx";
3
3
 
4
4
  import { WalletType } from "../core/chains";
5
5
  import { HotConnector } from "../HotConnector";
6
6
  import { ConnectorType, OmniConnector } from "../OmniConnector";
7
- import { isInjected } from "../hot-wallet/iframe";
7
+ import HOT from "../hot-wallet/iframe";
8
8
  import TonWallet from "./wallet";
9
9
 
10
10
  export interface TonConnectorOptions {
@@ -30,6 +30,8 @@ const hotWallet = {
30
30
  ],
31
31
  };
32
32
 
33
+ const isSignDataFeature = (feature: Feature) => typeof feature === "object" && feature.name === "SignData" && feature.types.includes("text");
34
+
33
35
  class TonConnector extends OmniConnector<TonWallet> {
34
36
  type = ConnectorType.WALLET;
35
37
  walletTypes = [WalletType.TON, WalletType.OMNI];
@@ -78,13 +80,15 @@ class TonConnector extends OmniConnector<TonWallet> {
78
80
  tonConnect.connector.restoreConnection();
79
81
  tonConnect.getWallets().then((wallets) => {
80
82
  runInAction(() => {
81
- this.options = wallets.map((w) => ({
82
- name: w.name,
83
- icon: w.imageUrl,
84
- id: w.appName,
85
- download: w.aboutUrl,
86
- type: "external" as const,
87
- }));
83
+ this.options = wallets
84
+ .filter((t) => t.features?.some(isSignDataFeature))
85
+ .map((w) => ({
86
+ name: w.name,
87
+ icon: w.imageUrl,
88
+ id: w.appName,
89
+ download: w.aboutUrl,
90
+ type: "external" as const,
91
+ }));
88
92
  });
89
93
  });
90
94
 
@@ -94,7 +98,7 @@ class TonConnector extends OmniConnector<TonWallet> {
94
98
  tcRoot.style.position = "fixed";
95
99
  }
96
100
 
97
- if (isInjected()) {
101
+ if (HOT.isInjected) {
98
102
  tonConnect.getWallets().then((wallets) => {
99
103
  const wallet = wallets.find((w) => w.appName === "hot");
100
104
  if (wallet) tonConnect.connector.connect(wallet, { tonProof: "wibe3" });
@@ -1,6 +1,6 @@
1
- import { isInjected, requestHot } from "../hot-wallet/iframe";
1
+ import HOT from "../hot-wallet/iframe";
2
2
 
3
- if (isInjected()) {
3
+ if (HOT.isInjected) {
4
4
  // @ts-expect-error: hotWallet is not defined
5
5
  window.hotWallet = {
6
6
  tonconnect: {
@@ -33,19 +33,19 @@ if (isInjected()) {
33
33
  isWalletBrowser: true,
34
34
 
35
35
  connect: (_: number, request: any) => {
36
- return requestHot("ton:connect", request);
36
+ return HOT.request("ton:connect", request);
37
37
  },
38
38
 
39
39
  restoreConnection: () => {
40
- return requestHot("ton:restoreConnection", {});
40
+ return HOT.request("ton:restoreConnection", {});
41
41
  },
42
42
 
43
43
  disconnect: () => {
44
- return requestHot("ton:disconnect", {});
44
+ return HOT.request("ton:disconnect", {});
45
45
  },
46
46
 
47
47
  send: async (request: any) => {
48
- return requestHot("ton:send", request);
48
+ return HOT.request("ton:send", request);
49
49
  },
50
50
 
51
51
  listen: () => {
package/src/ui/Popup.tsx CHANGED
@@ -65,9 +65,13 @@ const Popup = ({ widget, children, header, onClose, style, mobileFullscreen }: P
65
65
  )}
66
66
  <ModalBody style={{ overflowX: "hidden", ...style }}>{children}</ModalBody>
67
67
  <Footer>
68
- <img src="https://tgapp.herewallet.app/images/hot/hot-icon.png" alt="HOT Connector" />
69
- <p>HOT Connector</p>
70
- <GetWalletLink href="https://download.hot-labs.org/kit" target="_blank">
68
+ <GetWalletLink href="https://hot-labs.org" rel="noreferrer" target="_blank" style={{ marginLeft: 0, display: "flex", alignItems: "center", gap: 4 }}>
69
+ <p>Secured by</p>
70
+ <img src="https://tgapp.herewallet.app/images/hot/hot-icon.png" alt="HOT Labs" />
71
+ <p>HOT</p>
72
+ </GetWalletLink>
73
+
74
+ <GetWalletLink href="https://download.hot-labs.org/kit" rel="noreferrer" target="_blank">
71
75
  Don't have a wallet?
72
76
  </GetWalletLink>
73
77
  </Footer>
package/src/ui/styles.ts CHANGED
@@ -169,17 +169,18 @@ export const Footer = styled.div`
169
169
  `;
170
170
 
171
171
  export const GetWalletLink = styled.a`
172
- color: rgba(255, 255, 255, 0.5);
172
+ color: #fff;
173
173
  text-align: center;
174
174
  font-size: 16px;
175
175
  font-style: normal;
176
176
  font-weight: 500;
177
177
  margin-left: auto;
178
178
  text-decoration: none;
179
- transition: color 0.2s ease-in-out;
179
+ transition: opacity 0.2s ease-in-out;
180
+ opacity: 0.8;
180
181
 
181
182
  &:hover {
182
- color: rgba(255, 255, 255, 1);
183
+ opacity: 1;
183
184
  }
184
185
  `;
185
186
 
@@ -1,32 +0,0 @@
1
- import { ModuleType, WalletNetwork } from "@creit.tech/stellar-wallets-kit";
2
- import { requestHot } from "../hot-wallet/iframe";
3
- export const HOTWALLET_ID = "hot-wallet";
4
- /**
5
- * **IMPORTANT**: This module requires that you have a "global" and a "Buffer" polyfill in your app, if not provided then this module will break your app.
6
- */
7
- export class HotWalletModule {
8
- moduleType = ModuleType.HOT_WALLET;
9
- productId = HOTWALLET_ID;
10
- productName = "HOT Wallet";
11
- productUrl = "https://hot-labs.org/wallet";
12
- productIcon = "https://storage.herewallet.app/logo.png";
13
- async isAvailable() {
14
- return true;
15
- }
16
- async getAddress() {
17
- return await requestHot("stellar:getAddress", {});
18
- }
19
- async signTransaction(xdr, opts) {
20
- return await requestHot("stellar:signTransaction", { xdr, accountToSign: opts?.address });
21
- }
22
- async signAuthEntry(authEntry, opts) {
23
- return await requestHot("stellar:signAuthEntry", { authEntry, accountToSign: opts?.address });
24
- }
25
- async signMessage(message, opts) {
26
- return await requestHot("stellar:signMessage", { message, accountToSign: opts?.address });
27
- }
28
- async getNetwork() {
29
- return { network: "mainnet", networkPassphrase: WalletNetwork.PUBLIC };
30
- }
31
- }
32
- //# sourceMappingURL=injected.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"injected.js","sourceRoot":"","sources":["../../src/stellar/injected.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,UAAU,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAClG,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,MAAM,CAAC,MAAM,YAAY,GAAW,YAAY,CAAC;AAEjD;;GAEG;AACH,MAAM,OAAO,eAAe;IAC1B,UAAU,GAAe,UAAU,CAAC,UAAU,CAAC;IAC/C,SAAS,GAAW,YAAY,CAAC;IACjC,WAAW,GAAW,YAAY,CAAC;IACnC,UAAU,GAAW,6BAA6B,CAAC;IACnD,WAAW,GAAW,yCAAyC,CAAC;IAEhE,KAAK,CAAC,WAAW;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,UAAU;QACd,OAAO,MAAM,UAAU,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,GAAW,EAAE,IAA2B;QAC5D,OAAO,MAAM,UAAU,CAAC,yBAAyB,EAAE,EAAE,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAC5F,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,SAAiB,EAAE,IAA2B;QAChE,OAAO,MAAM,UAAU,CAAC,uBAAuB,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAChG,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAAe,EAAE,IAA2B;QAC5D,OAAO,MAAM,UAAU,CAAC,qBAAqB,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAC5F,CAAC;IAED,KAAK,CAAC,UAAU;QACd,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC;IACzE,CAAC;CACF"}