Skip to content

Configuration

github-actions[bot] edited this page Aug 11, 2026 · 12 revisions

Configuration object

MixinBot::Configuration stores credentials, derived key forms, hosts, and debug behavior. A configuration is valid when app_id, session_id, session_private_key, and server_public_key are present.

Attribute Purpose
app_id Bot application identifier
client_secret OAuth client secret
session_id Session identifier
session_private_key Session signing key
server_public_key Server key used for protected operations
spend_key Safe transaction signing key
pin PIN key; defaults to spend_key
api_host REST host; defaults to api.mixin.one
blaze_host Blaze host; defaults to blaze.mixin.one
debug Enables Faraday response logging

The constructor accepts aliases client_id, private_key, and pin_token. Key setters decode supported encodings; 32-byte Ed25519 seeds are expanded to 64-byte keypairs, and session/server keys also derive Curve25519 forms where required.

MixinBot.configure do
  self.app_id = 'app-uuid'
  self.session_id = 'session-uuid'
  self.session_private_key = 'base64-or-hex-key'
  self.server_public_key = 'base64-or-hex-key'
  self.spend_key = 'spend-key'
end

Keystores

CLI API commands accept -k or --keystore with either a JSON file path or inline JSON. MixinBot::CLI parses the store and builds a dedicated MixinBot::API using credential aliases.

{
  "app_id": "app-uuid",
  "session_id": "session-uuid",
  "session_private_key": "...",
  "server_public_key": "...",
  "spend_key": "..."
}

Do not commit keystores containing real credentials.

Multiple bots

MixinBot.api uses the global configuration. For isolated credentials, construct one API object per bot:

bot_a = MixinBot::API.new(app_id: '...', session_id: '...', session_private_key: '...', server_public_key: '...', spend_key: '...')
bot_b = MixinBot::API.new(app_id: '...', session_id: '...', session_private_key: '...', server_public_key: '...', spend_key: '...')

bot_a.me
bot_b.me

Clone this wiki locally