2025-02-12 03:41:50 -05:00
|
|
|
use zeroize::Zeroize;
|
|
|
|
|
|
|
|
|
|
use borsh::{BorshSerialize, BorshDeserialize};
|
|
|
|
|
|
|
|
|
|
use crate::{address::ExternalAddress, balance::ExternalBalance};
|
|
|
|
|
|
|
|
|
|
/// An instruction on how to transfer coins out.
|
|
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Zeroize, BorshSerialize, BorshDeserialize)]
|
2025-03-06 05:53:18 -05:00
|
|
|
#[cfg_attr(
|
|
|
|
|
feature = "non_canonical_scale_derivations",
|
2025-09-05 13:56:13 -04:00
|
|
|
derive(scale::Encode, scale::Decode, scale::MaxEncodedLen, scale::DecodeWithMemTracking)
|
2025-03-06 05:53:18 -05:00
|
|
|
)]
|
2025-09-01 20:02:48 -04:00
|
|
|
#[cfg_attr(feature = "non_canonical_scale_derivations", allow(clippy::cast_possible_truncation))]
|
2025-02-12 03:41:50 -05:00
|
|
|
pub enum OutInstruction {
|
|
|
|
|
/// Transfer to the specified address.
|
|
|
|
|
Transfer(ExternalAddress),
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// An instruction on how to transfer coins out with the balance to use for the transfer out.
|
|
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Zeroize, BorshSerialize, BorshDeserialize)]
|
2025-03-06 05:53:18 -05:00
|
|
|
#[cfg_attr(
|
|
|
|
|
feature = "non_canonical_scale_derivations",
|
2025-09-05 13:56:13 -04:00
|
|
|
derive(scale::Encode, scale::Decode, scale::MaxEncodedLen, scale::DecodeWithMemTracking)
|
2025-03-06 05:53:18 -05:00
|
|
|
)]
|
2025-02-12 03:41:50 -05:00
|
|
|
pub struct OutInstructionWithBalance {
|
|
|
|
|
/// The instruction on how to transfer coins out.
|
|
|
|
|
pub instruction: OutInstruction,
|
|
|
|
|
/// The balance to use for the transfer out.
|
|
|
|
|
pub balance: ExternalBalance,
|
|
|
|
|
}
|