Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@haechi-labs/face-sdk

Package Overview
Dependencies
Maintainers
2
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@haechi-labs/face-sdk - npm Package Compare versions

Comparing version 1.7.0 to 1.8.0-alpha.0

dist/blockchain/Bora.d.ts

2

dist/face.d.ts
import { Blockchain, Network } from '@haechi-labs/face-types';
import { Auth } from './auth';
import { Bora } from './blockchain/Bora';
import { Near } from './blockchain/Near';

@@ -21,2 +22,3 @@ import { Solana } from './blockchain/Solana';

wallet: Wallet;
bora: Bora;
constructor({ apiKey, network, ...rest }: FaceConfig);

@@ -23,0 +25,0 @@ ready(): Promise<void>;

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

const auth_1 = require("./auth");
const Bora_1 = require("./blockchain/Bora");
const Near_1 = require("./blockchain/Near");

@@ -57,2 +58,3 @@ const Solana_1 = require("./blockchain/Solana");

this.wallet = new wallet_1.Wallet(this.internal);
this.bora = new Bora_1.Bora(this.internal);
}

@@ -59,0 +61,0 @@ async ready() {

@@ -1,2 +0,163 @@

export * from './face';
//# sourceMappingURL=index.d.ts.map
import { Blockchain, Env, JsonRpcRequestPayload, FaceLoginResponse, LoginProviderType, LoginWithIdTokenRequest, JsonRpcResponsePayload, Network } from '@haechi-labs/face-types';
export { Network } from '@haechi-labs/face-types';
import { BoraPortalConnectStatusResponse, BoraPortalConnectRequest } from '@haechi-labs/face-types/dist/boraPortal';
import { BigNumber, ethers } from 'ethers';
import * as nearAPI from 'near-api-js';
import { PublicKey, Transaction } from '@solana/web3.js';
declare class Iframe {
private readonly _iframe;
private readonly _env;
private readonly _ready;
private _blockchain;
private randomPrefix;
private requestIndex;
private activeElement;
constructor(apiKey: string, blockchain: Blockchain, env: Env, iframeUrl: string);
sendChildMessage(data: any): Promise<string>;
waitForResponse<T>(requestId?: string): Promise<T>;
processMessage(message: JsonRpcRequestPayload): Promise<void>;
ready(): Promise<void>;
showOverlay(): Promise<void>;
hideOverlay(): Promise<void>;
setBlockchain(blockchain: Blockchain): void;
}
type InternalParams = {
face: Face;
apiKey: string;
network?: Network;
env?: Env;
iframeUrl?: string;
};
declare class Internal {
private readonly face;
readonly iframe: Iframe;
constructor({ apiKey, network, env, iframeUrl, face }: InternalParams);
getAddresses(blockchain?: Blockchain): Promise<string[]>;
estimateGas(request: JsonRpcRequestPayload): Promise<unknown>;
getBalance(address: string, contractAddress?: string): Promise<BigNumber>;
ownerOf(contractAddress: string, tokenId: string): Promise<string>;
logout(): Promise<void>;
getCurrentUser(): Promise<FaceLoginResponse | null>;
isLoggedIn(): Promise<boolean>;
ready(): Promise<void>;
loginWithCredential(): Promise<FaceLoginResponse | null>;
directSocialLogin(provider: LoginProviderType): Promise<FaceLoginResponse | null>;
loginWithIdToken(loginWithIdTokenRequest: LoginWithIdTokenRequest): Promise<FaceLoginResponse | null>;
openWalletConnect(name: string, url: string): Promise<void>;
openHome(): Promise<void>;
sendRpc<T>(rpcPayload: JsonRpcRequestPayload): Promise<JsonRpcResponsePayload<T>['result']>;
getBlockchainFromNetwork(network?: Network): Blockchain;
getIframeUrl(env?: Env, iframeUrl?: string): string;
getDefaultEnv(network?: Network): Env;
decodeData(serializedTx: string, abi: string[]): Promise<{
name: string;
args: ethers.utils.Result;
}>;
encodeData(abi: string[], functionFragment: string, args?: any[]): Promise<string>;
switchNetwork(network: Network): Promise<unknown>;
boraIsConnected(bappUsn: string): Promise<BoraPortalConnectStatusResponse | null>;
boraConnect(request: BoraPortalConnectRequest): Promise<BoraPortalConnectStatusResponse | null>;
}
declare class Auth {
private readonly internal;
constructor(internal: Internal);
login(): Promise<FaceLoginResponse | null>;
directSocialLogin(provider: LoginProviderType): Promise<FaceLoginResponse | null>;
loginWithIdToken(loginWithIdTokenRequest: LoginWithIdTokenRequest): Promise<FaceLoginResponse | null>;
logout(): Promise<void>;
getCurrentUser(): Promise<FaceLoginResponse | null>;
isLoggedIn(): Promise<boolean>;
}
declare class Bora {
internal: Internal;
constructor(internal: Internal);
connect(request: BoraPortalConnectRequest): Promise<BoraPortalConnectStatusResponse | null>;
isConnected(bappUsn: string): Promise<BoraPortalConnectStatusResponse | null>;
}
declare class NearProvider {
internal: Internal;
constructor(internal: Internal);
getPublicKeys(): Promise<nearAPI.utils.PublicKey[]>;
getBalance(address: string, contractAddress?: string): Promise<BigNumber>;
signAndSendTransaction(transaction: nearAPI.transactions.Transaction): Promise<string>;
}
declare class Near {
internal: Internal;
constructor(internal: Internal);
getProvider(): NearProvider;
}
declare class SolanaProvider {
internal: Internal;
constructor(internal: Internal);
getPublicKeys(): Promise<PublicKey[]>;
signAndSendTransaction(transaction: Transaction): Promise<string>;
}
declare class Solana {
internal: Internal;
constructor(internal: Internal);
getProvider(): SolanaProvider;
}
interface RequestArguments {
method: string;
params?: any;
[key: string]: any;
}
declare class ProviderTemplate {
sendAsync: (r: any, c: (e: any, r: any) => void) => undefined;
}
declare class Provider extends ProviderTemplate {
private readonly internal;
constructor(internal: Internal);
request(request: RequestArguments | RequestArguments[]): Promise<JsonRpcResponsePayload['result']>;
}
/**
* The interface to control view of face wallet.
*/
declare class Wallet {
private readonly internal;
constructor(internal: Internal);
close(): void;
home(): Promise<void>;
}
declare class WalletConnect {
private readonly internal;
constructor(internal: Internal);
connectOpensea(collectionName?: string): Promise<void>;
private connect;
}
interface FaceConfig {
apiKey: string;
network?: Network;
}
declare class Face {
private readonly internal;
private network;
wc: WalletConnect;
auth: Auth;
solana: Solana;
near: Near;
wallet: Wallet;
bora: Bora;
constructor({ apiKey, network, ...rest }: FaceConfig);
ready(): Promise<void>;
getEthLikeProvider(): Provider;
getAddresses: (blockchain?: Blockchain) => Promise<string[]>;
setNetwork: (network: Network) => void;
getNetwork: () => Network;
getChainId: () => Promise<number>;
switchNetwork(network: Network): Promise<unknown>;
}
export { Face, FaceConfig };
import { Blockchain, Env, FaceLoginResponse, JsonRpcRequestPayload, JsonRpcResponsePayload, LoginProviderType, LoginWithIdTokenRequest } from '@haechi-labs/face-types';
import { BoraPortalConnectRequest, BoraPortalConnectStatusResponse } from '@haechi-labs/face-types/dist/boraPortal';
import { BigNumber, ethers } from 'ethers';

@@ -39,4 +40,6 @@ import { Face, Network } from './face';

switchNetwork(network: Network): Promise<unknown>;
boraIsConnected(bappUsn: string): Promise<BoraPortalConnectStatusResponse | null>;
boraConnect(request: BoraPortalConnectRequest): Promise<BoraPortalConnectStatusResponse | null>;
}
export {};
//# sourceMappingURL=internal.d.ts.map

@@ -233,4 +233,18 @@ "use strict";

}
async boraIsConnected(bappUsn) {
const requestId = await this.iframe.sendChildMessage({
method: face_types_1.JsonRpcMethod.bora_isConnected,
params: [bappUsn],
});
return await this.iframe.waitForResponse(requestId);
}
async boraConnect(request) {
const requestId = await this.iframe.sendChildMessage({
method: face_types_1.JsonRpcMethod.bora_connect,
params: [request],
});
return await this.iframe.waitForResponse(requestId);
}
}
exports.Internal = Internal;
//# sourceMappingURL=internal.js.map

38

package.json
{
"name": "@haechi-labs/face-sdk",
"version": "1.7.0",
"version": "1.8.0-alpha.0",
"description": "",
"author": "",
"license": "ISC",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.mjs",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/esm/index.mjs",
"require": "./dist/cjs/index.js"
}
},
"files": [

@@ -14,17 +22,27 @@ "dist",

"scripts": {
"build": "tsc -p . --sourceMap true",
"build:watch": "tsc -p . --sourceMap true --watch",
"build": "rollup -c",
"build:watch": "rollup -c -w",
"dev": "yarn run build:watch"
},
"devDependencies": {
"@haechi-labs/face-types": "^1.7.0",
"@haechi-labs/face-types": "^1.8.0-alpha.0",
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-terser": "^0.4.0",
"@tsconfig/node16": "^1.0.2",
"@types/node": "^17.0.33",
"typescript": "^4.6.4"
"rollup": "^2.77.2",
"rollup-plugin-dts": "^5.1.1",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-typescript2": "^0.34.1",
"typescript": "^4.9.5"
},
"dependencies": {
"@solana/web3.js": "^1.64.0",
"ethers": "^5.6.8"
"peerDependencies": {
"@haechi-labs/face-types": ">=1.7.0",
"@solana/web3.js": ">=1.64.0",
"ethers": ">=5.6.8",
"near-api-js": ">=1.1.0"
},
"gitHead": "e28f6f2986a8f7b0552493b499d0037fa6af9475",
"gitHead": "2af33cc2e759af236a981fedb78ed333f2e184f9",
"publishConfig": {

@@ -31,0 +49,0 @@ "access": "public"

import { Blockchain, FaceSolanaNearTransactionPayload } from '@haechi-labs/face-types';
import { PublicKey, Transaction } from '@solana/web3.js';
import { base58 } from 'ethers/lib/utils';
import { ethers } from 'ethers';

@@ -17,3 +17,3 @@ import { Internal } from '../internal';

return addresses.map((address) => {
return new PublicKey(base58.decode(address));
return new PublicKey(ethers.utils.base58.decode(address));
});

@@ -20,0 +20,0 @@ }

@@ -5,10 +5,8 @@ import {

isSupportedNetwork,
JsonRpcMethod,
Network,
NetworkChainIdMap,
unsupportedChainError,
} from '@haechi-labs/face-types';
import { hexlify } from 'ethers/lib/utils';
import { Auth } from './auth';
import { Bora } from './blockchain/Bora';
import { Near } from './blockchain/Near';

@@ -36,2 +34,3 @@ import { Solana } from './blockchain/Solana';

public wallet: Wallet;
public bora: Bora;

@@ -56,2 +55,3 @@ constructor({ apiKey, network, ...rest }: FaceConfig) {

this.wallet = new Wallet(this.internal);
this.bora = new Bora(this.internal);
}

@@ -58,0 +58,0 @@

@@ -11,2 +11,6 @@ import {

} from '@haechi-labs/face-types';
import {
BoraPortalConnectRequest,
BoraPortalConnectStatusResponse,
} from '@haechi-labs/face-types/dist/boraPortal';
import { BigNumber, ethers } from 'ethers';

@@ -307,2 +311,20 @@

}
async boraIsConnected(bappUsn: string): Promise<BoraPortalConnectStatusResponse | null> {
const requestId = await this.iframe.sendChildMessage({
method: JsonRpcMethod.bora_isConnected,
params: [bappUsn],
});
return await this.iframe.waitForResponse<BoraPortalConnectStatusResponse | null>(requestId);
}
async boraConnect(
request: BoraPortalConnectRequest
): Promise<BoraPortalConnectStatusResponse | null> {
const requestId = await this.iframe.sendChildMessage({
method: JsonRpcMethod.bora_connect,
params: [request],
});
return await this.iframe.waitForResponse<BoraPortalConnectStatusResponse | null>(requestId);
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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