@haechi-labs/face-sdk
Advanced tools
Comparing version 1.3.2 to 1.4.0
@@ -7,3 +7,3 @@ import { FaceLoginResponse, LoginProviderType } from '@haechi-labs/face-types'; | ||
login(): Promise<FaceLoginResponse | null>; | ||
socialLogin(provider: LoginProviderType): Promise<FaceLoginResponse | null>; | ||
directSocialLogin(provider: LoginProviderType): Promise<FaceLoginResponse | null>; | ||
logout(): Promise<void>; | ||
@@ -10,0 +10,0 @@ getCurrentUser(): Promise<FaceLoginResponse | null>; |
@@ -11,4 +11,4 @@ "use strict"; | ||
} | ||
async socialLogin(provider) { | ||
return this.internal.socialLogin(provider); | ||
async directSocialLogin(provider) { | ||
return this.internal.directSocialLogin(provider); | ||
} | ||
@@ -15,0 +15,0 @@ async logout() { |
@@ -0,1 +1,2 @@ | ||
import { BigNumber } from 'ethers'; | ||
import * as nearAPI from 'near-api-js'; | ||
@@ -7,4 +8,5 @@ import { Internal } from '../internal'; | ||
getPublicKeys(): Promise<nearAPI.utils.PublicKey[]>; | ||
getBalance(address: string, contractAddress?: string): Promise<BigNumber>; | ||
signAndSendTransaction(transaction: nearAPI.transactions.Transaction): Promise<string>; | ||
} | ||
//# sourceMappingURL=NearProvider.d.ts.map |
@@ -28,2 +28,3 @@ "use strict"; | ||
const face_types_1 = require("@haechi-labs/face-types"); | ||
const ethers_1 = require("ethers"); | ||
const nearAPI = __importStar(require("near-api-js")); | ||
@@ -42,2 +43,9 @@ class NearProvider { | ||
} | ||
async getBalance(address, contractAddress) { | ||
const res = await this.internal.sendRpc({ | ||
method: face_types_1.JsonRpcMethod.near_get_balance, | ||
params: [address, contractAddress], | ||
}); | ||
return ethers_1.BigNumber.from(res); | ||
} | ||
async signAndSendTransaction(transaction) { | ||
@@ -44,0 +52,0 @@ const txPayload = { |
@@ -16,3 +16,3 @@ import { Blockchain, Env, FaceLoginResponse, JsonRpcRequestPayload, JsonRpcResponsePayload, LoginProviderType } from '@haechi-labs/face-types'; | ||
loginWithCredential(): Promise<FaceLoginResponse | null>; | ||
socialLogin(provider: LoginProviderType): Promise<FaceLoginResponse | null>; | ||
directSocialLogin(provider: LoginProviderType): Promise<FaceLoginResponse | null>; | ||
openWalletConnect(name: string, url: string): Promise<void>; | ||
@@ -19,0 +19,0 @@ sendRpc<T>(rpcPayload: JsonRpcRequestPayload): Promise<JsonRpcResponsePayload<T>['result']>; |
@@ -120,5 +120,5 @@ "use strict"; | ||
} | ||
async socialLogin(provider) { | ||
async directSocialLogin(provider) { | ||
const requestId = await this.iframe.sendChildMessage({ | ||
method: face_types_1.JsonRpcMethod.face_socialLogin, | ||
method: face_types_1.JsonRpcMethod.face_directSocialLogin, | ||
params: [provider], | ||
@@ -125,0 +125,0 @@ }); |
{ | ||
"name": "@haechi-labs/face-sdk", | ||
"version": "1.3.2", | ||
"version": "1.4.0", | ||
"description": "", | ||
@@ -19,3 +19,3 @@ "author": "", | ||
"devDependencies": { | ||
"@haechi-labs/face-types": "^1.3.1", | ||
"@haechi-labs/face-types": "^1.4.0", | ||
"@tsconfig/node16": "^1.0.2", | ||
@@ -29,3 +29,3 @@ "@types/node": "^17.0.33", | ||
}, | ||
"gitHead": "36f61804d32e39fdbea141c7f217860d94b42650", | ||
"gitHead": "a68556592f76e254b3e101260d1397c85a511027", | ||
"publishConfig": { | ||
@@ -32,0 +32,0 @@ "access": "public" |
@@ -16,4 +16,4 @@ import { FaceLoginResponse, LoginProviderType } from '@haechi-labs/face-types'; | ||
async socialLogin(provider: LoginProviderType): Promise<FaceLoginResponse | null> { | ||
return this.internal.socialLogin(provider); | ||
async directSocialLogin(provider: LoginProviderType): Promise<FaceLoginResponse | null> { | ||
return this.internal.directSocialLogin(provider); | ||
} | ||
@@ -20,0 +20,0 @@ |
@@ -1,2 +0,7 @@ | ||
import { Blockchain, FaceSolanaNearTransactionPayload } from '@haechi-labs/face-types'; | ||
import { | ||
Blockchain, | ||
FaceSolanaNearTransactionPayload, | ||
JsonRpcMethod, | ||
} from '@haechi-labs/face-types'; | ||
import { BigNumber } from 'ethers'; | ||
import * as nearAPI from 'near-api-js'; | ||
@@ -22,2 +27,11 @@ | ||
async getBalance(address: string, contractAddress?: string): Promise<BigNumber> { | ||
const res = await this.internal.sendRpc({ | ||
method: JsonRpcMethod.near_get_balance, | ||
params: [address, contractAddress], | ||
}); | ||
return BigNumber.from(res); | ||
} | ||
async signAndSendTransaction(transaction: nearAPI.transactions.Transaction): Promise<string> { | ||
@@ -24,0 +38,0 @@ const txPayload: FaceSolanaNearTransactionPayload = { |
@@ -164,5 +164,5 @@ import { | ||
async socialLogin(provider: LoginProviderType): Promise<FaceLoginResponse | null> { | ||
async directSocialLogin(provider: LoginProviderType): Promise<FaceLoginResponse | null> { | ||
const requestId = await this.iframe.sendChildMessage({ | ||
method: JsonRpcMethod.face_socialLogin, | ||
method: JsonRpcMethod.face_directSocialLogin, | ||
params: [provider], | ||
@@ -169,0 +169,0 @@ }); |
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
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
77554
1418