UNPKG

@privy-io/js-sdk-core

Version:

Vanilla JS client for the Privy Auth API

2 lines (1 loc) 731 B
"use strict";var e=require("./getUserEmbeddedEthereumWallet.js"),r=require("./getUserEmbeddedSolanaWallet.js");require("./getAllUserEmbeddedEthereumWallets.js"),require("./embedded-wallets.js"),require("./getAllUserEmbeddedSolanaWallets.js");const t=e=>{if("ethereum"===e.chain_type)return{entropyId:e.address,entropyIdVerifier:"ethereum-address-verifier"};if("solana"===e.chain_type)return{entropyId:e.address,entropyIdVerifier:"solana-address-verifier"};throw Error("Invalid embedded wallet account type")};exports.getEntropyDetailsFromAccount=t,exports.getEntropyDetailsFromUser=(d,l)=>{if(!d)return null;if(l?.imported)return t(l);let s=e.getUserEmbeddedEthereumWallet(d)??r.getUserEmbeddedSolanaWallet(d);return s?t(s):null};