@portal-hq/provider
Advanced tools
Comparing version 0.2.0-beta9 to 0.2.1
@@ -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 @@ } |
@@ -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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
72144
1
1944
- Removed@portal-hq/keychain@^0.2.0-beta9
- Removed@portal-hq/keychain@0.2.33(transitive)
- Removedreact-native-keychain@8.2.0(transitive)
Updated@portal-hq/utils@^0.2.1