pub async fn int_update_supply_exchange_rate(
supply_id: SupplyId,
exchange_rate: u256
) -> Response<SupplyId>
Expand description
Updates the exchange rate.
It cancels the existing supply and creates a new one to prevent fraud.
§Parameters
supply_id
: Unique identifier for the supply.exchange_rate
: Exchange rate. Is later divided by decimalPointer.
§Result
tx_id
: Id of the transaction.data
: Id of the new supply.
§Sample request
SUPPLY_ID=8_251_471_539_482_211_562_355_238_650_337_652_682_089_590_676_002_818_286_951_709_100_188_048_031_745
SUP_EX_RATE_NEW=2000000000000000000000000000000000000
dfx canister call coreledger_backend int_update_supply_exchange_rate "($SUPPLY_ID, $SUP_EX_RATE_NEW)"
§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
data = 8_251_471_539_482_211_562_355_238_650_337_652_682_089_590_676_002_818_286_951_709_100_188_048_031_746 : nat;
})