I'm submitting a...
What is the expected behaviour?
Allow passing custom HTTP headers to the bundler and paymaster clients, so the module works with
providers that require an Authorization header (or any other header) instead of authenticating
through the URL.
Proposed config additions:
bundlerHeaders?: Record<string, string> on the common config (next to bundlerUrl)
paymasterHeaders?: Record<string, string> on the paymaster configs (next to paymasterUrl)
const wallet = new WalletManagerEvmErc4337(seedPhrase, {
chainId: 11155111,
provider: 'https://sepolia.drpc.org',
bundlerUrl: 'https://bundler.example.com/rpc',
bundlerHeaders: { Authorization: 'Bearer YOUR_KEY' },
safeModulesVersion: '0.3.0',
isSponsored: true,
paymasterUrl: 'https://paymaster.example.com/rpc',
paymasterHeaders: { Authorization: 'Bearer YOUR_KEY' },
})
What is the current behaviour?
The module builds its bundler and paymaster clients from URL strings only
(new Bundler(bundlerUrl), new Erc7677Paymaster(paymasterUrl, ...)), with no way to attach
headers. Providers that require a header-based API key can't be used unless the key can be encoded
in the URL.
Possible solution
abstractionkit@0.4.0 already exposes an HttpTransport(url, { headers }) and accepts a
Transport anywhere a URL is accepted (Bundler, Erc7677Paymaster, createUserOperation,
createPaymasterUserOperation). When headers are configured, wrap the URL in an HttpTransport;
otherwise pass the plain URL unchanged (no behaviour change for existing configs).
I've opened a PR implementing this and will link it here.
Node version
Node v22.13.1 x64
I'm submitting a...
What is the expected behaviour?
Allow passing custom HTTP headers to the bundler and paymaster clients, so the module works with
providers that require an
Authorizationheader (or any other header) instead of authenticatingthrough the URL.
Proposed config additions:
bundlerHeaders?: Record<string, string>on the common config (next tobundlerUrl)paymasterHeaders?: Record<string, string>on the paymaster configs (next topaymasterUrl)What is the current behaviour?
The module builds its bundler and paymaster clients from URL strings only
(
new Bundler(bundlerUrl),new Erc7677Paymaster(paymasterUrl, ...)), with no way to attachheaders. Providers that require a header-based API key can't be used unless the key can be encoded
in the URL.
Possible solution
abstractionkit@0.4.0already exposes anHttpTransport(url, { headers })and accepts aTransportanywhere a URL is accepted (Bundler,Erc7677Paymaster,createUserOperation,createPaymasterUserOperation). When headers are configured, wrap the URL in anHttpTransport;otherwise pass the plain URL unchanged (no behaviour change for existing configs).
I've opened a PR implementing this and will link it here.
Node version
Node v22.13.1 x64