UNPKG

@arbius/aa-wallet

Version:

A secure and flexible Account Abstraction wallet implementation for Arbitrum One chain applications.

40 lines (39 loc) 1.22 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.init = init; exports.getConfig = getConfig; exports.isInitialized = isInitialized; const ethereumProxy_1 = require("./ethereumProxy"); const transactionQueue_1 = require("./transactionQueue"); const configValidator_1 = require("./configValidator"); // Global state to store the configuration let globalConfig = null; /** * Initialize the AA wallet with configuration * @param config The wallet configuration */ function init(config) { // Validate the configuration (0, configValidator_1.validateConfig)(config); // Store the configuration globally globalConfig = config; // Setup the ethereum proxy (0, ethereumProxy_1.setupEthereumProxy)(); // Setup the transaction queue (0, transactionQueue_1.setupTransactionQueue)(); console.log('AA Wallet initialized with config:', config); } /** * Get the current configuration * @returns The current configuration or null if not initialized */ function getConfig() { return globalConfig; } /** * Check if the wallet is initialized * @returns True if initialized, false otherwise */ function isInitialized() { return globalConfig !== null; }