Skip to main content

Sign API — per-coin functions → sign()

Every v1 getXxxSignedTransaction / getXxxSignedMessage becomes one sign() call. 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. You do still build the signing payload yourself on the payload-building families — XRPL / Xahau (tx_json; structured-first, with a blind-sign fallback), Stellar ({xdr}), Hedera (unsignedTx), Polkadot (extra.scaleHex), and Solana (completed serialized tx).

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
getCosmosSignedTransaction③ sigHashsignTransaction · cosmos:cosmoshub-4
getTezos/Vechain/Near/Havah/Polkadot/AlgorandSignedTransaction③ sigHashsignTransaction · (network chainId)
getEthereumSignedMessagesignMessage · eip155:N
getSignedData (EIP-712 typed data)signTypedData · eip155:N