# SpliceのDamlの古い型と移り先

> SpliceのDaml modelで非推奨になったテンプレートとchoiceと欄が、DSO delegateの選出とTransferCommandなどのどれで、何に置き換わったかを追います。

- URL: https://cardene.dev/diagrams/canton-splice-deprecated-daml
- 公開日: 2026-11-24
- 更新日: 2026-11-24
- トピック: Blockchain
- タグ: Canton
- 親の図解: [使われなくなったSpliceの支払いと型](https://cardene.dev/diagrams/canton-splice-legacy-payments.md): Splice Walletのtransfer offerとアプリの支払いとサブスクリプションと、SpliceのDamlの古い型が、何に置き換わったかを、章の中の図解で追います。

この頁は、SpliceのDaml modelで、非推奨になったテンプレートとchoiceと欄を追います。
非推奨は、新しく使わない印です。
移り先は、後継の型の物と、代わりの処理の物と、案内されない物に分かれます。

DSO delegateの選出と、`TransferCommand`と、`TransferPreapproval_Send`と、`ValidatorFaucetCoupon`を中心に、何に置き換わったかを書きます。
choiceとcontrollerとsignatoryは、章「Damlのtemplateとchoice」の頁「choiceでコントラクトを変える」が追っています。

https://cardene.dev/diagrams/canton-daml-contract-choice

DSOとAmuletRulesの仕組みは、頁「packageとDSO partyを知る」と頁「Canton Coinの設定を変える」で見ました。

https://cardene.dev/diagrams/canton-splice-packages

https://cardene.dev/diagrams/canton-amulet-config

## 古い型と移り先の一覧

次の表は、この頁が追う、古い型と移り先を並べます。
移り先の欄は、後継の型がある時はその型を、型が無い時は代わりの処理を書きます。

| 古い物 | 置いてあるmodule | 移り先 |
|---|---|---|
| `Amulet`の型 | `Splice.AmuletConfig` | 後継の型として、`Splice.Amulet.Amulet`を直に使う |
| `TransferContextSummary` | `Splice.AmuletRules` | 後継の型は無い。使われておらず、アップグレードの規則のためにまだ消せない |
| `TransferPreapproval_Send` | `Splice.AmuletRules` | 後継のchoiceとして、`TransferPreapproval_SendV2`を使う |
| `TransferCommand` | `Splice.ExternalPartyAmuletRules` | 後継の型は無い。代わりの処理として、Token Standardの送金のAPIを使う |
| `ValidatorFaucetCoupon` | `Splice.ValidatorLicense` | 後継のchoiceとして、`ValidatorLicense_RecordValidatorLivenessActivity`を使う |
| DSO delegateの選出と投票の型 | `Splice.DsoRules` | 代わりの処理として、delegateを使わない自動処理を使う |
| `CRARC_AddFutureAmuletConfigSchedule`と`CRARC_RemoveFutureAmuletConfigSchedule`と`CRARC_UpdateFutureAmuletConfigSchedule` | `Splice.DsoRules` | 後継の操作として、`CRARC_SetConfig`を使う |

次の図Aは、表の5つのmoduleのうち、`Splice.DsoRules`と`Splice.AmuletRules`と`Splice.ExternalPartyAmuletRules`と`Splice.ValidatorLicense`の4つが、何に置き換わったかを追います。
`Splice.AmuletConfig`の`Amulet`の型と、`TransferContextSummary`は、図に入れず、表と次の節で追います。

```dragon
mind 古くなった型とその移り先

step moduleごとの移り先
  say 1段目で、図Aは、4つのmoduleの古い物が、それぞれ別の移り先に置き換わった事を追います。
  idea root as "古くなった型の移り先" [color: slate]
  source CantonのSplice.DsoRules [url: https://docs.canton.network/sdks-tools/api-reference/splice-daml/splice-dso-governance/splice-dsorules]

step delegateを使わない自動処理
  say 2段目で、DSOの規則のmoduleでは、DSO delegateの選出と投票の型が、delegateを使わない自動処理に置き換わりました。
  idea dso as "DSOの規則" of root [color: blue]
  idea auto as "自動処理" of dso [color: blue]
  source CantonのSplice.DsoRules [url: https://docs.canton.network/sdks-tools/api-reference/splice-daml/splice-dso-governance/splice-dsorules]

step 設定を決める操作
  say 3段目で、DSOの規則のmoduleでは、設定の予定を足す、外す、更新する3つの操作が、設定を決める操作に置き換わりました。
  idea cfg as "設定の操作" of dso [color: blue]
  source CantonのSplice.DsoRules [url: https://docs.canton.network/sdks-tools/api-reference/splice-daml/splice-dso-governance/splice-dsorules]

step 送金の規則のmodule
  say 4段目で、Amuletの送金の規則のmoduleでは、送る時のchoiceが、新しい版のchoiceに置き換わりました。
  idea amu as "送金の規則" of root [color: blue]
  idea send as "新しいchoice" of amu [color: blue]
  source CantonのSplice.AmuletRules [url: https://docs.canton.network/sdks-tools/api-reference/splice-daml/splice-amulet/splice-amuletrules]

step 外部partyの規則のmodule
  say 5段目で、外部partyの規則のmoduleでは、送金の委任のテンプレートが、Token Standardの送金のAPIで要らなくなりました。
  idea ext as "外部partyの規則" of root [color: blue]
  idea ts as "送金のAPI" of ext [color: blue]
  source CantonのSplice.ExternalPartyAmuletRules [url: https://docs.canton.network/sdks-tools/api-reference/splice-daml/splice-amulet/splice-externalpartyamuletrules]

step licenseのmodule
  say 6段目で、validatorのlicenseのmoduleでは、validatorの活動の印が、活動を記録するchoiceに置き換わりました。
  idea lic as "licenseの規則" of root [color: blue]
  idea live as "活動の記録" of lic [color: blue]
  source CantonのSplice.ValidatorLicense [url: https://docs.canton.network/sdks-tools/api-reference/splice-daml/splice-amulet/splice-validatorlicense]
```

## 設定と送金の型

`Splice.AmuletConfig`の`Amulet`の型は、料金と量をAmuletの単位で書くための、非推奨の型です。
代わりに、`Splice.Amulet.Amulet`を直に使います。

`TransferContextSummary`は、非推奨で使われていませんが、アップグレードの規則のためにまだ消せません。
欄は、`featuredAppProvider`と、`config`と、`openRound`と、`issuingMiningRounds`と、`validatorRights`です。
`config`は`TransferConfig Amulet`、`openRound`は`OpenMiningRound`の型です。

`TransferPreapproval_Send`は、非推奨で、代わりに`TransferPreapproval_SendV2`を使います。
controllerは`sender`で、`context`と、`inputs`と、`amount`と、`sender`と、`description`を受け取ります。
`context`は`PaymentTransferContext`の型です。

`TransferPreapproval_Send`は、`TransferPreapproval_SendResult`を返し、その欄は`result`と、省略できる`meta`です。

事前承認の`TransferPreapproval`は、頁「受け手が前もって受け取りを許す」で見ました。

https://cardene.dev/diagrams/canton-transfer-preapproval

## TransferCommandはToken Standardで要らなくなった

`TransferCommand`のテンプレートは、非推奨です。
Token Standardの送金のAPIは、準備から署名まで24時間の間隔を扱えるようになったので、`TransferCommand`はもう要りません。
代わりの処理は、Token Standardの送金のAPIで、後継のテンプレートではありません。

`TransferCommand`は、与えた量を与えた受け手へ送る送金を実行する、1回限りの委任で、signatoryは`sender`と`dso`です。
次の図Bは、旧方式の`TransferCommand`が、nonceを読む材料から、送金を委任し、実行され、期限切れか取り下げで終わるまでを追います。
図Bの段4は、引数`p`で指定したpartyが、段5は、送り手が、それぞれ操作する段で、後の表のcontrollerと対応します。

```dragon
sequence 旧方式のTransferCommandが送金を委任して終わるまで

box Mat as nonceの材料 [note: 送った数と処理中の送金, color: slate, icon: db]
box Send as 送り手 [note: 送金を委任する, color: blue, icon: user]
box Dele as 送金を任されたparty [note: 期限までに送る, color: rose, icon: user]
box Exp as 指定されたparty [note: 期限切れにする, color: coin, icon: user]

step nonceを見積もる
  say 1段目で、次に使うnonceは、送った数の記録と処理中の送金のコントラクトの両方から見積もれます。
  act Mat: nonceの材料
  source CantonのSplice.ExternalPartyAmuletRules [url: https://docs.canton.network/sdks-tools/api-reference/splice-daml/splice-amulet/splice-externalpartyamuletrules]

step 送金を委任する
  say 2段目で、送り手が、受け手と量とnonceと期限を決めて、送金の委任のコントラクトを作り、送金を任されたpartyを決めます。
  act Send: 送金を委任する
  source CantonのSplice.ExternalPartyAmuletRules [url: https://docs.canton.network/sdks-tools/api-reference/splice-daml/splice-amulet/splice-externalpartyamuletrules]

step 期限までに送る
  say 3段目で、送金を任されたpartyが、期限までに送金を実行するchoiceを呼ぶと、失敗の理由か送金の結果が返ります。
  act Dele: 期限までに送る
  source CantonのSplice.ExternalPartyAmuletRules [url: https://docs.canton.network/sdks-tools/api-reference/splice-daml/splice-amulet/splice-externalpartyamuletrules]

step 期限切れにする
  say 4段目で、引数で指定したpartyが、期限切れにするchoiceを実行して、送金を送らないまま終えます。
  act Exp: 期限切れにする
  source CantonのSplice.ExternalPartyAmuletRules [url: https://docs.canton.network/sdks-tools/api-reference/splice-daml/splice-amulet/splice-externalpartyamuletrules]

step 取り下げる
  say 5段目で、送り手が、取り下げるchoiceを実行して、送金を送らないまま終えます。
  act Send: 取り下げる
  source CantonのSplice.ExternalPartyAmuletRules [url: https://docs.canton.network/sdks-tools/api-reference/splice-daml/splice-amulet/splice-externalpartyamuletrules]
```

`TransferCommand`の欄は、次の表の8つです。

| 欄 | 中身 |
|---|---|
| `dso` | DSOのparty |
| `sender` | 送り手 |
| `receiver` | 受け手 |
| `delegate` | 送金を実際に行うparty |
| `amount` | 送る量 |
| `expiresAt` | `TransferCommand_Send`を呼ぶべき期限 |
| `nonce` | 並んで走る送金を並べて、重複を除くために期待する値。0から始まる |
| `description` | 省略できる説明 |

`nonce`の次に使う値は、`TransferCommandCounter`と、処理中の`TransferCommand`のコントラクトの両方から読めます。

`TransferCommand`の`Archive`のcontrollerは、`sender`と`dso`です。

| choice | controller | 受け取る物 | 返す物 |
|---|---|---|---|
| `TransferCommand_Send` | `delegate` | `context`と`inputs`と`transferPreapprovalCidO`と`transferCounterCid` | 欄`result`と`sender`と`nonce` |
| `TransferCommand_Expire` | 引数`p`のParty | `p` | 欄`sender`と`nonce` |
| `TransferCommand_Withdraw` | `sender` | 引数を取らない | 欄`sender`と`nonce` |

`TransferCommand_Send`の`context`は`PaymentTransferContext`、`inputs`は`TransferInput`のリスト、`transferPreapprovalCidO`は省略できる`TransferPreapproval`のコントラクトID、`transferCounterCid`は`TransferCommandCounter`のコントラクトIDです。
`result`は`TransferCommandResult`の値です。

`TransferCommandResult`は、2つの形を持つ型です。
失敗の理由`reason`を持つ`TransferCommandResultFailure`か、`TransferResult`の値`result`を持つ`TransferCommandResultSuccess`です。
`reason`は`InvalidTransferReason`の型です。

`TransferCommandCounter`のテンプレートは、送り手ごとに完了した`TransferCommand`の数を追い、重複を除くために`TransferCommand`で使うnonceを決めるのに使います。
signatoryは`dso`で、欄は`dso`と`sender`と`nextNonce`です。
`TransferCommandCounter`の`Archive`のcontrollerは、`dso`です。

## ValidatorFaucetCouponは活動の記録に移った

`ValidatorFaucetCoupon`は、非推奨のテンプレートです。
代わりに、`ValidatorLicense_RecordValidatorLivenessActivity`のchoiceを使います。
このchoiceが作る`ValidatorLivenessActivityRecord`は、`ValidatorFaucetCoupon`の写しで、validatorがsignatoryでなくobserverである点だけが違います。

そのため、validatorの確認なしに、validatorの活動の記録を期限切れにできます。
`ValidatorFaucetCoupon`の方は、validatorがsignatoryなので、期限切れにするにはvalidatorノードの確認が要ります。

`ValidatorFaucetCoupon`のsignatoryは`dso`と`validator`で、欄は`dso`と`validator`と`round`です。
`dso`がcontrollerで、`closedRoundCid`を受け取るchoice`ValidatorFaucetCoupon_DsoExpire`を持ちます。

validatorの活動の記録は、頁「licenseで活動を報告する」で見ました。

https://cardene.dev/diagrams/canton-validator-license

## DSO delegateの選出は自動処理に置き換わった

`DsoRules`の欄`dsoDelegate`は、非推奨で、delegateを使わない自動処理に置き換えられました。
資料は、この自動処理をdelegateless automationと呼びます。
`DsoRulesConfig`の欄`dsoDelegateInactiveTimeout`は、DSO delegateが受け持つ操作を終えるまでに与える時間で、同じく置き換えられて非推奨になりました。

次の表は、選出に使った、`Splice.DsoRules`の古い型を並べます。

| 型 | 中身 |
|---|---|
| `ElectionRequest`のテンプレート | 新しいDSO delegateを選ぶ要求で、非推奨。signatoryは`dso`で、欄は`dso`と`requester`と`epoch`と`reason`と`ranking`。choiceは`Archive`だけ |
| `DsoRules_RequestElection` | controllerは`requester`で、`requester`と`reason`と`ranking`を受け取り、`DsoRules_RequestElectionResult`を返す。結果は、作った`ElectionRequest`のコントラクトIDを、欄`electionRequestCid`に持つ |
| `DsoRules_ElectDsoDelegate` | controllerは`actor`で、`actor`と`requestCids`を受け取り、`DsoRules_ElectDsoDelegateResult`を返す。結果は、delegateを選んだ後の`DsoRules`のコントラクトIDを、欄`newDsoRules`に持つ |
| `DsoRules_ArchiveOutdatedElectionRequest` | controllerは`sv`で、`requestCid`と`sv`を受け取り、`DsoRules_ArchiveOutdatedElectionRequestResult`を返す |
| `ElectionRequestReason` | 非推奨。コンストラクタは`ERR_DsoDelegateUnavailable`と、`ERR_OtherReason`と、拡張用の`ExtElectionRequestReason` |

`ElectionRequest`の`epoch`は`Int`、`reason`は`ElectionRequestReason`、`ranking`はPartyのリストです。
`requestCids`は`ElectionRequest`のコントラクトIDのリスト、`requestCid`は`ElectionRequest`のコントラクトID、`sv`は省略できるPartyです。
`ERR_OtherReason`は`Text`を持ち、`ExtElectionRequestReason`は欄`dummyUnitField`を持ちます。

`VotingState a`は、投票の集計中の状態を持つデータ型で、instant-runoff votingを実装する関数が使い、同じく置き換えられて非推奨になりました。
instant-runoff votingは、候補に順位を付けて投票し、候補が外れるたびに、その票を、まだ残る候補のうち最上位へ移して数える投票の方式です。
欄は、`rankings`と、`loosers`です。

`rankings`は、候補と、その候補が外れた時に残る順位を結ぶ`Map`で、`loosers`は、外れた候補を持つ`Set`です。
外れた候補を明示して遅れて外すのは、残る順位をすぐに絞ると、計算量が3次になるのを避けるためです。

## 設定の予定の操作は設定を決める操作に移った

`AmuletRules_ActionRequiringConfirmation`の`CRARC_AddFutureAmuletConfigSchedule`と、`CRARC_RemoveFutureAmuletConfigSchedule`と、`CRARC_UpdateFutureAmuletConfigSchedule`は、`AmuletRules`の設定の予定を足す、外す、更新する、投票で決める操作です。
この3つは非推奨になり、代わりに`CRARC_SetConfig`を使います。

## 出典

https://docs.canton.network/sdks-tools/api-reference/splice-daml/splice-amulet/splice-amuletconfig

https://docs.canton.network/sdks-tools/api-reference/splice-daml/splice-amulet/splice-amuletrules

https://docs.canton.network/sdks-tools/api-reference/splice-daml/splice-amulet/splice-externalpartyamuletrules

https://docs.canton.network/sdks-tools/api-reference/splice-daml/splice-amulet/splice-validatorlicense

https://docs.canton.network/sdks-tools/api-reference/splice-daml/splice-dso-governance/splice-dsorules
