pub fn deposit_preauth_keylet(
account: &AccountID,
authorize: &AccountID,
) -> Result<KeyletBytes>Expand description
Generates a deposit preauth keylet for a given account and authorized account.
A deposit preauth keylet is used to reference deposit preauth entries in the XRP Ledger.
§Arguments
account- The AccountID of the account that is doing the pre-authorizingauthorize- The AccountID of the account that is pre-authorizing
§Returns
Result<KeyletBytes>- On success, returns a 32-byte deposit preauth keylet. On failure, returns anErrorwith the corresponding error code.
§Safety
This function makes unsafe FFI calls to the host environment through
the host::deposit_preauth_keylet function.
§Example
use xrpl_wasm_stdlib::core::types::account_id::AccountID;
use xrpl_wasm_stdlib::core::keylets::deposit_preauth_keylet;
use xrpl_wasm_stdlib::host::trace::{DataRepr, trace_data, trace_num};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let account: AccountID =
AccountID::from(*b"\xd5\xb9\x84VP\x9f \xb5'\x9d\x1eJ.\xe8\xb2\xaa\x82\xaec\xe3");
let authorize: AccountID =
AccountID::from(*b"\xd5\xb9\x84VP\x9f \xb5'\x9d\x1eJ.\xe8\xb2\xaa\x82\xaec\xe3");
match deposit_preauth_keylet(&account, &authorize) {
xrpl_wasm_stdlib::host::Result::Ok(keylet) => {
let _ = trace_data("Generated keylet", &keylet, DataRepr::AsHex);
}
xrpl_wasm_stdlib::host::Result::Err(e) => {
let _ = trace_num("Error assembling keylet", e.code() as i64);
}
}
Ok(())
}