Skip to main content

Sign API — per-coin functions → sign()

Every v1 getXxxSignedTransaction / getXxxSignedMessage becomes one sign() call — except getHederaSignedMessage, which has no v2 counterpart (Hedera has no signMessage; the request returns method_not_found -32601). The network's payload.transaction shape is on its Chain Reference page.

warning

The biggest semantic change: v1 had three input patterns — ① EVM positional, ② {unsignedTx,…}, and ③ {coinType, sigHash, …} (you computed the hash yourself). v2 takes the full transaction object for every network — you no longer pre-compute a sigHash. Some families also accept a payload you built yourself, alongside their structured forms (see each network page).

EVM example​

v1

await dcent.getEthereumSignedTransaction(
dcent.coinType.ETHEREUM, '0x0', '0x3b9aca00', '0x5208',
'0xRecipient', '0x2386f26fc10000', '0x', "m/44'/60'/0'/0/0",
1, 2, { maxFeePerGas:'0x77359400', maxPriorityFeePerGas:'0x3b9aca00' })

v2

await dcent.sign({
method:'signTransaction',
chainId:'eip155:1/slip44:60',
payload:{
keyPath:"m/44'/60'/0'/0/0",
transaction:{
type:2,
nonce:'0x0',
gasLimit:'0x5208',
maxFeePerGas:'0x77359400',
maxPriorityFeePerGas:'0x3b9aca00',
to:'0xRecipient',
value:'0x2386f26fc10000',
data:'0x'
}
}
})

Mapping table (v1 input pattern → v2)​

v1 functionpatternv2
getEthereumSignedTransaction① positionalsignTransaction · eip155:N
getTokenSignedTransaction① positionalsignTransaction · eip155 (data=calldata)
getBitcoinSignedTransaction② tx objectsignTransaction · bip122
getXrpSignedTransaction② tx objectsignTransaction · xrpl:0
getTronSignedTransaction② unsignedTxsignTransaction · tron
getTrcTokenSignedTransaction② unsignedTxsignTransaction · tron
getKlaytnSignedTransaction① positionalsignTransaction · Kaia (eip155:8217/slip44:60)
getHederaSignedTransaction② unsignedTxsignTransaction · hedera
getStellarSignedTransaction② unsignedTxsignTransaction · stellar
getCosmosSignedTransaction③ sigHashsignTransaction · cosmos:cosmoshub-4
getTezos/Vechain/Near/Havah/Polkadot/AlgorandSignedTransaction③ sigHashsignTransaction · (network chainId)
getParachainSignedTransaction③ sigHashsignTransaction · (parachain chainId, e.g. Astar)
getEthereumSignedMessage—signMessage · eip155:N
getSignedMessage (coinType)—signMessage · (network chainId)
getHederaSignedMessage—No v2 counterpart — method_not_found (-32601)
getSignedData (per the v1 guide: hex data, e.g. an EIP-712 0x1901… pre-image, hashed and signed)—signTypedData · eip155:N — v2 takes the typed-data JSON (data, version), not the encoded hex
v2 signData (Cardano CIP-8 / CIP-30 / CIP-95) is a new verb with no v1 counterpart