pub async fn led_kyc_set_usage_controller(
    ledger_contract_id: ContractId,
    asset_id: AssetId,
    controller_contract_id: ContractId
) -> Response
Expand description

The usage controller has a whitelist and blacklist and allows to govern the asset.

This function can only set or replace the usage controller but not remove it.

§Parameters

  • ledger_contract_id: Contract id of the ledger.
  • asset_id: The target asset ID for which the controller has to be set.
  • controller_id: The controller contract id. It is validated by the integration contract before it can be added.

§Result

  • tx_id: Id of the transaction.

§Sample request

LEDGER_CONTRACT_ID=1_376_994_832_725_996_537_612_682_825_051_864_610_558_585_037_795
ASSET_ID=0xF94E2AD9DD5CBBC04143
CONTROLLER_ID=706_061_983_514_303_969_782_027_186_938_462_951_048_586_994_629

dfx canister call coreledger_backend led_kyc_set_usage_controller "($LEDGER_CONTRACT_ID, $ASSET_ID, $CONTROLLER_ID)"

§Sample response

( record {
  tx_id = 64_902_045_878_680_215_161_103_406_576_570_366_475_824_533_393_005_533_149_888_825_789_042_550_227_580 : nat
})