> For the complete documentation index, see [llms.txt](https://docs-legacy.dfns.co/d/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-legacy.dfns.co/d/api-docs/keys/generate-signature/kadena.md).

# Kadena

Kadena supports the following signature `kinds`:

* `PactCommand`, unsigned Pact command.

## PactCommand

Signs an unsigned Pact command.

| Field            | Description                                 | Type - Optional |
| ---------------- | ------------------------------------------- | --------------- |
| `blockchainKind` | `Kadena`                                    | String          |
| `kind`           | `PactCommand`                               | String          |
| `command`        | The Pact command JSON serialized as string. | String          |

```json
{
  "blockchainKind": "Kadena",
  "kind": "PactCommand",
  "command": "{\"payload\":{\"exec\":{\"code\":\"(coin.transfer \\\"k:120ebd7ecf1550ef08b8fa310607af6364f2fdf76b59ba10a50e0f79ad60c528\\\" \\\"k:f2f3065017402cedeedc821b0579bf2bf916c6c8a1f279741403d694e23510e6\\\" 0.000000000001)\",\"data\":{}}},\"nonce\":\"kjs:nonce:1757410106698\",\"signers\":[{\"pubKey\":\"120ebd7ecf1550ef08b8fa310607af6364f2fdf76b59ba10a50e0f79ad60c528\",\"scheme\":\"ED25519\",\"clist\":[{\"name\":\"coin.GAS\",\"args\":[]},{\"name\":\"coin.TRANSFER\",\"args\":[\"k:120ebd7ecf1550ef08b8fa310607af6364f2fdf76b59ba10a50e0f79ad60c528\",\"k:f2f3065017402cedeedc821b0579bf2bf916c6c8a1f279741403d694e23510e6\",{\"decimal\":\"0.000000000001\"}]}]}],\"meta\":{\"gasLimit\":2500,\"gasPrice\":1e-8,\"sender\":\"k:120ebd7ecf1550ef08b8fa310607af6364f2fdf76b59ba10a50e0f79ad60c528\",\"ttl\":28800,\"creationTime\":1757410106,\"chainId\":\"0\"},\"networkId\":\"mainnet01\"}"
}
```

{% hint style="info" %}

* The response only includes the signature. You must package it correctly before submitting the transaction to chain.
* Kadena does not have a deterministic serialized format. The exact serialized string used for signing must be submitted.
  {% endhint %}

### Typescript Example with kadena.js <a href="#typescript-example" id="typescript-example"></a>

```typescript
import {
  Pact,
  readKeyset,
} from '@kadena/client'

const walletId = 'wa-6lbfv-9esgj-88s80c0qsih0a393'
const wallet = await dfnsClient.wallets.getWallet({ walletId })

const myAddress = wallet.address
const myPubKey = wallet.address.split(':')[1]
const toAddress = 'k:b7a3c12dc0c8c748ab07525b701122b88bd78f600c76342d27f25e5f92444cde'
const toPubKey = toAddress.split(':')[1]

// 1 KDA
const pactAmount = { decimal: '1.0' }

// coin contract
const contract = 'coin'

const transferCommand = Pact.builder
  .execution(
    (Pact.modules as any)[contract as 'coin']['transfer-create'](
      senderWallet.address, recipient, readKeyset('ks'), pactAmount)
     )
    .addSigner(myPubKey, (withCapability: any) => [
      withCapability('coin.GAS'),
      withCapability(`${contract as 'coin'}.TRANSFER`, myAddress, toAddress, pactAmount),
    ])
    // add public key of recipient here
    .addKeyset('ks', 'keys-all', toPubKey)
    // set the network Id for the transaction. For testnet use 'testnet04', for mainnet use 'mainnet01'
    .setNetworkId('testnet04')
    // here we set the chainId of the chain we want to broadcast to
    .setMeta({ chainId: '0', senderAccount: myAddress })
    .createTransaction()

const res = await dfnsClient.wallets.generateSignature({
  walletId,
  body: {
    kind: 'PactCommand',
    command: transferCommand.cmd,
  },
})
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs-legacy.dfns.co/d/api-docs/keys/generate-signature/kadena.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
