Documentation Index
Fetch the complete documentation index at: https://docs.dfns.co/llms.txt
Use this file to discover all available pages before exploring further.
Hedera supports the following signature kinds:
Transaction, unsigned Hedera or EVM transaction.
Transaction
Signs an unsigned transaction.
| Field | Description | Type - Optional |
blockchainKind | Hedera | String |
kind | Transaction | String |
transaction | The unsigned hex encoded transaction as shown below. | String |
{
"blockchainKind": "Hedera",
"kind": "Transaction",
"transaction": "0x0a6c2a6a0a660a1a0a0b08f6f89fc80610ecf1bf1912090800100018c7b1a303180012060800100018051880c2d72f22020878320072350a330a200a1a0800100022140c78f5e80fe0107ba1ab52048b4b2053ee948611100218000a0f0a090800100018c7b1a303100118001200"
}
Typescript Example with Hiero JavaScript SDK
First install the Hiero JavaScript SDK. You can find the full documentation here: https://github.com/hiero-ledger/hiero-sdk-js
Here a code sample to generate a signature via the Dfns TypeScript SDK:
import { Hbar, TransferTransaction } from '@hashgraph/sdk'
const walletId = 'wa-172um-hgi5f-xxxxxxxxxxxxxxxx'
const wallet = await dfnsClient.wallets.getWallet({ walletId })
const recipient = '0x956fbb0c88b3c597d4afdbab3e26939051ff6725'
const client = Client.forMainnet()
const transaction = await new TransferTransaction()
.addHbarTransfer(recipient, Hbar.fromTinybars(1))
.addHbarTransfer(wallet.address!, Hbar.fromTinybars(-1))
.freezeWith(client)
const res = await dfnsClient.wallets.generateSignature({
walletId,
body: {
kind: 'Transaction',
transaction: `0x${Buffer.from(transaction.toBytes()).toString('hex')}`,
},
})