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

# 消息与交易签名

> 签署消息或 PSBT，区分签名与广播。

示例使用 `createArksatClient(provider)`。

## signMessage

返回十六进制签名。默认使用 ecdsa、utf8。不要 trim 登录挑战，也不要修改原始换行。

**参数**

```ts theme={null}
{ message: string; type?: 'ecdsa' | 'schnorr'; encoding?: 'utf8' | 'hex' } & ArksatSessionGuard
```

**返回**

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

**示例**

```ts theme={null}
const { signature } = await client.signMessage({ message, type: 'schnorr', encoding: 'utf8' })
```

## signTransaction

签署一笔 PSBT，不广播交易。

**参数**

```ts theme={null}
{ psbtBase64: string; inputIndexes?: number[] } & ArksatSessionGuard
```

**返回**

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

**示例**

```ts theme={null}
const signed = await client.signTransaction({ psbtBase64 })
```

## signTransactions

批量签署 PSBT，结果顺序与请求对应，不广播。

**参数**

```ts theme={null}
{ transactions: ArksatSignTransactionParams[] } & ArksatSessionGuard
```

**返回**

```ts theme={null}
Promise<{ transactions: { psbtBase64: string }[] }>
```

**示例**

```ts theme={null}
const signed = await client.signTransactions({ transactions: [{ psbtBase64 }] })
```

## 调用说明

示例中的 `message`、`psbtBase64` 由应用准备。钱包展示签名确认，用户可拒绝。Provider 原始签名结果为字符串或字符串数组；Client 包装为具名对象。

[错误处理](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.