@haechi-labs/face-sdk
Advanced tools
Comparing version 1.1.0 to 1.2.0-alpha.2
@@ -11,1 +11,2 @@ import { FaceLoginResponse } from '@haechi-labs/face-types'; | ||
} | ||
//# sourceMappingURL=auth.d.ts.map |
import { Network } from '@haechi-labs/face-types'; | ||
import { Auth } from './auth'; | ||
import { Solana } from './blockchain/Solana'; | ||
import { Provider } from './provider'; | ||
@@ -15,2 +16,3 @@ import { WalletConnect } from './walletConnect'; | ||
auth: Auth; | ||
solana: Solana; | ||
constructor({ apiKey, network, ...rest }: FaceConfig); | ||
@@ -24,1 +26,2 @@ ready(): Promise<void>; | ||
} | ||
//# sourceMappingURL=face.d.ts.map |
@@ -19,2 +19,3 @@ "use strict"; | ||
const auth_1 = require("./auth"); | ||
const Solana_1 = require("./blockchain/Solana"); | ||
const internal_1 = require("./internal"); | ||
@@ -35,6 +36,12 @@ const provider_1 = require("./provider"); | ||
}; | ||
this.network = network || face_types_1.Network.ETHEREUM; | ||
network = network ? network : face_types_1.Network.ETHEREUM; | ||
if (!(0, face_types_1.isSupportedNetwork)(network)) { | ||
throw (0, face_types_1.unsupportedChainError)(); | ||
} | ||
this.network = network; | ||
console.log('sdk network', network); | ||
this.internal = new internal_1.Internal(apiKey, network, rest.env, rest.iframeUrl); | ||
this.auth = new auth_1.Auth(this.internal); | ||
this.wc = new walletConnect_1.WalletConnect(this.internal); | ||
this.solana = new Solana_1.Solana(this.internal); | ||
} | ||
@@ -41,0 +48,0 @@ async ready() { |
@@ -19,1 +19,2 @@ import { Blockchain, Env, JsonRpcRequestPayload } from '@haechi-labs/face-types'; | ||
} | ||
//# sourceMappingURL=iframe.d.ts.map |
export * from './face'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -28,1 +28,2 @@ import { Blockchain, Env, FaceLoginResponse, JsonRpcRequestPayload, JsonRpcResponsePayload } from '@haechi-labs/face-types'; | ||
} | ||
//# sourceMappingURL=internal.d.ts.map |
@@ -132,3 +132,3 @@ "use strict"; | ||
case face_1.Network.ETHEREUM: | ||
case face_1.Network.ROPSTEN: | ||
case face_1.Network.GOERLI: | ||
return face_types_1.Blockchain.ETHEREUM; | ||
@@ -144,2 +144,5 @@ case face_1.Network.POLYGON: | ||
return face_types_1.Blockchain.KLAYTN; | ||
case face_1.Network.SOLANA: | ||
case face_1.Network.SOLANA_DEVNET: | ||
return face_types_1.Blockchain.SOLANA; | ||
default: | ||
@@ -174,3 +177,3 @@ return face_types_1.Blockchain.ETHEREUM; | ||
} | ||
if (network === face_1.Network.ROPSTEN || | ||
if (network === face_1.Network.GOERLI || | ||
network === face_1.Network.MUMBAI || | ||
@@ -177,0 +180,0 @@ network === face_1.Network.BAOBAB || |
@@ -17,1 +17,2 @@ import { JsonRpcResponsePayload } from '@haechi-labs/face-types'; | ||
export {}; | ||
//# sourceMappingURL=provider.d.ts.map |
@@ -8,1 +8,2 @@ import { Internal } from './internal'; | ||
} | ||
//# sourceMappingURL=walletConnect.d.ts.map |
{ | ||
"name": "@haechi-labs/face-sdk", | ||
"version": "1.1.0", | ||
"version": "1.2.0-alpha.2", | ||
"description": "", | ||
@@ -18,3 +18,3 @@ "author": "", | ||
"devDependencies": { | ||
"@haechi-labs/face-types": "^1.1.0", | ||
"@haechi-labs/face-types": "^1.2.0-alpha.2", | ||
"@tsconfig/node16": "^1.0.2", | ||
@@ -27,3 +27,3 @@ "@types/node": "^17.0.33", | ||
}, | ||
"gitHead": "3ee3c6734cafa093d7cd5f7e3b980e42492b303a", | ||
"gitHead": "230423d35ca96e5b9cbdd0435ddf5c44344ca06a", | ||
"publishConfig": { | ||
@@ -30,0 +30,0 @@ "access": "public" |
@@ -1,5 +0,13 @@ | ||
import { Env, JsonRpcMethod, Network, NetworkChainIdMap } from '@haechi-labs/face-types'; | ||
import { | ||
Env, | ||
isSupportedNetwork, | ||
JsonRpcMethod, | ||
Network, | ||
NetworkChainIdMap, | ||
unsupportedChainError, | ||
} from '@haechi-labs/face-types'; | ||
import { hexlify } from 'ethers/lib/utils'; | ||
import { Auth } from './auth'; | ||
import { Solana } from './blockchain/Solana'; | ||
import { Internal } from './internal'; | ||
@@ -21,5 +29,11 @@ import { Provider } from './provider'; | ||
public auth: Auth; | ||
public solana: Solana; | ||
constructor({ apiKey, network, ...rest }: FaceConfig) { | ||
this.network = network || Network.ETHEREUM; | ||
network = network ? network : Network.ETHEREUM; | ||
if (!isSupportedNetwork(network)) { | ||
throw unsupportedChainError(); | ||
} | ||
this.network = network; | ||
console.log('sdk network', network); | ||
this.internal = new Internal( | ||
@@ -33,2 +47,3 @@ apiKey, | ||
this.wc = new WalletConnect(this.internal); | ||
this.solana = new Solana(this.internal); | ||
} | ||
@@ -35,0 +50,0 @@ |
@@ -179,3 +179,3 @@ import { | ||
case Network.ETHEREUM: | ||
case Network.ROPSTEN: | ||
case Network.GOERLI: | ||
return Blockchain.ETHEREUM; | ||
@@ -191,2 +191,5 @@ case Network.POLYGON: | ||
return Blockchain.KLAYTN; | ||
case Network.SOLANA: | ||
case Network.SOLANA_DEVNET: | ||
return Blockchain.SOLANA; | ||
default: | ||
@@ -224,3 +227,3 @@ return Blockchain.ETHEREUM; | ||
if ( | ||
network === Network.ROPSTEN || | ||
network === Network.GOERLI || | ||
network === Network.MUMBAI || | ||
@@ -227,0 +230,0 @@ network === Network.BAOBAB || |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
47
65143
1207
2