@portal-hq/web 0.0.5 → 0.0.7
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/lib/commonjs/index.js +25 -1
- package/lib/commonjs/mpc/index.js +1 -1
- package/lib/esm/index.js +25 -1
- package/lib/esm/mpc/index.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +23 -1
- package/src/mpc/index.ts +1 -1
package/lib/commonjs/index.js
CHANGED
|
@@ -160,6 +160,30 @@ class Portal {
|
|
|
160
160
|
/****************************
|
|
161
161
|
* Provider Methods
|
|
162
162
|
****************************/
|
|
163
|
+
ethEstimateGas(transaction) {
|
|
164
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
165
|
+
return this.provider.request({
|
|
166
|
+
method: 'eth_estimateGas',
|
|
167
|
+
params: transaction,
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
ethGasPrice() {
|
|
172
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
173
|
+
return this.provider.request({
|
|
174
|
+
method: 'eth_gasPrice',
|
|
175
|
+
params: [],
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
ethGetBalance() {
|
|
180
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
181
|
+
return this.provider.request({
|
|
182
|
+
method: 'eth_getBalance',
|
|
183
|
+
params: [this.address, 'latest'],
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
}
|
|
163
187
|
ethSendTransaction(transaction) {
|
|
164
188
|
return __awaiter(this, void 0, void 0, function* () {
|
|
165
189
|
return this.provider.request({
|
|
@@ -283,7 +307,7 @@ class Portal {
|
|
|
283
307
|
}
|
|
284
308
|
else if (typeof this.gatewayConfig === 'object' &&
|
|
285
309
|
// eslint-disable-next-line no-prototype-builtins
|
|
286
|
-
this.gatewayConfig.hasOwnProperty(this.chainId)) {
|
|
310
|
+
!this.gatewayConfig.hasOwnProperty(this.chainId)) {
|
|
287
311
|
// If there's no explicit mapping for the current chainId, error out
|
|
288
312
|
throw new Error(`[PortalProvider] No RPC endpoint configured for chainId: ${this.chainId}`);
|
|
289
313
|
}
|
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.MpcErrorCodes = exports.MpcError = void 0;
|
|
13
13
|
const errors_1 = require("./errors");
|
|
14
14
|
const index_1 = require("../index");
|
|
15
|
-
const WEB_SDK_VERSION = '0.0.
|
|
15
|
+
const WEB_SDK_VERSION = '0.0.7';
|
|
16
16
|
class Mpc {
|
|
17
17
|
constructor({ portal }) {
|
|
18
18
|
this.configureIframe = () => {
|
package/lib/esm/index.js
CHANGED
|
@@ -154,6 +154,30 @@ class Portal {
|
|
|
154
154
|
/****************************
|
|
155
155
|
* Provider Methods
|
|
156
156
|
****************************/
|
|
157
|
+
ethEstimateGas(transaction) {
|
|
158
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
159
|
+
return this.provider.request({
|
|
160
|
+
method: 'eth_estimateGas',
|
|
161
|
+
params: transaction,
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
ethGasPrice() {
|
|
166
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
+
return this.provider.request({
|
|
168
|
+
method: 'eth_gasPrice',
|
|
169
|
+
params: [],
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
ethGetBalance() {
|
|
174
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
175
|
+
return this.provider.request({
|
|
176
|
+
method: 'eth_getBalance',
|
|
177
|
+
params: [this.address, 'latest'],
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
}
|
|
157
181
|
ethSendTransaction(transaction) {
|
|
158
182
|
return __awaiter(this, void 0, void 0, function* () {
|
|
159
183
|
return this.provider.request({
|
|
@@ -277,7 +301,7 @@ class Portal {
|
|
|
277
301
|
}
|
|
278
302
|
else if (typeof this.gatewayConfig === 'object' &&
|
|
279
303
|
// eslint-disable-next-line no-prototype-builtins
|
|
280
|
-
this.gatewayConfig.hasOwnProperty(this.chainId)) {
|
|
304
|
+
!this.gatewayConfig.hasOwnProperty(this.chainId)) {
|
|
281
305
|
// If there's no explicit mapping for the current chainId, error out
|
|
282
306
|
throw new Error(`[PortalProvider] No RPC endpoint configured for chainId: ${this.chainId}`);
|
|
283
307
|
}
|
package/lib/esm/mpc/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { PortalMpcError } from './errors';
|
|
11
11
|
import { BackupMethods } from '../index';
|
|
12
|
-
const WEB_SDK_VERSION = '0.0.
|
|
12
|
+
const WEB_SDK_VERSION = '0.0.7';
|
|
13
13
|
class Mpc {
|
|
14
14
|
constructor({ portal }) {
|
|
15
15
|
this.configureIframe = () => {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -235,6 +235,28 @@ class Portal {
|
|
|
235
235
|
/****************************
|
|
236
236
|
* Provider Methods
|
|
237
237
|
****************************/
|
|
238
|
+
|
|
239
|
+
public async ethEstimateGas(transaction: EthereumTransaction): Promise<any> {
|
|
240
|
+
return this.provider.request({
|
|
241
|
+
method: 'eth_estimateGas',
|
|
242
|
+
params: transaction,
|
|
243
|
+
})
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
public async ethGasPrice(): Promise<string> {
|
|
247
|
+
return this.provider.request({
|
|
248
|
+
method: 'eth_gasPrice',
|
|
249
|
+
params: [],
|
|
250
|
+
}) as Promise<string>
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
public async ethGetBalance(): Promise<string> {
|
|
254
|
+
return this.provider.request({
|
|
255
|
+
method: 'eth_getBalance',
|
|
256
|
+
params: [this.address, 'latest'],
|
|
257
|
+
}) as Promise<string>
|
|
258
|
+
}
|
|
259
|
+
|
|
238
260
|
public async ethSendTransaction(
|
|
239
261
|
transaction: EthereumTransaction,
|
|
240
262
|
): Promise<string> {
|
|
@@ -353,7 +375,7 @@ class Portal {
|
|
|
353
375
|
} else if (
|
|
354
376
|
typeof this.gatewayConfig === 'object' &&
|
|
355
377
|
// eslint-disable-next-line no-prototype-builtins
|
|
356
|
-
this.gatewayConfig.hasOwnProperty(this.chainId)
|
|
378
|
+
!this.gatewayConfig.hasOwnProperty(this.chainId)
|
|
357
379
|
) {
|
|
358
380
|
// If there's no explicit mapping for the current chainId, error out
|
|
359
381
|
throw new Error(
|