Account Exists

import { AccountExistsRequest, AccountExistsResponse } from "@instruxi-io/mesh-sdk-core";
import { initializeMeshSDK } from "./util";

async function main() {

    try {
        const mesh = await initializeMeshSDK();
		
        const accountExistsRequest: AccountExistsRequest = {
            account_address: mesh.getSigner.account.address
        };
        
        let accountExistsResponse: AccountExistsResponse = await mesh.enforcer.accountExists(accountExistsRequest);
        console.log(`Account exists: ${accountExistsResponse.data.exists}`, )
        
    } catch (error) {
        console.error("An error occurred:", error);
    }
}

main().catch((error) => {
    console.error("Unhandled error in main function:", error);
    process.exit(1);
});