A service for creating Steem accounts with automatic VESTS delegation (accounts must be claimed before).
- Install dependencies:
npm install- Create
.envfile with the following configuration:
PORT=3000
STEEMD_URL=https://api.steemit.com
CREATOR_ACCOUNT=creator_account
CREATOR_KEY=your_creator_private_key
API_KEY=your_secure_api_key_here
SHOULD_DELEGATE=true
DELEGATION_AMOUNT=6020.000000 VESTS
ACCOUNT_PREFIX=dw-
POSTING_AUTHORITIES="drugwars,fundition,future.app"- Start the server:
npm startUsing cURL:
curl -H "x-api-key: your_api_key_here" http://localhost:3000/createwallet/usernameUsing Axios:
const axios = require('axios');
async function createSteemAccount(username) {
try {
const response = await axios.get('http://localhost:3000/createwallet/' + username, {
headers: {
'x-api-key': 'your_api_key_here'
}
});
console.log('Account created successfully:', response.data);
return response.data;
} catch (error) {
console.error('Error creating account:', error.response?.data || error.message);
throw error;
}
}
// Usage
createSteemAccount('username')
.then(keys => {
console.log('Owner Key:', keys.ownerKey);
console.log('Active Key:', keys.activeKey);
console.log('Posting Key:', keys.postingKey);
console.log('Memo Key:', keys.memo_key);
})
.catch(console.error);Response:
{
"ownerKey": "5J...",
"activeKey": "5J...",
"postingKey": "5J...",
"memo_key": "STM..."
}PORT: Server port (default: 3000)STEEMD_URL: Steem blockchain API endpointCREATOR_ACCOUNT: Account used to create new accountsCREATOR_KEY: Private key of the creator accountAPI_KEY: Secure key for API authenticationSHOULD_DELEGATE: Enable/disable VESTS delegation (true/false)DELEGATION_AMOUNT: Amount of VESTS to delegate to new accountsACCOUNT_PREFIX: Prefix for account names (e.g., "dw-" + username)POSTING_AUTHORITIES: Comma-separated list of accounts with posting authority
The service creates accounts with the following format:
- Prefix: Configured in
ACCOUNT_PREFIX(default:dw-) - Username: The provided username
Example: For username john, the account name will be: dw-john
- API key authentication
- CORS protection
- Helmet security headers
- HTTPS recommended for production use
The API returns appropriate HTTP status codes:
200: Success400: Bad request (invalid input format)401: Unauthorized (invalid or missing API key)500: Server error
Error responses include a message explaining the issue:
{
"error": "Error message here"
}- Always use HTTPS in production
- Keep your API key secure
- Implement proper error handling in your client applications
- Consider implementing additional security measures like IP whitelisting
- Regularly rotate your API keys
- Monitor your API usage for suspicious activity
- The service uses the configured creator account to create new accounts
- Each new account receives the configured amount of VESTS delegation (if enabled)
- The posting authority includes accounts specified in
POSTING_AUTHORITIES - Make sure to securely store the returned keys as they cannot be recovered if lost
- Keep your API key secure and never share it publicly