@portal-hq/web 0.0.6 → 0.0.8

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.
@@ -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({
@@ -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.6';
15
+ const WEB_SDK_VERSION = '0.0.8';
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({
@@ -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.6';
12
+ const WEB_SDK_VERSION = '0.0.8';
13
13
  class Mpc {
14
14
  constructor({ portal }) {
15
15
  this.configureIframe = () => {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Portal MPC Support for Web",
4
4
  "author": "Portal Labs, Inc.",
5
5
  "homepage": "https://portalhq.io/",
6
- "version": "0.0.6",
6
+ "version": "0.0.8",
7
7
  "license": "MIT",
8
8
  "main": "lib/commonjs/index",
9
9
  "module": "lib/esm/index",
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> {
package/src/mpc/index.ts CHANGED
@@ -24,7 +24,7 @@ import type {
24
24
  WorkerResult,
25
25
  } from '../../types'
26
26
 
27
- const WEB_SDK_VERSION = '0.0.6'
27
+ const WEB_SDK_VERSION = '0.0.8'
28
28
 
29
29
  class Mpc {
30
30
  public iframe?: HTMLIFrameElement
@@ -1,4 +1,4 @@
1
- import {
1
+ import type {
2
2
  RpcErrorDefinition,
3
3
  RpcErrorOptions,
4
4
  ValidRpcErrorCodes,