Repository navigation
Releases
Releases · baizhiheizi/mixin_bot
v3.0.3
Changed
- Default JWT
exp_inlowered from 600s to 300s (5 minutes). The Mixin API now rejects tokens whose validity exceeds 5 minutes (parity: bot-api-go-clientjwtValidDuration = 5 * time.Minute, bot-api-nodejs-clientexp = iat + 300). The new default applies to every token-signing path —MixinBot.utils.access_token,Client#get/post/fetch_get/fetch_post/fetch_post_array,API#access_token,API#sign_oauth_access_token, andAPI#fetch_user_sessions. Explicitexp_in:arguments are still honored; only callers relying on the implicit 600s default are affected. Tokens are minted per request, so no behavior changes beyond the shorter validity window.
Fixed
MixinBot.utils.unique_uuidnow honors its documented order-independence. The variadic method calleduuids.sortbut discarded the result (Array#sortreturns a new array without mutating), so calls with 3+ UUIDs produced different IDs depending on argument order. It now sorts before folding. Two-argument calls and all in-gem callers (conversation IDs, group conversation IDs) are unchanged; only direct callers passing 3+ UUIDs in non-sorted order see a different derived ID. The 3-argument golden test value and its order-independence assertions are updated accordingly.
v3.0.2
Added
MixinBot::API#update_app_security—POST /apps/:id/security, the endpoint that persists an app'sallowed_ipsandresource_patterns. The genericupdate_appendpoint silently ignores both fields, so code that tried to manage the resource-pattern whitelist through it was a no-op.
v3.0.0
Added
- Puma plugin hosting the Blaze connection (
plugin :mixin_blaze) — Solid Queue-style in-process hosting, removing the standalone Blaze deployment artifact. Dual run modes via themixin_blaze_modePuma DSL option::fork(default) forks a dedicated Blaze child onon_bootedwith a monitor thread that stops Puma if the child dies, terminated onon_stopped/on_restart;:asyncruns the reactor on a Puma background thread in-process. Handler resolution comes fromMixinBotconfiguration (resolved lazily after app boot) with an explicit ack policy (on-receipt vs after-handler); Puma 6/7 lifecycle-event compatibility; cluster mode requirespreload_app!and fails loudly without it. Puma remains a host-app concern — no new gem dependency. MixinBot::Blaze::Reactor— reusable Blaze loop (connect, keepalive ping, read → handler → ack, reconnect with backoff) wrappingAPI#blaze_async; extracted fromexamples/blaze_async.rbso the plugin shell stays thin and the loop is unit-testable offline.
Changed
- Breaking: Ruby >= 4.0 is now required —
required_ruby_versionbumped from>= 3.2.0to>= 4.0.0. The CI matrix, RuboCop target, and Release workflow all run Ruby 4.0; the dev-onlyparallelversion pin (kept for the old Ruby 3.2 floor) was dropped.
v2.6.0
Added
API#blaze_async— fiber-based sibling ofblaze: returns a connectedasync-websocketclient (samewss://<blaze_host>/URL,Mixin-Blaze-1subprotocol, Bearer JWT, User-Agent, and shared frame codec) for hosts driving Blaze outside EventMachine.handler:is yield-through for caller-suppliedAsync::WebSocket::Connectionsubclasses;endpoint_options:forwards toAsync::HTTP::Endpoint.parse. Forces the HTTP/1 upgrade path via ALPN. Caller-side wire notes: sendwrite_ws_messagebyte arrays asBinaryMessage.new(ary.pack('C*')), feedmessage.to_strintows_message, and own the keepalive ping (server pings are auto-replied).
v2.5.0
Added
- Upstream SDK parity (2026 Go/Node releases) — closes gaps with
bot-api-go-clientv3.25.3 andbot-api-nodejs-clientv7.5.6. API#safe_fees(read_safe_feesalias) —GET /safe/feesglobal Safe fee schedule.API#post_encrypted_messages— encrypt-and-send pipeline (POST /encrypted_messages) with one-shot retry on expired recipient sessions, per-messageSUCCESS/FAILEDstate, and a pluggable session cache.MixinBot::SessionStore— in-memoryMapSessionStoreequivalent; pass any object answeringfetch(user_id)/store(user_id, sessions)assession_store:(storingnilevicts).MixinBot::CacheStoreAdapter— wraps anyActiveSupport::Cache-style store (Rails.cachewith Redis/Memcached/solid_cache, or a hand-rolled read/write/delete object) so encrypted-message sessions can be cached across processes withexpires_in:TTLs.MixinBot::Configuration#http_timeout— opt-in Faraday request timeout in seconds (nil keeps the default).silent:flag on RESTsend_messageand encrypted REST sends, matching GoMessageRequest.Silent.- Chain registry — HyperEVM, X Layer, Robinhood, and Pearl chain ids, plus a corrected Sui id.
CHAIN_STABLECOIN_ASSET_IDSmap andAPI#stablecoin_asset_ids(chain_id); per-chainUSDT_*/USDC_*constants. MixinBot.utils.format_units/#parse_units— decimal-safe unit conversion (Nodeutils/amountparity, noKernel#Integeroctal/hex surprises).MixinBot.utils.oauth_code_challenge— PKCE S256 code challenge (RFC 7636).- OAuth PKCE support —
oauth_token(code, code_verifier:)andauthorize_code(scope:, code_verifier:)exchange and emit PKCE authorizations. blaze_send_app_card(cover_url:, actions:)— APP_CARD parity with the Node SDK.
Changed
API#post_encrypted_messages— encrypted-message checksum now reusesMixinBot.utils.generate_user_checksum(the dead MD5 line inencrypt_messageis gone).- Encrypted-message session store — default store lives on the API instance so caching persists across calls per process; expired sessions are evicted via
store(id, nil)(Gostore.Deleteparity). MixinBot::UtilsCLI introspection —mixinbot utils list/utils callnow surface methods extended from submodules (Address,Amount,Crypto, …).API::Auth—authorize_codeacceptsStringscopes;REFRESH_OAUTH_CODEpayload is built from anoauth_code_paramshelper; the dead@_app_idivar is gone.
Fixed
API#post_encrypted_messages— non-Stringdatais JSON-encoded (was Rubyinspectoutput); thesilentflag is honored on all encrypted REST sends; sessions stores that raise or return non-arrays are tolerated (Goerr == nilsemantics); symbol-keyed sessions are normalized; per-message responses are merged across the retry so every message's final state is returned; duplicatemessage_ids are rejected; malformed/encrypted_messagespayloads raise meaningful errors; kwargs are strictlyaccess_token/exp_in/scp.MixinBot::Client—Configuration#api_hostand#debugare now applied correctly even when the client is initialized with a differentconfig(no more stale Faraday URL when reassigning config).- Encrypted-message test harness — shared guarded WebMock setup in
test_helper.rbsoLIVE=1runs and per-filesetupmethods reset state consistently; encrypted-message stub helpers extracted for reuse.
v2.4.1
Fixed
- CLI keystore path —
File.expand_pathis now applied to the--keystore/-kvalue so~(and other relative paths) resolve correctly beforeFile.file?. Previouslymixinbotwould treat the literal~/...string as JSON content and report "failed to parse keystore JSON".
v2.4.0
What's Changed
- Bump the github-actions group across 1 directory with 2 updates by @dependabot[bot] in #88
- Bump yard from 0.9.43 to 0.9.44 by @dependabot[bot] in #82
- Bump rubocop from 1.86.2 to 1.87.0 by @dependabot[bot] in #86
- Bump msgpack from 1.8.0 to 1.8.3 by @dependabot[bot] in #87
- Update sha3 requirement from ~> 1.0 to >= 1, < 3 by @dependabot[bot] in #84
- [agentic-wiki] Add wiki documentation template by @github-actions[bot] in #89
- [lean-squad] 🔬 [lean-squad] Research & target identification + Lean CI scaffold by @an-lee in #94
- [lean-squad] 🔬 Lean Squad: Tier 1 Lean specs (UUID, Varint, UintCodec) + informal specs by @github-actions[bot] in #95
- [lean-squad] 🔬 Tier 1 Lean specs (UUID, Varint, UintCodec) + informal specs by @github-actions[bot] in #96
- [lean-squad] 🔬 Lean Squad: Tier 2 MainAddress spec + research update by @github-actions[bot] in #97
- [lean-squad] 🔬 CORRESPONDENCE.md (4 targets) + MixAddress informal spec by @github-actions[bot] in #103
- [lean-squad] 🔬 Lean Squad: executable Tier 1 correspondence harness (77 #guard checks) + CRITIQUE.md by @github-actions[bot] in #109
- [lean-squad] 🔬 Lean Squad: discharge UUID axioms + 24 #guard correspondence checks by @github-actions[bot] in #111
- [repo-assist] ✅ test: add unit tests for lib/mixin_bot/api/tip.rb body helpers by @github-actions[bot] in #117
- Bump the github-actions group with 3 updates by @dependabot[bot] in #121
- Bump faraday from 2.14.2 to 2.14.3 by @dependabot[bot] in #119
- Bump rubocop from 1.87.0 to 1.88.0 by @dependabot[bot] in #120
- [lean-squad] 🔬 Lean Squad: prove 3 UintCodec round-trips + add conference paper by @github-actions[bot] in #122
- [repo-assist] ✅ test: add unit tests for chain.rb pure helpers by @github-actions[bot] in #123
- [lean-squad] 🔬 Lean Squad: prove Varint round-trip + update CRITIQUE (run 9) by @github-actions[bot] in #125
- [repo-assist] test: add unit tests for output.rb build_threshold_script by @github-actions[bot] in #126
- [lean-squad] 🔬 RESEARCH + TARGETS + CORRESPONDENCE updates (run 10) by @github-actions[bot] in #127
- [repo-assist] 📝 docs: bump stale version references from 2.2.1 to 2.3.0 by @an-lee in #128
- chore: remove Lean Squad formal-verification workflow and artifacts by @an-lee in #129
- Bump concurrent-ruby from 1.3.6 to 1.3.7 in the bundler group across 1 directory by @dependabot[bot] in #130
- [repo-assist] test: add unit tests for legacy_collectible.rb pure helpers by @github-actions[bot] in #131
- [repo-assist] fix: rename test_build_threshold_script_255 to satisfy Naming/VariableNumber by @github-actions[bot] in #133
- [repo-assist] perf: use Array#concat in Transaction::Encoder to avoid O(n2) reallocations by @github-actions[bot] in #138
- [repo-assist] fix: CI for #145/#146 + Ruby 4.0 OpenSSL OAEP compat in legacy_user.rb by @github-actions[bot] in #148
- [repo-assist] test: add unit tests for inscription.rb pure helpers by @github-actions[bot] in #141
- [repo-assist] test: add unit tests for multisig.rb safe helpers by @github-actions[bot] in #142
- fix: correct legacy_user test assertions by @an-lee in #151
- [repo-assist] ✅ test: cover small API modules (address, fiat, turn, session, deposit, pin_payload) by @github-actions[bot] in #152
- Bump the github-actions group with 4 updates by @dependabot[bot] in #154
- [repo-assist] ✅ test: cover computer_api.rb delegations and pure helpers by @github-actions[bot] in #156
- [repo-assist] ⚡ perf: cache bytes.pack in encoder.rb to skip duplicate allocation by @github-actions[bot] in #158
- [repo-assist] ✅ test: cover BotAuth + UrlScheme modules by @github-actions[bot] in #167
- [repo-assist] ✅ test: cover BotAuth + UrlScheme modules by @github-actions[bot] in #168
- [repo-assist] ⚡ perf: use Array#concat in Nfo + InvoiceEntry encoders by @github-actions[bot] in #159
- [repo-assist] ⚡ perf: use Array#concat in EncryptedMessage + MVM::Registry encoders by @github-actions[bot] in #163
- [repo-assist] test: cover Blaze send helpers by @github-actions[bot] in #171
- [repo-assist] test: cover Payment#safe_pay_url defaults, multisig, and round-trip by @github-actions[bot] in #172
- chore(deps): bump rdoc from 7.2.0 to 8.0.0 by @dependabot[bot] in #173
- chore(deps): bump rubocop from 1.88.0 to 1.88.1 by @dependabot[bot] in #174
- chore(deps): bump the github-actions group with 4 updates by @dependabot[bot] in #175
- [repo-assist] fix(payment): render safe_pay_url amount without scientific notation by @github-actions[bot] in #176
- chore(deps): bump rubocop from 1.88.1 to 1.88.2 by @dependabot[bot] in #180
- chore(deps): bump the github-actions group with 2 updates by @dependabot[bot] in #181
- chore(deps): bump websocket-driver from 0.8.0 to 0.8.1 in the bundler group across 1 directory by @dependabot[bot] in #183
- chore(deps): bump yard from 0.9.44 to 0.9.45 by @dependabot[bot] in #184
- chore(deps): bump simplecov from 0.22.0 to 1.0.1 by @dependabot[bot] in #185
- chore(deps): bump the github-actions group with 3 updates by @dependabot[bot] in #186
New Contributors
- @github-actions[bot] made their first contribution in #89
Full Changelog: v2.3.0...v2.4.0
v2.3.0
Added
MixinBot::APIError— structured base for API failures withcode,description,request_id,extra, and helpersretryable?,throttle?,client_error?.- Typed API errors —
RateLimitError,ValidationError,ConflictError,TransferError,TransientError,AppUpdateRequiredError,InvalidAddressFormatError,ServerError. MixinBot.retryable?(error)— canonical retry policy for network timeouts, server errors (500+), and transient codes (10104, 10105).- CLI — structured error kind
rate_limit; API errors in JSON output includecode,request_id, andthrottlewhen available. test/mixin_bot/client/test_error_mapper.rb— unit tests for full official error-code catalog, legacy codes, HTTP fallbacks, and retry/throttle semantics.
Changed
- BREAKING: Error code mapping — aligned to Mixin API error codes. Code
429raisesRateLimitError(notForbiddenError). Codes10002and20116raiseValidationErrorandConflictErrorrespectively.ForbiddenErroris reserved for code403. Monitor.check_retryable_error— delegates toMixinBot.retryable?(no longer retries on"insufficient"message substrings).Client#parse_response!— HTTP status fallback for 401/403/429/5xx when JSONerroris absent (CDN/proxy edge cases).
Migration
- Rescue rate limits explicitly:
rescue MixinBot::RateLimitError(or checkerror.throttle?). - Replace string-based retry heuristics with
MixinBot.retryable?(error). - If you rescued
ForbiddenErrorexpecting throttling, update to handleRateLimitErrorseparately.
v2.2.2
Fixed
- Safe transfer raw encoding — version 5 transactions now always encode and decode the references count (including
0000when empty), matching the Mixin kernel and official Go/TS SDKs. Fixes/safe/transaction/requestsrejection after the v2 transaction encoder refactor.
v2.2.1
Changed
- Billing preflight
increment—ensure_app_billing_credit!accepts anincrementparameter (default0) instead of readingapp_properties.price.create_user/create_safe_userdefault to0.5per billed user; passincrement: 0for free-tier headroom.