Socket
Socket
Sign inDemoInstall

@portal-hq/provider

Package Overview
Dependencies
Maintainers
6
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@portal-hq/provider - npm Package Compare versions

Comparing version 0.2.0-beta9 to 0.2.1

9

lib/commonjs/providers/index.js

@@ -30,6 +30,11 @@ "use strict";

];
const solanaSignerMethods = [
'requestAirdrop',
'sendTransaction',
'simulateTransaction',
];
class Provider {
constructor({
// Required options
apiKey, chainId,
apiKey, chainId, keychain,
// Optional options

@@ -54,2 +59,3 @@ apiUrl = 'api.portalhq.io', autoApprove = false, enableMpc = true, mpcUrl = 'mpc.portalhq.io', gatewayConfig = {}, }) {

this.isMPC = enableMpc;
this.keychain = keychain;
this.log = console;

@@ -69,2 +75,3 @@ this.mpcUrl = mpcUrl;

mpcUrl: this.mpcUrl,
keychain: this.keychain,
});

@@ -71,0 +78,0 @@ }

3

lib/commonjs/signers/mpc.js

@@ -13,3 +13,2 @@ "use strict";

const react_native_1 = require("react-native");
const keychain_1 = require("@portal-hq/keychain");
const utils_1 = require("@portal-hq/utils");

@@ -34,2 +33,3 @@ class MpcSigner {

};
this.keychain = opts.keychain;
this.mpc = react_native_1.NativeModules.PortalMobileMpc;

@@ -40,3 +40,2 @@ this.mpcUrl = opts.mpcUrl;

}
this.keychain = new keychain_1.Keychain();
}

@@ -43,0 +42,0 @@ get address() {

@@ -28,6 +28,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

];
const solanaSignerMethods = [
'requestAirdrop',
'sendTransaction',
'simulateTransaction',
];
class Provider {
constructor({
// Required options
apiKey, chainId,
apiKey, chainId, keychain,
// Optional options

@@ -52,2 +57,3 @@ apiUrl = 'api.portalhq.io', autoApprove = false, enableMpc = true, mpcUrl = 'mpc.portalhq.io', gatewayConfig = {}, }) {

this.isMPC = enableMpc;
this.keychain = keychain;
this.log = console;

@@ -67,2 +73,3 @@ this.mpcUrl = mpcUrl;

mpcUrl: this.mpcUrl,
keychain: this.keychain,
});

@@ -69,0 +76,0 @@ }

@@ -11,3 +11,2 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

import { NativeModules } from 'react-native';
import { Keychain } from '@portal-hq/keychain';
import { MpcSigningError } from '@portal-hq/utils';

@@ -32,2 +31,3 @@ class MpcSigner {

};
this.keychain = opts.keychain;
this.mpc = NativeModules.PortalMobileMpc;

@@ -38,3 +38,2 @@ this.mpcUrl = opts.mpcUrl;

}
this.keychain = new Keychain();
}

@@ -41,0 +40,0 @@ get address() {

{
"name": "@portal-hq/provider",
"version": "0.2.0-beta9",
"version": "0.2.1",
"license": "MIT",

@@ -20,4 +20,3 @@ "main": "lib/commonjs/index",

"dependencies": {
"@portal-hq/keychain": "^0.2.0-beta9",
"@portal-hq/utils": "^0.2.0-beta9"
"@portal-hq/utils": "^0.2.1"
},

@@ -24,0 +23,0 @@ "devDependencies": {

@@ -5,2 +5,3 @@ import {

InvalidGatewayConfigError,
KeychainAdapter,
ProviderRpcError,

@@ -38,2 +39,8 @@ RpcErrorCodes,

const solanaSignerMethods = [
'requestAirdrop',
'sendTransaction',
'simulateTransaction',
]
class Provider {

@@ -51,2 +58,3 @@ public readonly mpcUrl: string

private events: Record<string, RegisteredEventHandler[]>
private keychain: KeychainAdapter
private log: Console

@@ -62,2 +70,3 @@ private gatewayConfig: GatewayLike

chainId,
keychain,

@@ -89,2 +98,3 @@ // Optional options

this.isMPC = enableMpc
this.keychain = keychain
this.log = console

@@ -107,2 +117,3 @@ this.mpcUrl = mpcUrl

mpcUrl: this.mpcUrl,
keychain: this.keychain,
})

@@ -109,0 +120,0 @@ } else {

import { NativeModules } from 'react-native'
import { Keychain } from '@portal-hq/keychain'
import { MpcSigningError } from '@portal-hq/utils'
import { KeychainAdapter, MpcSigningError } from '@portal-hq/utils'

@@ -17,3 +16,3 @@ import { Provider } from '../index'

public _address: string
private keychain: Keychain
private keychain: KeychainAdapter
private mpc: PortalMobileMpc

@@ -23,2 +22,3 @@ private mpcUrl: string

constructor(opts: MpcSignerOptions) {
this.keychain = opts.keychain
this.mpc = NativeModules.PortalMobileMpc

@@ -32,4 +32,2 @@ this.mpcUrl = opts.mpcUrl

}
this.keychain = new Keychain()
}

@@ -36,0 +34,0 @@

// Types
import { KeychainAdapter } from '@portal-hq/utils'
export type EventHandler = (data: any) => void

@@ -24,2 +26,3 @@

export interface MpcSignerOptions extends SignerOptions {
keychain: KeychainAdapter
mpcUrl: string

@@ -51,2 +54,3 @@ }

chainId: number
keychain: KeychainAdapter
gatewayConfig: GatewayLike

@@ -53,0 +57,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc