> ## Documentation Index
> Fetch the complete documentation index at: https://docs.arksat.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# 发送与兑换出资

> 发送 BTC、代币或提交兑换出资。

示例使用 `createArksatClient(provider)`。

## sendToAddress

amount 为 sats 整数。操作会请求用户确认。

**参数**

```ts theme={null}
{ address: string; amount: number }
```

**返回**

```ts theme={null}
Promise<{ txid: string }>
```

**示例**

```ts theme={null}
const { txid } = await client.sendToAddress({ address, amount: 1000 })
```

## sendAsset

assets 中每项含 assetId 和最小单位字符串 amount；bitcoinAmount 为随交易发送的 BTC 数量（sats），不是手续费。

**参数**

```ts theme={null}
{ address: string; assets: ArksatAssetTransfer[]; bitcoinAmount?: number }
```

**返回**

```ts theme={null}
Promise<{ txid: string }>
```

**示例**

```ts theme={null}
const { txid } = await client.sendAsset({ address, assets: [{ assetId, amount: '100' }] })
```

## sendSwapFunding

面向兑换协议集成的出资方法。需要地址、资产、BTC 数量和协议扩展，不会自动为网站获取报价。Swap 当前仅在测试网开放。

**参数**

```ts theme={null}
ArksatSwapFundingParams
```

**返回**

```ts theme={null}
Promise<{ txid: string }>
```

**示例**

```ts theme={null}
const { txid } = await client.sendSwapFunding(fundingParams)
```

## 兑换出资参数

| 字段 | 类型 | 说明 |
| - | - | - |
| address | string | 接收地址 |
| assets | ArksatAssetTransfer\[] | 最小单位的资产数量 |
| bitcoinAmount | number | sats 整数 |
| extension | `{ type: number; payload: string }` | 兑换协议扩展 |
| timingId | string，可选 | 诊断关联标识 |
| expectedAddress / expectedNetwork / expectedSessionId | 可选 | 预期会话 |

发送失败或超时后先查询记录，避免重复付款。[发送接入指南](https://docs.arksat.xyz/transfers.md)。

[错误处理](https://docs.arksat.xyz/errors.md) · [完整 TypeScript 类型](https://docs.arksat.xyz/reference/types.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.