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 function | pattern | v2 |
|---|---|---|
getEthereumSignedTransaction | ① positional | signTransaction · eip155:N |
getTokenSignedTransaction | ① positional | signTransaction · eip155 (data=calldata) |
getBitcoinSignedTransaction | ② tx object | signTransaction · bip122 |
getXrpSignedTransaction | ② tx object | signTransaction · xrpl:0 |
getTronSignedTransaction | ② unsignedTx | signTransaction · tron |
getCosmosSignedTransaction | ③ sigHash | signTransaction · cosmos:cosmoshub-4 |
getTezos/Vechain/Near/Havah/Polkadot/AlgorandSignedTransaction | ③ sigHash | signTransaction · (network chainId) |
getEthereumSignedMessage | — | signMessage · eip155:N |
getSignedData (EIP-712 typed data) | — | signTypedData · eip155:N |