@effectai/sdk
Version:
Effect Network Javscript/Typescript SDK (for [https://effect.network](https://effect.network))
16 lines • 567 B
JavaScript
import { createVAccount, getVAccounts, } from "../../exports";
export const getOrCreateVAccount = async ({ client, actor, session, }) => {
try {
let [account] = await getVAccounts({ client, actor });
if (!account) {
await createVAccount({ client, session, account: actor });
[account] = await getVAccounts({ client, actor });
}
return account;
}
catch (error) {
console.log(error);
throw new Error("Failed to get or create vAccount");
}
};
//# sourceMappingURL=getOrCreate.js.map