@steerprotocol/matador-sdk
v1.0.1
Published
TypeScript SDK for Matador Kernel wallet bootstrap, validator install, strategy bundles, and registry setup.
Readme
Matador SDK
@metadore/matador-sdk is a TypeScript SDK for Matador wallet bootstrap, Kernel validator installation, strategy bundles, strategy-config hashing, and registry setup.
The SDK is viem and permissionless first. Kernel is the first supported smart-account family. MinimalAccount contracts remain repository context, not the SDK wallet API foundation.
Install
npm install @metadore/matador-sdk viem permissionlessDesign
@metadore/matador-sdk/core: Arbitrum deployment metadata, EntryPoint defaults, Kernel defaults, ABIs, shared types, andMatadorClient.@metadore/matador-sdk/wallet: Kernel helpers overpermissionless, Pimlico gas pricing, EntryPoint prefund helpers, existing-wallet validation.@metadore/matador-sdk/matador: Matador validator install helpers, policy pack registry helpers, strategy registry helpers, and setup planning.@metadore/matador-sdk/strategy: embedded strategy bundles plus Atlas strategy-config payload and digest helpers.@metadore/matador-sdk/pinata: optional Pinata publisher.
The root @metadore/matador-sdk export keeps the full public API available for convenience and backward compatibility.
See SDK_IMPLEMENTATION_SHARE_PLAN.md for the current implementation plan.
For AI coding agents or automation that needs to extend this package, see AGENTS.md. It documents the intended Kernel flow, Matador setup rules, testing requirements, and integration anti-patterns.
Kernel bootstrap example
import { createPublicClient, http } from 'viem'
import { arbitrum } from 'viem/chains'
import {
buildKernelSmartAccount,
createKernelSmartAccountClient,
createPimlicoPaymasterOptions,
getPimlicoUserOperationGasPrice,
sendFirstKernelDeploymentUserOperation,
} from '@metadore/matador-sdk/wallet'
import { getKernelDefaults } from '@metadore/matador-sdk/core'
const publicClient = createPublicClient({
chain: arbitrum,
transport: http(process.env.ARBITRUM_RPC_URL),
})
const kernel = getKernelDefaults(42161, '0.3.3')
const account = await buildKernelSmartAccount({
client: publicClient,
owner: walletClient,
version: kernel.version,
entryPoint: {
address: kernel.entryPointAddress,
version: kernel.entryPointVersion,
},
validatorAddress: kernel.bootstrapValidatorAddress,
factoryAddress: kernel.factoryAddress,
index: 0n,
})
const sender = await account.getAddress()
const paymaster = createPimlicoPaymasterOptions({
url: process.env.PIMLICO_PAYMASTER_URL!,
chain: arbitrum,
entryPoint: {
address: kernel.entryPointAddress,
version: kernel.entryPointVersion,
},
})
const smartAccountClient = createKernelSmartAccountClient({
account,
bundlerUrl: process.env.PIMLICO_BUNDLER_URL!,
chain: arbitrum,
client: publicClient,
...paymaster,
})
const gas = await getPimlicoUserOperationGasPrice({
url: process.env.PIMLICO_BUNDLER_URL!,
chain: arbitrum,
entryPoint: {
address: kernel.entryPointAddress,
version: kernel.entryPointVersion,
},
})
await sendFirstKernelDeploymentUserOperation({
smartAccountClient,
account,
sender,
maxFeePerGas: gas.standard.maxFeePerGas,
maxPriorityFeePerGas: gas.standard.maxPriorityFeePerGas,
...paymaster,
})Matador setup planning
import {
encodeBootstrapSteps,
getBootstrapState,
writeTransactionRequests,
} from '@metadore/matador-sdk/matador'
import { getDeployments } from '@metadore/matador-sdk/core'
import { atlasYieldCircuitBundle } from '@metadore/matador-sdk/strategy'
const deployments = getDeployments(42161)
const state = await getBootstrapState({
publicClient,
deployments,
account: sender,
bundle: atlasYieldCircuitBundle,
expectedValidatorOwner: owner,
expectedActionExecutor: actionExecutor,
expectedStrategyAdmin: strategyAdmin,
expectedStrategyOperator: actionExecutor,
})
const requests = encodeBootstrapSteps({
deployments,
state,
bundle: atlasYieldCircuitBundle,
validatorOwner: owner,
actionExecutor,
strategyAdmin,
strategyConfigUri,
strategyOperator: actionExecutor,
})
await writeTransactionRequests({
walletClient,
publicClient,
account: strategyAdmin,
requests,
waitForReceipt: true,
})