@oko-wallet/oko-sdk-core
Version:
21 lines (16 loc) • 518 B
text/typescript
import type { OkoWalletInterface } from "@oko-wallet-sdk-core/types";
import { OKO_ATTACHED_TARGET } from "@oko-wallet-sdk-core/window_msg/target";
export async function getEmail(
this: OkoWalletInterface,
): Promise<string | null> {
await this.waitUntilInitialized;
const res = await this.sendMsgToIframe({
target: OKO_ATTACHED_TARGET,
msg_type: "get_email",
payload: null,
});
if (res.msg_type === "get_email_ack" && res.payload.success) {
return res.payload.data;
}
return null;
}