Skip to content

API Reference

github-actions[bot] edited this page Jul 21, 2026 · 1 revision

API Reference

MixinBot::API exposes every Mixin Network endpoint through domain modules included in lib/mixin_bot/api.rb. Methods prefixed safe_* use the Safe UTXO pipeline; methods prefixed legacy_* are deprecated (warned once via MixinBot.deprecator, slated for removal in 3.0.0). Interactive WebSocket flows (Blaze connect, upload) cannot be invoked from the CLI; use the Ruby API with EventMachine instead.

Profile & Users

me, safe_me, update_me, read_user, read_users, search_user, fetch_users, friends. Retrieve the bot profile (me/safe_me), update fields (update_me), look up counterparties (read_user*, search_user), and list the bot's friends.

Assets & Network

assets, asset, network_assets, network_asset, ticker, safe_assets. Distinguish the bot-scoped catalog (assets, safe_assets) from the public network catalog (network_assets); ticker returns market data.

Transfers (Safe pipeline)

create_transfer (high-level entry; routes to legacy if pin+opponent_id, otherwise Safe), create_safe_transfer, safe_outputs, build_utxos, build_safe_transaction, verify_raw_transaction, sign_safe_transaction, send_safe_transaction, safe_ghost_keys. The Safe flow is build_utxos to build_safe_transaction to verify_raw_transaction to sign_safe_transaction to send_safe_transaction - see Safe Pipeline.

Transactions

transactions, transaction, safe_transaction, verify_transaction, safe_register_hashes. The Transaction module defines SAFE_TX_VERSION = 0x05, OUTPUT_TYPE_SCRIPT = 0x00, OUTPUT_TYPE_WITHDRAW_SUBMIT = 0xa1, XIN_ASSET_ID, EXTRA_SIZE_STORAGE_CAPACITY, EXTRA_STORAGE_PRICE_STEP. See Transactions.

Multisig

MixinBot::API::Multisig: safe_multisig_* operations (create_safe_multisig_request, sign_safe_multisig_request, unlock_safe_multisig_request, safe_multisig_request), ghost-key derivation, and create_multisig_raw_tx for threshold configuration.

Messaging & Blaze

MixinBot::API::Blaze (blaze.rb) returns a Faye::WebSocket::Client from blaze with Bearer auth and ping: 60. start_blaze_connect(reconnect: true, &block) yields the socket and dispatches on_open/on_message/on_error/on_close callbacks; messages are auto-acknowledged with ACKNOWLEDGE_MESSAGE_RECEIPT. Senders: blaze_send_plain_text, blaze_send_recall_message, blaze_send_post, blaze_send_contact, blaze_send_app_card, blaze_send_app_button, blaze_send_group_app_button.

MixinBot::API::Message: send_message, send_encrypted_messages, conversations, create_conversation, plus builders for PLAIN_TEXT, PLAIN_POST, PLAIN_IMAGE, PLAIN_DATA, PLAIN_STICKER, PLAIN_CONTACT, PLAIN_AUDIO, PLAIN_VIDEO, PLAIN_LIVE, PLAIN_LOCATION, SYSTEM_ACCOUNT_SNAPSHOT, APP_CARD, APP_BUTTON_GROUP, and MESSAGE_RECALL categories.

Snapshots & Outputs

safe_snapshots, snapshots, safe_outputs, outputs - account history and UTXO enumeration. Mix-address deposits use MixinBot::Address and MixinBot::URLScheme.

NFTs & Inscriptions

create_collectible_request, read_collectibles, mint, inscriptions, inscription - see MVM helpers (MVM::Nft).

Auth & Sessions

app, update_app, code, session, oauth, get_access_token, util_get_token. MixinBot::API::Auth issues/refreshes tokens via the configured session private key.

Pin & Tip

verify_pin, create_pin, update_pin, tip_refresh_token, tip_authorize, tip_access_token - PIN entry plus tip-based OAuth.

Withdrawals & Deposits

create_withdrawal, withdrawal, withdrawals, safe_withdrawals. Deposits use MixinBot::Address and MixinBot::URLScheme.

Legacy APIs (deprecated)

LegacyTransfer, LegacyMultisig, LegacyOutput, LegacyPayment, LegacySnapshot, LegacyTransaction, LegacyCollectible, LegacyUser - pre-Safe REST endpoints. Calls emit one deprecation warning via MixinBot.deprecator; migrate to the Safe variants.

Clone this wiki locally