@kadena/kadena-cli
Version:
Kadena CLI tool to interact with the Kadena blockchain (manage keys, transactions, etc.)
27 lines • 930 B
JavaScript
import { createPrincipal } from '@kadena/client-utils/built-in';
export async function createAccountName({ publicKeys, chainId, predicate, networkConfig, }) {
if ((publicKeys === null || publicKeys === void 0 ? void 0 : publicKeys.length) === 0) {
throw new Error('No public keys provided to create an account.');
}
try {
const accountName = await createPrincipal({
keyset: {
pred: predicate,
keys: publicKeys,
},
}, {
host: networkConfig.networkHost,
defaults: {
networkId: networkConfig.networkId,
meta: {
chainId: chainId,
},
},
});
return accountName;
}
catch (e) {
throw new Error(`There was an error creating the account name: ${e.message}`);
}
}
//# sourceMappingURL=createAccountName.js.map