Integrationsleitfaden für die SDKs
Dieser Leitfaden zeigt, wie eine App oder eine Wallet auf den beiden SDKs aufbaut, dem SDK für TypeScript und dem für Dart. Er folgt den Schritten in der Reihenfolge eines Integrators, vom Einrichten eines Safes bis zur Migration, und nennt danach Netzwerk, Kosten, Grenzen und Pflichten. Wie weit SDKs und Smart Contracts sind, steht in der Tabelle „Status".
Der Leitfaden unten steht auf Englisch, weil wir ihn unverändert aus dem Repository der SDKs übernehmen.
The integrator guide
How an app, a wallet or a custodian builds on the two SDKs of auto-sweep: the TypeScript SDK (packages/sdk-ts, the reference) and the Dart SDK (packages/sdk-dart, at parity). It follows the steps in the order an integrator takes them: set up a Safe, gather the owners' signatures, deploy ahead with the target chain first, upload the documents, apply, re-arm, recover a missed mint, and migrate. It then gives the network table, the gas per chain, the limits of the router and what an integrator carries itself.
We are not a bank. The project is not affiliated with or endorsed by CoW DAO, Circle or Safe.
The guide is written from the built SDKs, docs/gas.md, the fork suite (docs/fork-tests.md), the internal security file (docs/cra/),
SECURITY.md and docs/advisories.md. Where a page states a rule of the specification, it names the requirement. Nothing here is legal advice, and no page says that a product meets a legal requirement or is free of flaws.
Status
| What | State today | Read from |
|---|---|---|
| The SDKs | Both packages are private and unpublished, at version 0.0.0. No registry holds either of them. | packages/sdk-ts/package.json, packages/sdk-dart/pubspec.yaml |
| Release records |
No release record exists yet. Both SDKs ship with an empty list, so supportedChains() is empty and every function that takes a chain refuses it with unsupported-chain. No address, default or hash of a release is stated in this guide.
|
shared/release-records.json, docs/release-record.md |
| The contracts | Nothing is deployed. | SECURITY.md ("Scope"), deployments/README.md |
| The Dart transport |
The Dart SDK takes the RPC of a chain as a URL, as the TypeScript SDK does, reached through package:http, or as the integrator's RpcTransport. fetch is optional: left out, it is a fetch on package:http.
|
packages/sdk-dart/lib/src/config.dart, packages/sdk-dart/lib/src/http_transport.dart
|
| Gas figures | Measured on forks at the pin of each chain, cold, in EVM gas only. They are not figures from a live chain. | docs/gas.md |
| Hook constants |
The gas the documents declare for the burn hook, 200,000, is the worst measured least limit plus about a fifth; it is not frozen until the release candidate is. docs/gas.md shows it enough on all six chains.
|
docs/gas.md ("The declared limits against the measurements") |
| Support | No promise of support, of a response time or of a contact point is made; the policy is best effort. | SECURITY.md ("Who is responsible", "What to expect") |
Which requirement is answered where
Each row names a requirement of the specification that asks the documentation to state something, and the section of this guide that states it.
tools/test/integrator-docs.test.ts fails when a row has no section, when the section does not name the requirement, or when an ID is not in the specification.
| Requirement | What the guide states | Section |
|---|---|---|
ACTORS-REQ-006 |
A CASP that runs Safes for clients carries the MiCA, GwG and TFR duties for those sweeps and burns. The integrator's fee sits on the source conversions whose settlement ends in the burn. An integrator that runs recovery, burns or a server for its users is in the "run by us" case for itself. Its bundlers and paymasters are its own question. | What an integrator carries itself |
SDK-REQ-005 |
Every third-party endpoint the SDK calls, for the integrator's privacy notice. | The network table |
COMP-REQ-005 |
Every third party that receives data from the SDK, for the same notice. | The network table |
SDK-REQ-022 |
Every burn takes the Safe's whole USDC balance on a source chain, and an op of the owners in the same settlement may find its USDC gone if the burn hook runs first. | The burn takes the whole USDC balance |
SDK-REQ-024 |
The SDK builds no UserOperation and names no bundler or paymaster. An op on a router Safe needs router-kind call limits, because a too-low limit makes the op fail inside a bundler's own transaction. | Operations on a router Safe |
SETUP-REQ-015 |
A later version with another helper gives new Safes a new address, while existing Safes migrate per chain and keep theirs. | A later version gives new Safes a new address |
SETUP-REQ-019 |
The SDK refuses a Safe below v1.5.0. A router Safe serves no ERC-721, ERC-1155 or ERC-777 callbacks and no supportsInterface, so it cannot receive an NFT by safeTransferFrom.
|
The router serves no NFT callbacks and Existing Safes are refused |
SETUP-REQ-020 |
The router's gas cost, against a Safe whose handler is the 4337 module and against CoW's handler, measured on all six chains. | What the router costs |
SETUP-REQ-023 |
Only Safes created by helper v1 take part. The SDK refuses an existing Safe by name, and the guide says to create a v1 Safe and move funds. | Existing Safes are refused |
COMP-OQ-08 |
The question is open. The guide passes Circle's user duties to integrators anyway, as the specification assumes. | Circle's user duties |
DEC-019 |
The owner-chosen target token stays; the oracle of each chain is fixed by the store and the seq jump is capped (DEC-030). The SDK refuses another oracle by name, flags what is not reviewed, and the integrator shows those warnings.
|
The warnings the owners must see |
The pages
| Page | What it covers |
|---|---|
setup.md |
Configuring the SDK, the Safe's address, the checks of an existing Safe, deploying ahead with the target first, the bootstrap order on Ethereum |
configuration.md |
The configuration, the disclosure the owners read, the warnings, the signatures |
documents.md |
The three app-data documents of a chain and their upload |
running.md |
Applying the newest message everywhere, re-arming, the burn, the fallback burn, owner changes |
recovery.md |
Finding a burn with no mint, building the mint, re-attesting an expired message |
status.md |
What the SDK derives from the chains and what each value asks of the integrator |
migration-and-exit.md |
New versions, migrating a Safe, re-enabling, and leaving |
network.md |
The network table, for privacy notices |
costs.md |
The gas and the cost per chain, and the router against the other handlers |
limits.md |
What a Safe of this product cannot do, and the bounds the SDK refuses |
address-check.md |
The optional, advisory look-up of an address in a list the integrator supplies |
duties.md |
What an integrator carries itself |
Terms
- The owners: the plain (EOA) owners of the Safe, who sign everything.
- Safe: the owners' Safe account, created by the setup helper of a release, at the same address on each chain. A "v1 Safe" is one created by the version 1 setup helper.
-
Message: the signed configuration: one EIP-712 message with a
seq(a counter that each newer message raises), valid on all six chains. - Version: a set of deployed contracts. Version 1 is the first. Release: a published version, with one release record per chain. SDK release: a published package of an SDK.
- Op: an ERC-4337 UserOperation, sent through a bundler.
- Conditional order: CoW Protocol's name for an order that ComposableCoW holds for a Safe and that CoW's watch-tower, a service that polls such orders, posts to the order book once its conditions are met.
-
Router Safe: a Safe whose fallback handler is the
FallbackRouter. Module kind: a Safe whose handler is Safe's 4337 module. - Iris: Circle's attestation service.
- The pin: the block of each chain at which the fork tests and every figure were measured.
-
The integrator's app (on
duties.md): the app or wallet the integrator places on the market. - CASP: a crypto-asset service provider. MiCA: the EU regulation on markets in crypto-assets. TFR: Regulation (EU) 2023/1113 on transfers of crypto-assets. GwG: the German anti-money-laundering act.
How the snippets read
Each step shows the TypeScript call and the Dart call. The two SDKs have the same functions and the same refusals. For every case the conformance vectors cover (conformance/README.md), they give the same output, byte for byte. A refusal is an
SdkError whose code names it; the codes are written in kebab case here, as the TypeScript SDK has them and as
SdkErrorCode.value has them in Dart. Where Dart differs by its types, the page says so. Every function returns
{ to, data, value } or throws a named refusal; none sends a transaction, signs, or holds a key. The integrator's wallet sends what is returned.
The SDK keeps no state. Everything it reports is read from the chains, and from Circle's attestation service when asked, on that call. What the integrator must keep itself is the newest signed configuration of each Safe, and the block from which to look for burns.
What the guide is not
It does not document an app of ours: version 1 ships the SDKs, the documentation and the conformance vectors only (DEC-009
point 12). It is not a promise about a release, an address or a price. Gas prices change: the figures are the cost at the base fee of a pinned block. The guide describes what is built on
development; a page that names something not built says so.