Repository navigation
feat(api-kit): split into queue, indexer and decoder clients - #1454
Merged
Yago Pérez Vázquez (yagopv) merged 38 commits intoDec 1, 2026
Merged
Conversation
Replace the Safe Transaction Service client with a Safe Queue Service client. The service is multi-chain (chainId sent per request), computes the safeTxHash and derives the proposer from the signature, and signs delegate and deletion requests with its own EIP-712 typed data. Methods without an equivalent in the queue service (Safe info, history, tokens, data decoder, ERC-4337 SafeOperations) are removed. updateSafeDelegate and deleteTransaction are added. types-kit and protocol-kit adopt the new SafeMultisigTransactionResponse shape, and sdk-starter-kit drops the safeOperations extension and reads the threshold on-chain to decide when a transaction can be executed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Addresses the CodeQL polynomial regex warning on the queueServiceUrl normalization. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Coverage Report for CI Build 46513592543Coverage increased (+7.8%) to 87.065%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
- Introduced `indexerServiceUrl` as a new configuration option in `createSafeClient`, alongside `queueServiceUrl` and `decoderServiceUrl`. - Deprecated `txServiceUrl` in favor of `indexerServiceUrl`, while still accepting it for backward compatibility. - Updated documentation to reflect changes in service URL usage and configuration. - Adjusted client implementations to ensure proper handling of new service URLs, including the required `/api` path. - Enhanced tests to cover scenarios with new service URL configurations and ensure correct error handling for missing API keys.
…/api-kit-queue-decoder-migration # Conflicts: # packages/api-kit/src/SafeApiKit.ts
… API Kit services
…ctions and remove executed option
…d and adjust related tests
…rify transaction retrieval behavior
…d adjust related configurations
…mprove error handling
…pdate related documentation and tests
Daniel (dasanra)
approved these changes
Nov 30, 2026
Yago Pérez Vázquez (yagopv)
deleted the
feat/api-kit-queue-decoder-migration
branch
December 1, 2026 08:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it solves
Splits
@safe-global/api-kitinto one client per Safe service, with one method per endpoint, and removes the chain from the kit: each request carries its own.What changes
api-kit (major)
apiKit.queue: Safe Queue Service (new, multi-chain). Proposals, confirmations, deletions, off-chain messages and delegates. Signed requests (addDelegate,updateDelegate,removeDelegate,deleteTransaction) use the service's EIP-712 domain.apiKit.indexer: Safe Transaction Service. Same endpoints and responses as before; every method takes{ chainId }to select the service of the chain.apiKit.decoder: Safe Decoder Service (new, multi-chain).decodeDatawithaccuracy,getContracts,getContract.chainIdpassed to the method. An EIP-3770 prefix in an address is only a check: it is accepted together withchainIdand must match it; a prefix withoutchainIdthrows.chainIdis required in the queue writes, the delegates (orallChains: true), every indexer method andgetPendingTransactions(the service needs the chain of every Safe). It is optional in the other queue reads and in the decoder, where no chain means every chain, soallChainsis gone fromgetSafeTransactionsandgetMessages. To mix chains usegetTransactionswithchainIdsper Safe.chainIdandtxServiceUrlare removed.indexerUrls: [{ chainId, url }]overrides the hosted Transaction Service per chain (self-hosted services, chains Safe doesn't run);chainIdcan be a number or a string, as in a JSON config, and duplicates throw.queueServiceUrlanddecoderServiceUrladded.apiKit.getIndexerUrls()lists every chain the indexer can be used with.apiKeyis only sent to the Safe hosted services, matched by exact hostname (api.safe.global,api.5afe.dev); a custom URL never receives it.new SafeApiKit()no longer throws and a self-hosted indexer works without an API key. Note for self-hosters: proposals, confirmations, messages and delegates now go to the Queue Service anddecodeDatato the Decoder Service, so a self-hosted Transaction Service alone only servesapiKit.indexer;queueanddecoderneed the API key or their own service URL.PATCHadded, error messages built from the queue/decoderdetailpayloads.types-kit (major):
SafeMultisigTransactionResponseandSafeMultisigConfirmationResponsefollow the queue schema;ProposalRouteadded;SafeMultisigConfirmationListResponseremoved. The Transaction Service shape is nowIndexerMultisigTransactionResponsein api-kit.protocol-kit (major):
toSafeTransactionType,signTransaction,executeTransactionandisValidTransactionaccept the queue response (nullableto,gasToken,refundReceiver).sdk-starter-kit (major): transactions and messages go through
apiKit.queue, SafeOperations throughapiKit.indexer, passing the chain of the Safe. The config takes the API Kit options as they are:apiKey,indexerUrls,queueServiceUrl,decoderServiceUrl;txServiceUrlis removed.confirmreads the threshold on-chain.Migration
See
.changeset/api-kit-queue-service.md.Tests
queue,indexer,decoder,multichain,SafeApiKit), 118 passing. e2e split undertests/e2e/queueandtests/e2e/indexer; the SafeOperation e2e tests read the Pimlico key from thePIMLICO_API_KEYsecret.