@matchain/matchid-sdk-react 0.1.53-alpha.2 → 0.1.53-alpha.3
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/dist/assets/icon/index.d.mts +4 -2
- package/dist/assets/icon/index.d.ts +4 -2
- package/dist/assets/icon/index.js +19 -0
- package/dist/assets/icon/index.js.map +1 -1
- package/dist/assets/icon/index.mjs +3 -1
- package/dist/{chunk-LHNKZISB.mjs → chunk-3USZ4ZZY.mjs} +20 -2
- package/dist/chunk-3USZ4ZZY.mjs.map +1 -0
- package/dist/{chunk-W5A6WY7Y.mjs → chunk-3YF3P77J.mjs} +46 -8
- package/dist/chunk-3YF3P77J.mjs.map +1 -0
- package/dist/{chunk-4A2YPGO3.mjs → chunk-4EVF2PXX.mjs} +2 -2
- package/dist/{chunk-MX7N57AH.mjs → chunk-OCQ2AIM3.mjs} +7 -2
- package/dist/{chunk-MX7N57AH.mjs.map → chunk-OCQ2AIM3.mjs.map} +1 -1
- package/dist/{chunk-FB5MHLWX.mjs → chunk-V2S54LGG.mjs} +2 -2
- package/dist/components/index.d.mts +3 -3
- package/dist/components/index.d.ts +3 -3
- package/dist/components/index.js +403 -346
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +5 -5
- package/dist/hooks/api/index.d.mts +2 -2
- package/dist/hooks/api/index.d.ts +2 -2
- package/dist/hooks/api/index.js +47 -44
- package/dist/hooks/api/index.js.map +1 -1
- package/dist/hooks/api/index.mjs +5 -5
- package/dist/hooks/index.d.mts +2 -2
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +175 -172
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +5 -5
- package/dist/{index-K5vXmiRX.d.ts → index-BKHtf1Tu.d.ts} +1 -1
- package/dist/{index-DNJuiNdz.d.mts → index-BSUoL5Jo.d.mts} +2 -2
- package/dist/{index-Df-WlkXq.d.ts → index-BVO4Bt59.d.ts} +2 -2
- package/dist/{index-IwwXQ_QV.d.ts → index-CcN5ls1U.d.ts} +1 -1
- package/dist/{index-BsL6zo6a.d.ts → index-Cul4qlZl.d.ts} +1 -1
- package/dist/{index-yy3VTdFU.d.mts → index-CvVl_Xw1.d.mts} +2 -2
- package/dist/{index-BCGJczpk.d.mts → index-DXRsJY9h.d.mts} +1 -1
- package/dist/{index-Bil_db2f.d.mts → index-DgwlV4ve.d.ts} +1 -1
- package/dist/{index-iWHaT8HV.d.mts → index-DrEKzXYX.d.mts} +1 -1
- package/dist/{index-BS-NO8Y2.d.ts → index-EPwrSSOz.d.mts} +1 -1
- package/dist/{index-CZqdmQu1.d.mts → index-ba3VTkaV.d.mts} +1 -1
- package/dist/{index-B8cUP7cH.d.ts → index-lKJjj0w4.d.ts} +2 -2
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +442 -385
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -12
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/{types-CZbR7ERa.d.mts → types-Bgd3Ac92.d.mts} +1 -1
- package/dist/{types-CZbR7ERa.d.ts → types-Bgd3Ac92.d.ts} +1 -1
- package/dist/ui/index.d.mts +3 -3
- package/dist/ui/index.d.ts +3 -3
- package/dist/ui/index.js +62 -59
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/index.mjs +2 -2
- package/dist/utils/index.d.mts +2 -1
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.js +6 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +3 -1
- package/example/dist/assets/ccip-nxE3Zma4.js +1 -0
- package/example/dist/assets/index-BFAv3rdU.css +1 -0
- package/example/dist/assets/index-DMWWRDPI.js +1658 -0
- package/example/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/chunk-LHNKZISB.mjs.map +0 -1
- package/dist/chunk-W5A6WY7Y.mjs.map +0 -1
- package/example/dist/assets/TransportWebHID-BEu7tC0r.js +0 -1
- package/example/dist/assets/bignumber-iG7K-qxw.js +0 -10
- package/example/dist/assets/ccip-a6wQ1Vcb.js +0 -1
- package/example/dist/assets/draggabilly-CRYR_S0q.js +0 -14
- package/example/dist/assets/index--dp9m9Ep.js +0 -1
- package/example/dist/assets/index-BDTHolFv.js +0 -569
- package/example/dist/assets/index-BZl59qLb.js +0 -179
- package/example/dist/assets/index-BmMbYNHO.js +0 -303
- package/example/dist/assets/index-C7cxVRDF.js +0 -1677
- package/example/dist/assets/index-CJk171Yb.js +0 -1
- package/example/dist/assets/index-CQiBesAa.js +0 -3
- package/example/dist/assets/index-D62loNA9.js +0 -3
- package/example/dist/assets/index-DqyX3FG6.js +0 -1
- package/example/dist/assets/index-Gy3FXGhr.css +0 -1
- package/example/dist/assets/inherits_browser-BlmhoU4v.js +0 -1
- package/example/dist/assets/solanaEmbed.esm-Djn-u4Vn.js +0 -38
- /package/dist/{chunk-4A2YPGO3.mjs.map → chunk-4EVF2PXX.mjs.map} +0 -0
- /package/dist/{chunk-FB5MHLWX.mjs.map → chunk-V2S54LGG.mjs.map} +0 -0
|
@@ -16,9 +16,10 @@ import {
|
|
|
16
16
|
useDownMd,
|
|
17
17
|
useHash,
|
|
18
18
|
useLayout_exports
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-V2S54LGG.mjs";
|
|
20
20
|
import {
|
|
21
21
|
NumberFormatter,
|
|
22
|
+
bytesToBase64,
|
|
22
23
|
decodeBase64,
|
|
23
24
|
encodeBase64,
|
|
24
25
|
formatAddress,
|
|
@@ -29,7 +30,7 @@ import {
|
|
|
29
30
|
isValidEmail,
|
|
30
31
|
isValidUsername,
|
|
31
32
|
truncateAddress
|
|
32
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-OCQ2AIM3.mjs";
|
|
33
34
|
import {
|
|
34
35
|
ArrowDownIcon,
|
|
35
36
|
ArrowRightIcon,
|
|
@@ -57,6 +58,7 @@ import {
|
|
|
57
58
|
LoadingIcon_default,
|
|
58
59
|
LoginIcon_default,
|
|
59
60
|
OKXIcon,
|
|
61
|
+
PhantomIcon,
|
|
60
62
|
SOLDarkIcon,
|
|
61
63
|
SOLLightIcon,
|
|
62
64
|
TRXDarkIcon,
|
|
@@ -72,7 +74,7 @@ import {
|
|
|
72
74
|
XIcon,
|
|
73
75
|
XverseIcon,
|
|
74
76
|
YoutubeIcon
|
|
75
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-3USZ4ZZY.mjs";
|
|
76
78
|
import {
|
|
77
79
|
__export
|
|
78
80
|
} from "./chunk-J5LGTIGS.mjs";
|
|
@@ -2977,7 +2979,7 @@ var en_default = {
|
|
|
2977
2979
|
amountPlaceholder: "Enter the Amount.",
|
|
2978
2980
|
balance: "Balance",
|
|
2979
2981
|
receiveTitle: "Received wallet address",
|
|
2980
|
-
receivePlaceholder: "Enter the
|
|
2982
|
+
receivePlaceholder: "Enter the Receiving wallet address.",
|
|
2981
2983
|
next: "Next",
|
|
2982
2984
|
copied: "Copied",
|
|
2983
2985
|
receiveQrcode: "Receive by scanning the QR code",
|
|
@@ -5399,7 +5401,7 @@ var LeatherAdapter = class {
|
|
|
5399
5401
|
return response.result.addresses[0].address;
|
|
5400
5402
|
}
|
|
5401
5403
|
async signMessage(message) {
|
|
5402
|
-
if (!await this.isInstalled()) throw new Error("
|
|
5404
|
+
if (!await this.isInstalled()) throw new Error("Leather Wallet is not installed");
|
|
5403
5405
|
const response = await window.LeatherProvider?.request("signMessage", { message });
|
|
5404
5406
|
matchlog_default.log("response", response);
|
|
5405
5407
|
return response.result.signature;
|
|
@@ -5408,8 +5410,43 @@ var LeatherAdapter = class {
|
|
|
5408
5410
|
|
|
5409
5411
|
// src/hooks/useBTCWallet.ts
|
|
5410
5412
|
import { useEffect as useEffect20, useState as useState22 } from "react";
|
|
5413
|
+
|
|
5414
|
+
// src/lib/btc/PhantomAdapter.ts
|
|
5415
|
+
var PhantomAdapter = class {
|
|
5416
|
+
constructor() {
|
|
5417
|
+
this.name = "Phantom Wallet";
|
|
5418
|
+
this.website = "https://www.phantom.com/";
|
|
5419
|
+
this.walletKey = "phantom";
|
|
5420
|
+
}
|
|
5421
|
+
async isInstalled() {
|
|
5422
|
+
return typeof window.phantom !== "undefined" && typeof window.phantom.bitcoin !== "undefined";
|
|
5423
|
+
}
|
|
5424
|
+
async connect() {
|
|
5425
|
+
if (!await this.isInstalled()) throw new Error("Phantom Wallet is not installed");
|
|
5426
|
+
const response = await window.phantom.bitcoin.requestAccounts();
|
|
5427
|
+
const ordinalAddress = response.find((n) => n.purpose == "ordinals");
|
|
5428
|
+
matchlog_default.log("Addresses:", ordinalAddress);
|
|
5429
|
+
if (!ordinalAddress) {
|
|
5430
|
+
throw new Error("No addresses found in Phantom Wallet");
|
|
5431
|
+
}
|
|
5432
|
+
return ordinalAddress.address;
|
|
5433
|
+
}
|
|
5434
|
+
async signMessage(message) {
|
|
5435
|
+
if (!await this.isInstalled()) throw new Error("Phantom Wallet is not installed");
|
|
5436
|
+
const address = await this.connect();
|
|
5437
|
+
try {
|
|
5438
|
+
const { signature } = await window.phantom.bitcoin.signMessage(address, new TextEncoder().encode(message));
|
|
5439
|
+
return bytesToBase64(signature);
|
|
5440
|
+
} catch (error) {
|
|
5441
|
+
console.error(error);
|
|
5442
|
+
throw error;
|
|
5443
|
+
}
|
|
5444
|
+
}
|
|
5445
|
+
};
|
|
5446
|
+
|
|
5447
|
+
// src/hooks/useBTCWallet.ts
|
|
5411
5448
|
var useBTCWallet = () => {
|
|
5412
|
-
const wallets = [new UnisatAdapter(), new XverseAdapter(), new LeatherAdapter()];
|
|
5449
|
+
const wallets = [new UnisatAdapter(), new XverseAdapter(), new LeatherAdapter(), new PhantomAdapter()];
|
|
5413
5450
|
const [installedWallets, setInstalledWallets] = useState22([]);
|
|
5414
5451
|
const [address, setAddress] = useState22(null);
|
|
5415
5452
|
useEffect20(() => {
|
|
@@ -5454,7 +5491,8 @@ function BTCConnectModal({
|
|
|
5454
5491
|
const iconMaps = {
|
|
5455
5492
|
leather: /* @__PURE__ */ jsx25(LeatherIcon, { size: isDownMd ? 36 : 40 }),
|
|
5456
5493
|
unisat: /* @__PURE__ */ jsx25(UnisatIcon, { size: isDownMd ? 36 : 40 }),
|
|
5457
|
-
xverse: /* @__PURE__ */ jsx25(XverseIcon, { size: isDownMd ? 36 : 40 })
|
|
5494
|
+
xverse: /* @__PURE__ */ jsx25(XverseIcon, { size: isDownMd ? 36 : 40 }),
|
|
5495
|
+
phantom: /* @__PURE__ */ jsx25(PhantomIcon, { size: isDownMd ? 36 : 40 })
|
|
5458
5496
|
};
|
|
5459
5497
|
const { events, login } = useMatch();
|
|
5460
5498
|
const [status, setStatus] = useState23("");
|
|
@@ -6277,4 +6315,4 @@ export {
|
|
|
6277
6315
|
MatchProvider,
|
|
6278
6316
|
useMatch
|
|
6279
6317
|
};
|
|
6280
|
-
//# sourceMappingURL=chunk-
|
|
6318
|
+
//# sourceMappingURL=chunk-3YF3P77J.mjs.map
|