channelAutorize method

Future<Map<String, dynamic>> channelAutorize(
  1. String channelId,
  2. BigInt amount, {
  3. String? secret,
  4. String? seed,
  5. String? seedHex,
  6. String? passphrase,
  7. CryptoAlgorithm? keyType,
})

The channel_authorize method creates a signature that can be used to redeem a specific amount of XRP from a payment channel. Warning: Do not send secret keys to untrusted servers or through unsecured network connections. (This includes the secret, seed, seed_hex, or passphrase fields of this request.) You should only use this method on a secure, encrypted network connection to a server you run or fully trust with your funds. Otherwise, eavesdroppers could use your secret key to sign claims and take all the money from this payment channel and anything else using the same key pair.

Implementation

/// Warning: Do not send secret keys to untrusted servers or through unsecured network
/// connections. (This includes the secret, seed, seed_hex, or passphrase fields of
/// this request.) You should only use this method on a secure, encrypted network
/// connection to a server you run or fully trust with your funds. Otherwise,
/// eavesdroppers could use your secret key to sign claims and take all the money from
/// this payment channel and anything else using the same key pair.
Future<Map<String, dynamic>> channelAutorize(
  String channelId,
  BigInt amount, {
  String? secret,
  String? seed,
  String? seedHex,
  String? passphrase,
  CryptoAlgorithm? keyType,
}) async {
  final Map<String, dynamic> configParams = {};
  _createRpcConfig(configParams, "channel_id", channelId);
  _createRpcConfig(configParams, "amount", amount.toString());
  _createRpcConfig(configParams, "secret", secret);
  _createRpcConfig(configParams, "seed", seed);
  _createRpcConfig(configParams, "seed_hex", seedHex);
  _createRpcConfig(configParams, "passphrase", passphrase);
  _createRpcConfig(configParams, "key_type", keyType?.value);
  final response = await makeCustomCall<Map<String, dynamic>>(
      "channel_authorize", [configParams]);
  return response;
}