1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use codec::{Decode, Encode};

#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};

use polymesh_api::client::basic_types::IdentityId;

pub type Moment = u64;
pub type AuthorizationNonce = u64;

#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug)]
pub struct TargetIdAuthorization {
  /// Target identity which is authorized to make an operation.
  pub target_id: IdentityId,
  /// It HAS TO be `target_id` authorization nonce: See `Identity::offchain_authorization_nonce`.
  pub nonce: AuthorizationNonce,
  /// Expire timestamp to limit how long the authorization is valid for.
  pub expires_at: Moment,
}