Comparing version 0.0.0-beta.3 to 0.0.0-beta.4
@@ -14,7 +14,7 @@ "use strict"; | ||
function getNetwork(network) { | ||
if (network === undefined) { | ||
if (network === undefined || network === null) { | ||
// Return default network | ||
return exports.localhost; | ||
} | ||
if ((network === null || network === void 0 ? void 0 : network.type) === 'bls') { | ||
if (network.type === 'bls') { | ||
return network; | ||
@@ -21,0 +21,0 @@ } |
{ | ||
"name": "ethdk", | ||
"version": "0.0.0-beta.3", | ||
"version": "0.0.0-beta.4", | ||
"description": "A package meant to make it easier to interact with the Ethereum blockchain.", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
@@ -16,9 +16,9 @@ # ethdk | ||
```typescript | ||
import { createAccount } from 'ethdk' | ||
import { networks, createAccount } from 'ethdk' | ||
// Private key param is optional. A random private key will | ||
// be generated if one is not provided. | ||
const account = createAccount({ | ||
const account = await createAccount({ | ||
accountType: 'bls', | ||
network: 'localhost', | ||
network: networks.BLS_NETWORKS.localhost, | ||
}) | ||
@@ -25,0 +25,0 @@ |
@@ -14,7 +14,8 @@ import { type Network, type BlsNetwork } from '../interfaces/Network' | ||
export function getNetwork(network?: Network): BlsNetwork { | ||
if (network === undefined) { | ||
if (network === undefined || network === null) { | ||
// Return default network | ||
return localhost | ||
} | ||
if (network?.type === 'bls') { | ||
if (network.type === 'bls') { | ||
return network as BlsNetwork | ||
@@ -21,0 +22,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
65724