import { ThresholdSignatureScheme } from '@dynamic-labs-wallet/node';
import { authenticatedEvmClient } from '<path-to-dynamic-authenticated-client>';
const AUTH_TOKEN = "your-auth-token";
const ENVIRONMENT_ID = "your-environment-id";
const evmClient = await authenticatedEvmClient({
authToken: AUTH_TOKEN,
environmentId: ENVIRONMENT_ID,
});
const thresholdSignatureScheme = ThresholdSignatureScheme.TWO_OF_TWO; // or TWO_OF_THREE or THREE_OF_FIVE
const password = "your-optional-password";
const onError = (error: Error) => {
// handle error
console.error(error);
};
const {
accountAddress,
rawPublicKey,
publicKeyHex,
externalServerKeyShares,
walletId,
} = await evmClient.createWalletAccount({
thresholdSignatureScheme,
password,
onError,
backUpToClientShareService: true, // Optional: backs up key shares to Dynamic's service (important-comment)
});