> ## 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.

# Algorand

> Reference for the Algorand transaction payload used with the Dfns sign and sign-and-broadcast endpoints, including required and optional fields.

## `Transaction`

The following payload can be used with the
[Sign](/api-reference/keys/generate-signature) and
[Sign and Broadcast](/api-reference/wallets/sign-and-broadcast-transaction) endpoints.

| Field         | Description                                                                                                                        | Type - Optional     |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ------------------- |
| `kind`        | `Transaction`                                                                                                                      | String              |
| `transaction` | The unsigned hex encoded transaction as shown below.                                                                               | String              |
| `externalId`  | A unique ID from your system. It can be leveraged to be used as an idempotency key (read more [here](/api-reference/idempotency)). | String *(optional)* |

```json theme={null}
{
  "kind": "Transaction",
  "transaction": "0x81a374786e89a3616d74cd2710a3666565cd03e8a26676ce02340f13a367656eac746573746e65742d76312e30a26768c4204863b518a4b3c84ec810f22d4f1081cb0f71f059a7ac20dec62f7f70e5093a22a26c76ce023412fba3726376c4201256a859b39429ee178e0a65056fb33d51c5139044f6a2603c144278010c7684a3736e64c4201256a859b39429ee178e0a65056fb33d51c5139044f6a2603c144278010c7684a474797065a3706179"
}
```

### Typescript Example with AlgoSDK

First install the AlgoSDK. You can find the full documentation here: [https://github.com/algorand/js-algorand-sdk](https://github.com/algorand/js-algorand-sdk)

Here a code sample to broadcast a transaction via [the Dfns TypeScript SDK](https://github.com/dfns/dfns-sdk-ts):

```typescript theme={null}
import { Algodv2, encodeObj, makePaymentTxnWithSuggestedParamsFromObject } from 'algosdk'

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

const algod = new Algodv2(ALGORAND_TOKEN, ALGORAND_NODE_URL)

const suggestedParams = await algod.getTransactionParams().do()
const transaction = makePaymentTxnWithSuggestedParamsFromObject({
  from: wallet.address,
  suggestedParams,
  to: 'CJLKQWNTSQU64F4OBJSQK35THVI4KE4QIT3KEYB4CRBHQAIMO2CD6JWBCY',
  amount: 10000,
})

const bytes = encodeObj({ txn: transaction.get_obj_for_encoding() })

const res = await dfnsClient.wallets.broadcastTransaction({
  walletId,
  body: {
    kind: 'Transaction',
    transaction: `0x${Buffer.from(bytes).toString('hex')}`,
  },
})
```

## Complete examples

For complete working examples, see the SDK examples on GitHub:

* [Basic transaction](https://github.com/dfns/dfns-sdk-ts/tree/m/examples/libs/algorand/basic-tx) - Simple payment transaction
* [Asset transaction](https://github.com/dfns/dfns-sdk-ts/tree/m/examples/libs/algorand/asset-tx) - Algorand Standard Asset (ASA) transfers
* [Multisig transaction](https://github.com/dfns/dfns-sdk-ts/tree/m/examples/libs/algorand/multisig-tx) - Multi-signature transactions
