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

# signatureSubscribe

> 指定されたコミットメントレベルにトランザクションが到達したときに通知を受けるためにサブスクライブします。

これは単一の通知へのサブスクリプションです。通知、`signatureNotification`がRPCによって送信されるとサーバーによって自動的にキャンセルされます。

## エンドポイント

Websocketsは次のURLでmainnetおよびdevnetで利用可能です:

* **Mainnet** `wss://mainnet.helius-rpc.com/?api-key=<api-key>`
* **Devnet** `wss://devnet.helius-rpc.com/?api-key=<api-key>`

<Note>Websocketsには10分の非アクティビティタイマーがあります。Websocket接続を維持するためにヘルスチェックを実装し、毎分pingを送信することを強くお勧めします。</Note>

## 認証

<ParamField query="api-key" type="string" required>
  あなたのHelius APIキー。無料で[ダッシュボード](https://dashboard.helius.dev/api-keys)で取得できます。
</ParamField>

## 本文

<ParamField body="params" type="array" required>
  <Expandable title="properties" defaultOpen>
    <ParamField body="signature" type="string" required>
      トランザクションの署名（base-58エンコードされた文字列）。

      トランザクション署名は、トランザクションからの最初の署名でなければなりません（詳細はトランザクションIDを参照）。
    </ParamField>

    <ParamField body="config" type="object">
      以下のフィールドを含む設定オブジェクト:

      <ParamField body="commitment" type="string">
        サブスクリプションのコミットメントレベル。`finalized`、`confirmed`、または`processed`のいずれかです。
      </ParamField>

      <ParamField body="enableReceivedNotification" type="boolean">
        トランザクション署名が受信されたときに通知を送信するかどうか。
      </ParamField>
    </ParamField>
  </Expandable>
</ParamField>

## レスポンス

<ResponseField name="result" type="integer">
  サブスクリプションID（購読解除に必要）
</ResponseField>

## 通知フォーマット

通知は、次を含むオブジェクトの値を持つRpcResponse JSONオブジェクトです:

* `slot: <u64>` - 対応するスロット。
* `value: <object|string>` - RpcSignatureResultの通知値、結果は次のいずれかになります:
  * `enableReceivedNotification`が`true`で署名が受信された場合: リテラル文字列`"receivedSignature"`、または
  * 署名が処理された場合: `err: <object|null>`:
    * 指定されたコミットメントレベルでトランザクションが正常に処理された場合は`null`、または
    * トランザクションが失敗した場合はTransactionError。

<RequestExample>
  ```json Request theme={"system"}
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "signatureSubscribe",
    "params": [
      "2EBVM6cB8vAAD93Ktr6Vd8p67XPbQzCJX47MpReuiCXJAtcjaxpvWpcg9Ege1Nr5Tk3a2GFrByT7WPBjdsTycY9b",
      {
        "commitment": "finalized",
        "enableReceivedNotification": false
      }
    ]
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={"system"}
  {
    "jsonrpc": "2.0",
    "result": 0,
    "id": 1
  }
  ```

  ```json Notification (Processed Transaction) theme={"system"}
  {
    "jsonrpc": "2.0",
    "method": "signatureNotification",
    "params": {
      "result": {
        "context": {
          "slot": 5207624
        },
        "value": {
          "err": null
        }
      },
      "subscription": 24006
    }
  }
  ```

  ```json Notification (Received Transaction) theme={"system"}
  {
    "jsonrpc": "2.0",
    "method": "signatureNotification",
    "params": {
      "result": {
        "context": {
          "slot": 5207624
        },
        "value": "receivedSignature"
      },
      "subscription": 24006
    }
  }
  ```
</ResponseExample>
