2021-05-12 08:40:21 +02:00
|
|
|
/** Account data interface */
|
2021-04-29 19:10:39 +02:00
|
|
|
interface AccountDetails {
|
2021-05-12 09:52:28 +02:00
|
|
|
/** Age of user */
|
2021-03-14 09:20:48 +01:00
|
|
|
age?: string;
|
2021-05-12 09:52:28 +02:00
|
|
|
/** Token balance on account */
|
2021-04-29 19:10:39 +02:00
|
|
|
balance?: number;
|
2021-05-13 09:13:51 +02:00
|
|
|
/** Business category of user. */
|
|
|
|
category?: string;
|
|
|
|
/** Account registration day */
|
|
|
|
date_registered: number;
|
|
|
|
/** User's gender */
|
|
|
|
gender: string;
|
2021-05-12 09:52:28 +02:00
|
|
|
/** Account identifiers */
|
2021-03-02 08:29:14 +01:00
|
|
|
identities: {
|
|
|
|
evm: {
|
|
|
|
'bloxberg:8996': string[];
|
|
|
|
'oldchain:1': string[];
|
2021-03-06 07:28:29 +01:00
|
|
|
};
|
|
|
|
latitude: number;
|
|
|
|
longitude: number;
|
2021-03-02 08:29:14 +01:00
|
|
|
};
|
2021-05-12 09:52:28 +02:00
|
|
|
/** User's location */
|
2021-03-02 08:29:14 +01:00
|
|
|
location: {
|
2021-03-14 09:20:48 +01:00
|
|
|
area?: string;
|
2021-03-02 08:29:14 +01:00
|
|
|
area_name: string;
|
2021-03-14 09:20:48 +01:00
|
|
|
area_type?: string;
|
2021-03-02 08:29:14 +01:00
|
|
|
};
|
2021-05-12 09:52:28 +02:00
|
|
|
/** Products or services provided by user. */
|
2021-03-02 08:29:14 +01:00
|
|
|
products: string[];
|
2021-05-13 09:13:51 +02:00
|
|
|
/** Type of account */
|
|
|
|
type?: string;
|
2021-05-12 09:52:28 +02:00
|
|
|
/** Personal identifying information of user */
|
2021-03-02 08:29:14 +01:00
|
|
|
vcard: {
|
2021-05-10 18:15:25 +02:00
|
|
|
email: [
|
|
|
|
{
|
|
|
|
value: string;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
fn: [
|
|
|
|
{
|
|
|
|
value: string;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
n: [
|
|
|
|
{
|
|
|
|
value: string[];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
tel: [
|
|
|
|
{
|
|
|
|
meta: {
|
|
|
|
TYP: string[];
|
|
|
|
};
|
|
|
|
value: string;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
version: [
|
|
|
|
{
|
|
|
|
value: string;
|
|
|
|
}
|
|
|
|
];
|
2021-03-02 08:29:14 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2021-05-12 08:40:21 +02:00
|
|
|
/** Meta signature interface */
|
2021-04-29 19:10:39 +02:00
|
|
|
interface Signature {
|
2021-05-12 09:52:28 +02:00
|
|
|
/** Algorithm used */
|
2021-03-02 08:29:14 +01:00
|
|
|
algo: string;
|
2021-05-12 09:52:28 +02:00
|
|
|
/** Data that was signed. */
|
2021-03-02 08:29:14 +01:00
|
|
|
data: string;
|
2021-05-12 09:52:28 +02:00
|
|
|
/** Message digest */
|
2021-03-02 08:29:14 +01:00
|
|
|
digest: string;
|
2021-05-12 09:52:28 +02:00
|
|
|
/** Encryption engine used. */
|
2021-03-02 08:29:14 +01:00
|
|
|
engine: string;
|
|
|
|
}
|
|
|
|
|
2021-05-12 08:40:21 +02:00
|
|
|
/** Meta object interface */
|
2021-04-29 19:10:39 +02:00
|
|
|
interface Meta {
|
2021-05-12 09:52:28 +02:00
|
|
|
/** Account details */
|
2021-03-02 08:29:14 +01:00
|
|
|
data: AccountDetails;
|
2021-05-12 09:52:28 +02:00
|
|
|
/** Meta store id */
|
2021-03-02 08:29:14 +01:00
|
|
|
id: string;
|
2021-05-12 09:52:28 +02:00
|
|
|
/** Signature used during write. */
|
2021-03-02 08:29:14 +01:00
|
|
|
signature: Signature;
|
|
|
|
}
|
|
|
|
|
2021-05-12 08:40:21 +02:00
|
|
|
/** Meta response interface */
|
2021-04-29 19:10:39 +02:00
|
|
|
interface MetaResponse {
|
2021-05-12 09:52:28 +02:00
|
|
|
/** Meta store id */
|
2021-03-02 08:29:14 +01:00
|
|
|
id: string;
|
2021-05-12 09:52:28 +02:00
|
|
|
/** Meta object */
|
2021-03-02 08:29:14 +01:00
|
|
|
m: Meta;
|
|
|
|
}
|
2021-03-10 10:47:01 +01:00
|
|
|
|
2021-05-12 08:40:21 +02:00
|
|
|
/** Default account data object */
|
2021-04-29 19:10:39 +02:00
|
|
|
const defaultAccount: AccountDetails = {
|
2021-03-10 10:47:01 +01:00
|
|
|
date_registered: Date.now(),
|
|
|
|
gender: 'other',
|
|
|
|
identities: {
|
|
|
|
evm: {
|
|
|
|
'bloxberg:8996': [''],
|
|
|
|
'oldchain:1': [''],
|
|
|
|
},
|
|
|
|
latitude: 0,
|
|
|
|
longitude: 0,
|
|
|
|
},
|
|
|
|
location: {
|
|
|
|
area_name: 'Kilifi',
|
|
|
|
},
|
|
|
|
products: [],
|
|
|
|
vcard: {
|
2021-05-10 18:15:25 +02:00
|
|
|
email: [
|
|
|
|
{
|
|
|
|
value: '',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
fn: [
|
|
|
|
{
|
|
|
|
value: 'Sarafu Contract',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
n: [
|
|
|
|
{
|
|
|
|
value: ['Sarafu', 'Contract'],
|
2021-03-10 10:47:01 +01:00
|
|
|
},
|
2021-05-10 18:15:25 +02:00
|
|
|
],
|
|
|
|
tel: [
|
|
|
|
{
|
|
|
|
meta: {
|
|
|
|
TYP: [],
|
|
|
|
},
|
2021-06-23 09:18:28 +02:00
|
|
|
value: '+254700000000',
|
2021-05-10 18:15:25 +02:00
|
|
|
},
|
|
|
|
],
|
|
|
|
version: [
|
|
|
|
{
|
|
|
|
value: '3.0',
|
|
|
|
},
|
|
|
|
],
|
2021-03-10 10:47:01 +01:00
|
|
|
},
|
|
|
|
};
|
2021-04-29 19:10:39 +02:00
|
|
|
|
2021-05-12 08:40:21 +02:00
|
|
|
/** @exports */
|
|
|
|
export { AccountDetails, Meta, MetaResponse, Signature, defaultAccount };
|