File

src/app/_models/account.ts

Description

Account data interface

Index

Properties

Properties

age
age: string
Type : string
Optional

Age of user

balance
balance: number
Type : number
Optional

Token balance on account

category
category: string
Type : string
Optional

Business category of user.

date_registered
date_registered: number
Type : number

Account registration day

gender
gender: string
Type : string

User's gender

identities
identities: literal type
Type : literal type

Account identifiers

location
location: literal type
Type : literal type

User's location

products
products: string[]
Type : string[]

Products or services provided by user.

type
type: string
Type : string
Optional

Type of account

vcard
vcard: literal type
Type : literal type

Personal identifying information of user

interface AccountDetails {
  /** Account registration day */
  date_registered: number;
  /** User's gender */
  gender: string;
  /** Age of user */
  age?: string;
  /** Type of account */
  type?: string;
  /** Token balance on account */
  balance?: number;
  /** Account identifiers */
  identities: {
    evm: {
      'bloxberg:8996': string[];
      'oldchain:1': string[];
    };
    latitude: number;
    longitude: number;
  };
  /** User's location */
  location: {
    area?: string;
    area_name: string;
    area_type?: string;
  };
  /** Products or services provided by user. */
  products: string[];
  /** Business category of user. */
  category?: string;
  /** Personal identifying information of user */
  vcard: {
    email: [
      {
        value: string;
      }
    ];
    fn: [
      {
        value: string;
      }
    ];
    n: [
      {
        value: string[];
      }
    ];
    tel: [
      {
        meta: {
          TYP: string[];
        };
        value: string;
      }
    ];
    version: [
      {
        value: string;
      }
    ];
  };
}

/** Meta signature interface */
interface Signature {
  /** Algorithm used */
  algo: string;
  /** Data that was signed. */
  data: string;
  /** Message digest */
  digest: string;
  /** Encryption engine used. */
  engine: string;
}

/** Meta object interface */
interface Meta {
  /** Account details */
  data: AccountDetails;
  /** Meta store id */
  id: string;
  /** Signature used during write. */
  signature: Signature;
}

/** Meta response interface */
interface MetaResponse {
  /** Meta store id */
  id: string;
  /** Meta object */
  m: Meta;
}

/** Default account data object */
const defaultAccount: AccountDetails = {
  date_registered: Date.now(),
  gender: 'other',
  identities: {
    evm: {
      'bloxberg:8996': [''],
      'oldchain:1': [''],
    },
    latitude: 0,
    longitude: 0,
  },
  location: {
    area_name: 'Kilifi',
  },
  products: [],
  vcard: {
    email: [
      {
        value: '',
      },
    ],
    fn: [
      {
        value: 'Sarafu Contract',
      },
    ],
    n: [
      {
        value: ['Sarafu', 'Contract'],
      },
    ],
    tel: [
      {
        meta: {
          TYP: [],
        },
        value: '',
      },
    ],
    version: [
      {
        value: '3.0',
      },
    ],
  },
};

/** @exports */
export { AccountDetails, Meta, MetaResponse, Signature, defaultAccount };

result-matching ""

    No results matching ""