Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function createLnRpc(userConfig: LnRpcClientConfig): Promise {
const rootPath = await pkgDir(__dirname);
const protoFilePath = join(
rootPath,
`lnd/${packageJson.config['lnd-release-tag']}/rpc.proto`,
);
// Configuration options
const config = {
...defaults,
...userConfig,
};
const { lightning, walletUnlocker, server, grpcLoader, grpc, includeDefaults } = config;
// Generate grpc SSL credentials
const credentials = await createCredentials(config);
// Create RPC from proto and return GRPC
export async function createChainRpc(userConfig: ChainRpcClientConfig): Promise {
const rootPath = await pkgDir(__dirname);
const protoFilePath = join(
rootPath,
`lnd/${packageJson.config['lnd-release-tag']}/chainrpc/chainnotifier.proto`,
);
// Configuration options
const config = {
...defaults,
...userConfig,
};
const { chainNotifier, server, grpcLoader, grpc, includeDefaults } = config;
// Generate grpc SSL credentials
const credentials = await createCredentials(config);
// Create RPC from proto and return GRPC
export async function runCLI(
args: string[],
options: execa.Options = {}
): Promise {
const root = await pkgDir();
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
return execa(join(root!, "packages", "cli", "bin", "kosko.js"), args, {
...options,
env: {
LC_ALL: "en_US",
...options.env
}
});
}
export async function createWalletRpc(userConfig: WalletRpcClientConfig): Promise {
const rootPath = await pkgDir(__dirname);
const lndProtosRootPath = join(
rootPath,
`lnd/${packageJson.config['lnd-release-tag']}`,
);
const protoFilePath = join(
lndProtosRootPath,
'/walletrpc/walletkit.proto',
);
// Configuration options
const config = {
...defaults,
...userConfig,
};
const { walletKit, server, grpcLoader, grpc, includeDefaults } = config;
commands.registerCommand("sh.version", async () => {
const rootDir = await pkgDir(__dirname)
const v = require(path.resolve(rootDir, 'package.json')).version
workspace.showMessage(`Version: ${v} [node: ${process.versions.node}]`, 'more')
})
)
public static async installAll (): Promise {
log.info('PuppetManager', 'installAll() please wait ...')
const moduleList: string[] = []
for (const puppetModuleName of Object.keys(PUPPET_DEPENDENCIES)) {
const version = PUPPET_DEPENDENCIES[puppetModuleName as PuppetModuleName]
if (version !== '0.0.0') {
moduleList.push(`${puppetModuleName}@${version}`)
}
}
await npm.install(
moduleList,
{
cwd : await pkgDir(__dirname),
output : true,
save : false,
},
)
}
public static async install (
puppetModule: string,
puppetVersion = 'latest',
): Promise {
log.info('PuppetManager', 'install(%s@%s) please wait ...', puppetModule, puppetVersion)
if (puppetModule === 'wechaty-puppet-puppeteer') {
await this.preInstallPuppeteer()
}
await npm.install(
`${puppetModule}@${puppetVersion}`,
{
cwd : await pkgDir(__dirname),
output : true,
save : false,
},
)
log.info('PuppetManager', 'install(%s@%s) done', puppetModule, puppetVersion)
}
async function projectRoot(): Promise {
let dir = await baseDir()
let root = await pkgDir(dir)
if (!root) {
workspace.showMessage('Project root not found, package.json not exists.', 'error')
return null
}
return root
}