Sign API
The single signing entry point. Every signature — transactions, messages, typed data, data, auth entries — goes through sign({ method, chainId, payload }).
Signature
await dcent.sign({
method: string, // 'signTransaction' | 'signMessage' | 'signTypedData' | 'signAuthEntry'
chainId: string, // CAIP-2/19
payload: {
keyPath: string, // BIP-44 — REQUIRED for every method
… // method- & network-specific (see Chain Reference)
}
}): Promise<V1Response>
The common request shell
| Field | Type | Required | Notes |
|---|---|---|---|
method | string | Required | Intent. The connector forwards it as an opaque string. |
chainId | string | Required | Target network — full CAIP-19, incl. /slip44. |
payload.keyPath | string | Required | Derivation path, every method. |
payload.transaction / .message / .data … | object/string | per method | Defined per network — see Chain Reference. |
The connector is chain-agnostic. It validates keyPath + JSON-serializability (≤64 KB) and forwards payload opaquely. There is no per-chain branching and no method enum at the connector layer.
The common response shell
Success returns body.parameter; the field depends on the method:
| method | body.parameter |
|---|---|
signTransaction | { signature } — broadcast-ready serialized tx |
signMessage | { signature } |
signTypedData | { signature } — EIP-712 |
signAuthEntry | { signedAuthEntry, signerAddress } — Stellar Soroban |
signTransaction.signature is not "just a signature" — it's the broadcast-ready serialized transaction (e.g. EVM = RLP-encoded signed raw tx for eth_sendRawTransaction). Exact form is per-network; see each Chain Reference page.
signTransaction signs a complete, broadcast-ready transaction. DCENT does not fill in consensus fields for you — the App must supply a fully-formed transaction (nonce, fee, blockhash/sequence, and any other network-required field, already set). If a required field is missing, signTransaction returns -32602 (Invalid params). Freshness — keeping nonce and expiry-style fields (blockhash, LastLedgerSequence, etc.) current — is the App's responsibility. Exactly which fields are required is per-network; see each Chain Reference page.
Where to go next
Payload shapes live on the network pages, not here (no duplication):
Methods
signTransaction
Signs a transaction and returns a broadcast-ready serialized transaction. The payload shape is network-specific.
signMessage
Signs an arbitrary message. Supported on the Ethereum family, Kaia, Solana, Stellar, and Polkadot parachains — not on the non-EVM Conflux and VeChain families.
signTypedData
Signs EIP-712 typed data. EVM and Kaia only.
signAuthEntry
Signs a Soroban SorobanAuthorizationEntry. Stellar.