import { PluginConfigurations, PluginContext, PluginType, IChainIdeProxyImpl } from './libs'; import Web3WalletInst from './web3Service'; export function activate(ctx: PluginContext, Impl: IChainIdeProxyImpl) { const registerWallet = Impl.registerWallet({ init: Web3WalletInst.init, setBlocksToWait: Web3WalletInst.setBlocksToWait, setInterval: Web3WalletInst.setInterval, setMaxTimes: Web3WalletInst.setMaxTimes, deploy: Web3WalletInst.deployContract, interact: Web3WalletInst.interactContract, calldata: Web3WalletInst.calldataContract, fetchNetWork: Web3WalletInst.fetchNetWork, fetchAccount: Web3WalletInst.fetchAccount, getAccountBalance: Web3WalletInst.getAccountBalance, // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment walletProvider: Web3WalletInst.walletProvider, walletId: Web3WalletInst.walletId }); ctx.subscriptions.push(registerWallet); } export function deactivate(_ctx: PluginContext) { console.log('deactivate Web3Wallet'); Web3WalletInst.clearProvider(); } export const config: PluginConfigurations = { pluginId: Web3WalletInst.walletId, version: '1.1.0', type: PluginType.server, active: true, description: { title: `Web3 Wallet Service${ process.env.NODE_ENV === 'development' ? ' development' : '' }`, icon: '#CommentSolid', description: 'web3 wallet service' } };