Skip to content

Exports & helpers

The lower-level public surface of @sail.money/sailor/sdk, grouped by purpose. Internal and experimental exports are omitted. Types are mirrored from source.

ExportPurpose
buildDispatchSignatureSelf-detecting Dispatch signer — reads the kernel’s on-chain typehash and signs the correct (selective/conjunctive) struct. Use this; don’t hand-roll.
sailKernelDomainThe EIP-712 domain for any SailKernel.
DISPATCH_EIP712_FIELDSTyped struct field lists keyed by dispatch model.
buildRegisterPermissionTypedDataBuild RegisterPermission typed data (accepts hasDeadline).
buildRegisterPermissionsBatchTypedDataBatch (RegisterPermissions) typed data.
signRegisterPermissionSign a RegisterPermission message.
REGISTER_PERMISSION_TYPES, REGISTER_PERMISSION_TYPES_NO_DEADLINE, REGISTER_PERMISSIONS_BATCH_TYPESThe EIP-712 type definitions.
import { buildDispatchSignature, LocalKeyring } from "@sail.money/sailor/sdk";
import { createPublicClient, http } from "viem";
const publicClient = createPublicClient({ transport: http(rpcUrl) });
const manager = await LocalKeyring.fromKeystoreFile(".sail/keys/manager.json", passphrase);
const { signature, nonce, deadline, dispatchModel } = await buildDispatchSignature({
publicClient, kernel, chainId: 8453,
account: mySafe, permission: myPermission,
call: { target: router, value: 0n, data: swapCalldata },
manager,
});
// kernel.dispatch(account, permission, target, value, data, signature, deadline)
ExportPurpose
detectKernelCapabilitiesRead DISPATCH_TYPEHASH on-chain; identify conjunctive vs selective.
clearCapabilityCacheClear the per-process capability cache.
DispatchModel, KernelCapabilitiesResult types.
DISPATCH_TYPE_STRINGS, DISPATCH_TYPEHASHES, REGISTER_PERMISSION_TYPE_STRINGS, REGISTER_PERMISSION_TYPEHASHESThe known type strings/hashes per model.
ExportPurpose
decodeKernelErrorDecode a revert into a typed KernelError.
explainKernelRevertHuman-readable explanation of a kernel revert.
KERNEL_ERROR_ABI, KERNEL_ERROR_SIGNATURESThe error ABI + 4-byte signatures.
import { explainKernelRevert } from "@sail.money/sailor/sdk";
try { /* dispatch */ } catch (e) { console.error(explainKernelRevert(e)); }
ExportPurpose
getSailDeployment(chainId)Resolve the kernel / factory / governance addresses for a chain.
sailDeployments, normalizeDeploymentThe full registry + a normalizer.
chains, getChainThe chain registry (ChainConfig per chainId).
SailChainId, SailDeployment, KnownTemplate, CloneTemplateInfo, CloneTemplateParam, ChainConfigRegistry types.
ExportPurpose
computeSailSmaAddressPredict an SMA address from principals + salt (the deterministic address).
computeKernelBoundSaltCompute boundSalt = keccak256(saltNonce, caller, permissionSigner, manager, feePolicy).
computeSafeProxyAddressPredict the Safe proxy CREATE2 address.
buildSafeSetupInitializerBuild the Safe setup calldata (with the module-enabler delegatecall).
encodeSetManager, buildSetManagerExecTransactionManager-rotation calldata / Safe exec.
buildApprovedHashSignatureSafe approved-hash signature helper.
SAFE_V141Canonical Safe v1.4.1 addresses.
gnosisSafeAbi, gnosisSafeExecAbi, safeModuleEnablerAbi, safeProxyFactoryAbiSafe-side ABIs.
ExportPurpose
discoverSafesForOwner, getSafeTransactionServiceUrlFind an owner’s Safes via the Safe transaction service.
estimatePermissionFeeEstimate the kernel registration fee.
fetchLifiQuote, minTokenOut, encodeApprove, LIFI_ROUTERS, LIFI_QUOTE_URL, DEFAULT_SLIPPAGEAggregator (LiFi) swap primitives behind client.strategy.swap.
FetchLifiQuoteParams, LifiSwapQuoteSwap quote types.
ExportPurpose
LocalKeyring (+ EncryptedKeystore, LocalKeyringOptions)Load/sign with the encrypted manager key (geth keystore v3).
SailKernelAbi, MandateFactoryAbi, SailGovernanceAbiTrusted-core ABIs.
Signing-server message typesClientMessage, ServerMessage, SigningRequest, SigningResponse, SigningTxRequest, SigningTypedDataRequest, SerializedTypedData, …

Account, Mandate, MandateExplanation, Call, Dispatch, PreviewResult, SimulationResult, TxResult, DispatchOptions, SwapParams, SwapResult, Session, FeePolicy, PermissionTemplate, TemplateEncoder, TemplateExplainer, MandateItem, MandateDraftInput, SailorClientConfig, CreateAccountParams, RegisterAccountParams, plus the Agent / AgentContext types (The Agent interface).