@meshconnect/web-link-sdk 3.0.0 → 3.0.2
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/Link.js
CHANGED
@@ -234,7 +234,7 @@ function handleWalletBrowserEvent(event) {
|
|
234
234
|
_b.label = 7;
|
235
235
|
case 7:
|
236
236
|
_b.trys.push([7, 9, , 10]);
|
237
|
-
return [4 /*yield*/, signedMessage(payload.address)];
|
237
|
+
return [4 /*yield*/, signedMessage(payload.address, payload.message)];
|
238
238
|
case 8:
|
239
239
|
result = _b.sent();
|
240
240
|
if (result instanceof Error) {
|
package/package.json
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
{
|
2
2
|
"name": "@meshconnect/web-link-sdk",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.2",
|
4
4
|
"description": "A client-side JS library for integrating with Mesh Connect",
|
5
5
|
"exports": "./index.js",
|
6
6
|
"license": "MIT",
|
7
7
|
"repository": "https://github.com/FrontFin/mesh-web-sdk.git",
|
8
8
|
"homepage": "https://github.com/FrontFin/mesh-web-sdk",
|
9
9
|
"devDependencies": {
|
10
|
+
"@babel/preset-env": "^7.20.0",
|
11
|
+
"@babel/preset-typescript": "^7.20.0",
|
10
12
|
"@types/jest": "^29.5.12",
|
13
|
+
"babel-jest": "^29.5.0",
|
11
14
|
"eslint": "^7.23.0",
|
12
15
|
"eslint-config-prettier": "^8.1.0",
|
13
16
|
"eslint-plugin-import": "^2.22.1",
|
14
17
|
"eslint-plugin-prettier": "^3.4.0",
|
15
|
-
"babel-jest": "^29.5.0",
|
16
|
-
"@babel/preset-env": "^7.20.0",
|
17
|
-
"@babel/preset-typescript": "^7.20.0",
|
18
18
|
"jest": "^29.7.0",
|
19
19
|
"jest-environment-jsdom": "^29.7.0",
|
20
20
|
"prettier": "^2.2.1",
|
@@ -22,7 +22,7 @@
|
|
22
22
|
"util": "^0.12.4"
|
23
23
|
},
|
24
24
|
"dependencies": {
|
25
|
-
"@meshconnect/node-api": "^2.0.
|
25
|
+
"@meshconnect/node-api": "^2.0.8",
|
26
26
|
"@wagmi/core": "^2.11.2",
|
27
27
|
"viem": "^2.x",
|
28
28
|
"@wagmi/connectors": "^5.0.14"
|
package/utils/popup.js
CHANGED
@@ -5,7 +5,7 @@ var popupContentId = 'mesh-link-popup__popup-content';
|
|
5
5
|
var stylesId = 'mesh-link-popup__styles';
|
6
6
|
export var iframeId = 'mesh-link-popup__iframe';
|
7
7
|
var getPopupHtml = function (link) { return "\n<div id=\"".concat(popupId, "\">\n <div id=\"").concat(backdropId, "\"></div>\n <div id=\"").concat(popupContentId, "\">\n <iframe id=\"").concat(iframeId, "\" src=\"").concat(link, "\" allow=\"clipboard-read *; clipboard-write *\" />\n </div>\n</div>\n"); };
|
8
|
-
var getStyles = function (style) { return "\n<style id=\"".concat(stylesId, "\">\n body {\n position: fixed;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n overflow: hidden;\n }\n\n #").concat(popupId, " {\n all: unset;\n position: fixed;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n }\n\n #").concat(backdropId, " {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n z-index: 10000;\n background: black;\n opacity: ").concat(getNumber(0.6, style === null || style === void 0 ? void 0 : style.io), ";\n }\n\n #").concat(popupContentId, " {\n position: absolute;\n height: 80%;\n max-height: 710px;\n min-height: 685px;\n margin: auto;\n z-index: 10001;\n width: 30%;\n max-width: 430px;\n min-width: 380px;\n display: flex;\n flex-direction: column;\n border-radius: ").concat(getNumber(24, style === null || style === void 0 ? void 0 : style.ir), "px;\n
|
8
|
+
var getStyles = function (style) { return "\n<style id=\"".concat(stylesId, "\">\n body {\n position: fixed;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n overflow: hidden;\n }\n\n #").concat(popupId, " {\n all: unset;\n position: fixed;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n }\n\n #").concat(backdropId, " {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n z-index: 10000;\n background: black;\n opacity: ").concat(getNumber(0.6, style === null || style === void 0 ? void 0 : style.io), ";\n }\n\n #").concat(popupContentId, " {\n position: absolute;\n height: 80%;\n max-height: 710px;\n min-height: 685px;\n margin: auto;\n z-index: 10001;\n width: 30%;\n max-width: 430px;\n min-width: 380px;\n display: flex;\n flex-direction: column;\n border-radius: ").concat(getNumber(24, style === null || style === void 0 ? void 0 : style.ir), "px;\n flex-grow: 1;\n }\n\n #").concat(popupContentId, " iframe {\n border: none;\n width: 100%;\n flex-grow: 1;\n border-radius: ").concat(getNumber(24, style === null || style === void 0 ? void 0 : style.ir), "px;\n }\n\n @media only screen and (max-width: 768px) {\n #").concat(popupContentId, " {\n height: 100vh;\n width: 100vw;\n max-width: 100%;\n min-width: 100%;\n max-height: 100%;\n min-height: 100%;\n border-radius: 0px;\n }\n\n #").concat(popupContentId, " iframe {\n border-radius: 0px;\n }\n }\n\n @media only screen and (max-height: 710px) {\n #").concat(popupContentId, " {\n max-height: 100%;\n min-height: 100%;\n }\n }\n</style>\n"); };
|
9
9
|
export function removePopup() {
|
10
10
|
var _a, _b;
|
11
11
|
var existingPopup = window.document.getElementById(popupId);
|
package/utils/version.d.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export declare const sdkVersion = "3.0.
|
1
|
+
export declare const sdkVersion = "3.0.2";
|
package/utils/version.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export var sdkVersion = '3.0.
|
1
|
+
export var sdkVersion = '3.0.2';
|
@@ -3,7 +3,7 @@ import { WagmiInjectedConnectorData, Abi } from './types';
|
|
3
3
|
import { Hash, Chain } from 'viem';
|
4
4
|
export declare const getWagmiCoreInjectedData: () => Promise<WagmiInjectedConnectorData[] | Error>;
|
5
5
|
export declare const connectToSpecificWallet: (walletName: string) => Promise<ConnectReturnType | Error>;
|
6
|
-
export declare const signedMessage: (address: `0x${string}
|
6
|
+
export declare const signedMessage: (address: `0x${string}`, message: string) => Promise<Hash | Error>;
|
7
7
|
export declare const walletBalance: (account: string, chainId: number) => Promise<GetBalanceReturnType | Error>;
|
8
8
|
export declare const switchChainFromSDK: (chainId: number) => Promise<Chain | Error>;
|
9
9
|
export declare const sendTransactionFromSDK: (toAddress: string, amount: number, decimalPlaces: number, chainId: number, account: string) => Promise<Hash | Error>;
|
@@ -148,7 +148,7 @@ export var connectToSpecificWallet = function (walletName) { return __awaiter(vo
|
|
148
148
|
}); })];
|
149
149
|
});
|
150
150
|
}); };
|
151
|
-
export var signedMessage = function (address) { return __awaiter(void 0, void 0, void 0, function () {
|
151
|
+
export var signedMessage = function (address, message) { return __awaiter(void 0, void 0, void 0, function () {
|
152
152
|
return __generator(this, function (_a) {
|
153
153
|
return [2 /*return*/, withWagmiErrorHandling(function () { return __awaiter(void 0, void 0, void 0, function () {
|
154
154
|
var config, signedMessage;
|
@@ -159,7 +159,7 @@ export var signedMessage = function (address) { return __awaiter(void 0, void 0,
|
|
159
159
|
config = _a.sent();
|
160
160
|
return [4 /*yield*/, signMessage(config, {
|
161
161
|
account: address,
|
162
|
-
message:
|
162
|
+
message: message
|
163
163
|
})];
|
164
164
|
case 2:
|
165
165
|
signedMessage = _a.sent();
|
@@ -15,6 +15,7 @@ export interface WalletBrowserSignRequest extends WalletBrowserEventBase {
|
|
15
15
|
type: 'walletBrowserSignRequest';
|
16
16
|
payload: {
|
17
17
|
address: `0x${string}`;
|
18
|
+
message: string;
|
18
19
|
};
|
19
20
|
}
|
20
21
|
export interface WalletBrowserChainSwitchRequest extends WalletBrowserEventBase {
|