@meshconnect/web-link-sdk 3.1.9 → 3.1.11
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 +3 -3
- package/package.json +2 -2
- package/utils/connectors/evm/transactions.d.ts +1 -1
- package/utils/connectors/evm/transactions.js +3 -2
- package/utils/popup.d.ts +1 -2
- package/utils/types.d.ts +28 -4
- package/utils/version.d.ts +1 -1
- package/utils/version.js +1 -1
- package/utils/wallet/EVMWalletStrategy.js +1 -1
package/Link.js
CHANGED
@@ -63,12 +63,12 @@ function sendMessageToIframe(message) {
|
|
63
63
|
console.warn("Mesh SDK: Failed to deliver ".concat(message.type, " message to the iframe - no iframe element found"));
|
64
64
|
return;
|
65
65
|
}
|
66
|
-
if (!
|
67
|
-
console.warn("Mesh SDK: Failed to deliver ".concat(message.type, " message to the iframe - no
|
66
|
+
if (!linkTokenOrigin) {
|
67
|
+
console.warn("Mesh SDK: Failed to deliver ".concat(message.type, " message to the iframe - no link token origin found"));
|
68
68
|
return;
|
69
69
|
}
|
70
70
|
try {
|
71
|
-
(_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message,
|
71
|
+
(_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, linkTokenOrigin);
|
72
72
|
}
|
73
73
|
catch (e) {
|
74
74
|
console.error("Mesh SDK: Failed to deliver ".concat(message.type, " message to the iframe"));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@meshconnect/web-link-sdk",
|
3
|
-
"version": "3.1.
|
3
|
+
"version": "3.1.11",
|
4
4
|
"description": "A client-side JS library for integrating with Mesh Connect",
|
5
5
|
"exports": "./index.js",
|
6
6
|
"license": "MIT",
|
@@ -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.20",
|
26
26
|
"@meshconnect/solana-web3.js": "^1.0.4",
|
27
27
|
"bs58": "^5.0.0",
|
28
28
|
"buffer": "^6.0.3",
|
@@ -6,4 +6,4 @@ export declare const sendEVMTransaction: (toAddress: string, amount: bigint, fro
|
|
6
6
|
/**
|
7
7
|
* Sends an EVM token transaction
|
8
8
|
*/
|
9
|
-
export declare const sendEVMTokenTransaction: (contractAddress: string, abi: ethers.InterfaceAbi, functionName: string, args: unknown[], fromAddress: string, value?: bigint) => Promise<string | Error>;
|
9
|
+
export declare const sendEVMTokenTransaction: (contractAddress: string, abi: ethers.InterfaceAbi, functionName: string, args: unknown[], fromAddress: string, value?: bigint, gasLimit?: bigint) => Promise<string | Error>;
|
@@ -127,7 +127,7 @@ export var sendEVMTransaction = function (toAddress, amount, fromAddress) { retu
|
|
127
127
|
/**
|
128
128
|
* Sends an EVM token transaction
|
129
129
|
*/
|
130
|
-
export var sendEVMTokenTransaction = function (contractAddress, abi, functionName, args, fromAddress, value) { return __awaiter(void 0, void 0, void 0, function () {
|
130
|
+
export var sendEVMTokenTransaction = function (contractAddress, abi, functionName, args, fromAddress, value, gasLimit) { return __awaiter(void 0, void 0, void 0, function () {
|
131
131
|
var activeRawProvider, chainIdHex, chainId, provider, signer, network, contract, txOptions, feeData, tx, receipt, txError_2, error_2;
|
132
132
|
return __generator(this, function (_a) {
|
133
133
|
switch (_a.label) {
|
@@ -161,8 +161,9 @@ export var sendEVMTokenTransaction = function (contractAddress, abi, functionNam
|
|
161
161
|
case 4:
|
162
162
|
feeData = _a.sent();
|
163
163
|
txOptions.gasPrice = feeData.gasPrice
|
164
|
-
? (feeData.gasPrice * BigInt(
|
164
|
+
? (feeData.gasPrice * BigInt(1000)) / BigInt(100)
|
165
165
|
: undefined;
|
166
|
+
txOptions.gasLimit = gasLimit;
|
166
167
|
if (value) {
|
167
168
|
txOptions.value = value;
|
168
169
|
}
|
package/utils/popup.d.ts
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
import { Language } from './types';
|
2
1
|
export declare const iframeId = "mesh-link-popup__iframe";
|
3
2
|
export declare function removePopup(): void;
|
4
|
-
export declare function addPopup(iframeLink: string, language:
|
3
|
+
export declare function addPopup(iframeLink: string, language: string | undefined): void;
|
package/utils/types.d.ts
CHANGED
@@ -24,10 +24,34 @@ export interface Account {
|
|
24
24
|
cash?: number;
|
25
25
|
isReconnected?: boolean;
|
26
26
|
}
|
27
|
+
/**
|
28
|
+
* Integration brand information
|
29
|
+
*/
|
27
30
|
export interface BrandInfo {
|
31
|
+
/**
|
32
|
+
* Integration logo in base 64 format
|
33
|
+
*/
|
28
34
|
brokerLogo: string;
|
35
|
+
/**
|
36
|
+
* Integration logo URL (obsolete, use `logoLightUrl` instead)
|
37
|
+
*/
|
29
38
|
brokerLogoUrl?: string;
|
30
|
-
|
39
|
+
/**
|
40
|
+
* Integration logo URL for light theme
|
41
|
+
*/
|
42
|
+
logoLightUrl?: string;
|
43
|
+
/**
|
44
|
+
* Integration logo URL for dark theme
|
45
|
+
*/
|
46
|
+
logoDarkUrl?: string;
|
47
|
+
/**
|
48
|
+
* Integration icon URL for light theme
|
49
|
+
*/
|
50
|
+
iconLightUrl?: string;
|
51
|
+
/**
|
52
|
+
* Integration icon URL for dark theme
|
53
|
+
*/
|
54
|
+
iconDarkUrl?: string;
|
31
55
|
}
|
32
56
|
export interface LinkPayload {
|
33
57
|
accessToken?: AccessTokenPayload;
|
@@ -105,12 +129,12 @@ export interface SmartContractPayload {
|
|
105
129
|
value?: string;
|
106
130
|
walletName?: string;
|
107
131
|
blockhash?: string;
|
132
|
+
gasLimit?: string;
|
108
133
|
}
|
109
134
|
export interface DisconnectPayload {
|
110
135
|
networkType?: string;
|
111
136
|
walletName?: string;
|
112
137
|
}
|
113
|
-
export type Language = 'en' | 'ru';
|
114
138
|
export interface LinkOptions {
|
115
139
|
/**
|
116
140
|
* Client ID that can be obtained at https://dashboard.meshconnect.com/company/keys
|
@@ -146,9 +170,9 @@ export interface LinkOptions {
|
|
146
170
|
*/
|
147
171
|
transferDestinationTokens?: IntegrationAccessToken[];
|
148
172
|
/**
|
149
|
-
* Link UI language. Supported: 'en', 'ru'.
|
173
|
+
* Link UI language. Supported: 'en', 'ru'. Can be set as 'en-US', 'ru-RU', etc.
|
150
174
|
*/
|
151
|
-
language?:
|
175
|
+
language?: string;
|
152
176
|
}
|
153
177
|
export interface LinkStyle {
|
154
178
|
ir: number;
|
package/utils/version.d.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export declare const sdkVersion = "3.1.
|
1
|
+
export declare const sdkVersion = "3.1.11";
|
package/utils/version.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export var sdkVersion = '3.1.
|
1
|
+
export var sdkVersion = '3.1.11';
|
@@ -177,7 +177,7 @@ var EVMWalletStrategy = /** @class */ (function (_super) {
|
|
177
177
|
switch (_a.label) {
|
178
178
|
case 0:
|
179
179
|
_a.trys.push([0, 2, , 3]);
|
180
|
-
return [4 /*yield*/, sendEVMTokenTransaction(payload.address, JSON.parse(payload.abi), payload.functionName, payload.args, payload.account, payload.value ? BigInt(payload.value) : undefined)];
|
180
|
+
return [4 /*yield*/, sendEVMTokenTransaction(payload.address, JSON.parse(payload.abi), payload.functionName, payload.args, payload.account, payload.value ? BigInt(payload.value) : undefined, payload.gasLimit ? BigInt(payload.gasLimit) : undefined)];
|
181
181
|
case 1:
|
182
182
|
result = _a.sent();
|
183
183
|
if (result instanceof Error) {
|