3184 lines
124 KiB
HTML
3184 lines
124 KiB
HTML
<!doctype html>
|
|
<html class="no-js" lang="">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
<title>CICADA</title>
|
|
<meta name="description" content="">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
|
|
<link rel="stylesheet" href="../styles/style.css">
|
|
<link rel="stylesheet" href="../styles/dark.css" media="(prefers-color-scheme: dark)">
|
|
</head>
|
|
<body>
|
|
|
|
<div class="navbar navbar-default navbar-fixed-top visible-xs">
|
|
<a href="../" class="navbar-brand">CICADA</a>
|
|
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
|
|
</div>
|
|
|
|
<div class="xs-menu menu" id="mobile-menu">
|
|
<div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu>
|
|
</div>
|
|
|
|
<div class="container-fluid main">
|
|
<div class="row main">
|
|
<div class="hidden-xs menu">
|
|
<compodoc-menu mode="normal"></compodoc-menu>
|
|
</div>
|
|
<!-- START CONTENT -->
|
|
<div class="content injectable">
|
|
<div class="content-data">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<ol class="breadcrumb">
|
|
<li>Injectables</li>
|
|
<li >UserService</li>
|
|
</ol>
|
|
|
|
<ul class="nav nav-tabs" role="tablist">
|
|
<li class="active">
|
|
<a href="#info" role="tab" id="info-tab" data-toggle="tab" data-link="info">Info</a>
|
|
</li>
|
|
<li >
|
|
<a href="#source" role="tab" id="source-tab" data-toggle="tab" data-link="source">Source</a>
|
|
</li>
|
|
</ul>
|
|
|
|
<div class="tab-content">
|
|
<div class="tab-pane fade active in" id="c-info">
|
|
<p class="comment">
|
|
<h3>File</h3>
|
|
</p>
|
|
<p class="comment">
|
|
<code>src/app/_services/user.service.ts</code>
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
<section>
|
|
<h3 id="index">Index</h3>
|
|
<table class="table table-sm table-bordered index-table">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<h6><b>Properties</b></h6>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<ul class="index-list">
|
|
<li>
|
|
<a href="#accounts" >accounts</a>
|
|
</li>
|
|
<li>
|
|
<span class="modifier">Private</span>
|
|
<a href="#accountsList" >accountsList</a>
|
|
</li>
|
|
<li>
|
|
<a href="#accountsSubject" >accountsSubject</a>
|
|
</li>
|
|
<li>
|
|
<a href="#actions" >actions</a>
|
|
</li>
|
|
<li>
|
|
<span class="modifier">Private</span>
|
|
<a href="#actionsList" >actionsList</a>
|
|
</li>
|
|
<li>
|
|
<a href="#actionsSubject" >actionsSubject</a>
|
|
</li>
|
|
<li>
|
|
<a href="#categories" >categories</a>
|
|
</li>
|
|
<li>
|
|
<span class="modifier">Private</span>
|
|
<a href="#categoriesList" >categoriesList</a>
|
|
</li>
|
|
<li>
|
|
<a href="#categoriesSubject" >categoriesSubject</a>
|
|
</li>
|
|
<li>
|
|
<a href="#headers" >headers</a>
|
|
</li>
|
|
<li>
|
|
<a href="#history" >history</a>
|
|
</li>
|
|
<li>
|
|
<span class="modifier">Private</span>
|
|
<a href="#historyList" >historyList</a>
|
|
</li>
|
|
<li>
|
|
<a href="#historySubject" >historySubject</a>
|
|
</li>
|
|
<li>
|
|
<a href="#keystore" >keystore</a>
|
|
</li>
|
|
<li>
|
|
<a href="#registry" >registry</a>
|
|
</li>
|
|
<li>
|
|
<a href="#signer" >signer</a>
|
|
</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<h6><b>Methods</b></h6>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<ul class="index-list">
|
|
<li>
|
|
<a href="#addAccount" >addAccount</a>
|
|
</li>
|
|
<li>
|
|
<a href="#approveAction" >approveAction</a>
|
|
</li>
|
|
<li>
|
|
<span class="modifier">Async</span>
|
|
<a href="#changeAccountInfo" >changeAccountInfo</a>
|
|
</li>
|
|
<li>
|
|
<span class="modifier">Async</span>
|
|
<a href="#getAccountByAddress" >getAccountByAddress</a>
|
|
</li>
|
|
<li>
|
|
<span class="modifier">Async</span>
|
|
<a href="#getAccountByPhone" >getAccountByPhone</a>
|
|
</li>
|
|
<li>
|
|
<a href="#getAccountDetailsFromMeta" >getAccountDetailsFromMeta</a>
|
|
</li>
|
|
<li>
|
|
<a href="#getAccountStatus" >getAccountStatus</a>
|
|
</li>
|
|
<li>
|
|
<a href="#getAccountTypes" >getAccountTypes</a>
|
|
</li>
|
|
<li>
|
|
<a href="#getActionById" >getActionById</a>
|
|
</li>
|
|
<li>
|
|
<a href="#getActions" >getActions</a>
|
|
</li>
|
|
<li>
|
|
<a href="#getCategories" >getCategories</a>
|
|
</li>
|
|
<li>
|
|
<a href="#getCategoryByProduct" >getCategoryByProduct</a>
|
|
</li>
|
|
<li>
|
|
<a href="#getGenders" >getGenders</a>
|
|
</li>
|
|
<li>
|
|
<a href="#getLockedAccounts" >getLockedAccounts</a>
|
|
</li>
|
|
<li>
|
|
<a href="#getTransactionTypes" >getTransactionTypes</a>
|
|
</li>
|
|
<li>
|
|
<span class="modifier">Async</span>
|
|
<a href="#init" >init</a>
|
|
</li>
|
|
<li>
|
|
<span class="modifier">Async</span>
|
|
<a href="#loadAccounts" >loadAccounts</a>
|
|
</li>
|
|
<li>
|
|
<span class="modifier">Async</span>
|
|
<a href="#loadChangesToAccountStructure" >loadChangesToAccountStructure</a>
|
|
</li>
|
|
<li>
|
|
<a href="#resetAccountsList" >resetAccountsList</a>
|
|
</li>
|
|
<li>
|
|
<a href="#resetPin" >resetPin</a>
|
|
</li>
|
|
<li>
|
|
<a href="#revokeAction" >revokeAction</a>
|
|
</li>
|
|
<li>
|
|
<span class="modifier">Async</span>
|
|
<a href="#updateMeta" >updateMeta</a>
|
|
</li>
|
|
<li>
|
|
<span class="modifier">Async</span>
|
|
<a href="#updatePhonePointers" >updatePhonePointers</a>
|
|
</li>
|
|
<li>
|
|
<a href="#wrap" >wrap</a>
|
|
</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
|
|
<section>
|
|
<h3 id="constructor">Constructor</h3>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<code>constructor(httpClient: <a href="https://angular.io/api/common/http/HttpClient" target="_blank">HttpClient</a>, loggingService: <a href="../injectables/LoggingService.html" target="_self">LoggingService</a>, tokenService: <a href="../injectables/TokenService.html" target="_self">TokenService</a>)</code>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="44" class="link-to-prism">src/app/_services/user.service.ts:44</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div>
|
|
<b>Parameters :</b>
|
|
<table class="params">
|
|
<thead>
|
|
<tr>
|
|
<td>Name</td>
|
|
<td>Type</td>
|
|
<td>Optional</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>httpClient</td>
|
|
|
|
<td>
|
|
<code><a href="https://angular.io/api/common/http/HttpClient" target="_blank" >HttpClient</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>loggingService</td>
|
|
|
|
<td>
|
|
<code><a href="../injectables/LoggingService.html" target="_self" >LoggingService</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>tokenService</td>
|
|
|
|
<td>
|
|
<code><a href="../injectables/TokenService.html" target="_self" >TokenService</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
|
|
<section>
|
|
|
|
<h3 id="methods">
|
|
Methods
|
|
</h3>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="addAccount"></a>
|
|
<span class="name">
|
|
<span ><b>addAccount</b></span>
|
|
<a href="#addAccount"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<code>addAccount(account: <a href="../interfaces/AccountDetails.html" target="_self">AccountDetails</a>, cacheSize: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank">number</a>, top: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank">boolean</a>)</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="325"
|
|
class="link-to-prism">src/app/_services/user.service.ts:325</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Parameters :</b>
|
|
<table class="params">
|
|
<thead>
|
|
<tr>
|
|
<td>Name</td>
|
|
<td>Type</td>
|
|
<td>Optional</td>
|
|
<td>Default value</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>account</td>
|
|
<td>
|
|
<code><a href="../interfaces/AccountDetails.html" target="_self" >AccountDetails</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
<td>
|
|
</td>
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>cacheSize</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
<td>
|
|
</td>
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>top</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
<td>
|
|
<code>true</code>
|
|
</td>
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
</div>
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
|
|
|
</div>
|
|
<div class="io-description">
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="approveAction"></a>
|
|
<span class="name">
|
|
<span ><b>approveAction</b></span>
|
|
<a href="#approveAction"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<code>approveAction(id: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="170"
|
|
class="link-to-prism">src/app/_services/user.service.ts:170</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Parameters :</b>
|
|
<table class="params">
|
|
<thead>
|
|
<tr>
|
|
<td>Name</td>
|
|
<td>Type</td>
|
|
<td>Optional</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
</div>
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code>Observable<any></code>
|
|
|
|
</div>
|
|
<div class="io-description">
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="changeAccountInfo"></a>
|
|
<span class="name">
|
|
<span class="modifier">Async</span>
|
|
<span ><b>changeAccountInfo</b></span>
|
|
<a href="#changeAccountInfo"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<span class="modifier-icon icon ion-ios-reset"></span>
|
|
<code>changeAccountInfo(address: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, name: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, phoneNumber: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, age: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, type: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, bio: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, gender: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, businessCategory: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, userLocation: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, location: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, locationType: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, oldPhoneNumber: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="72"
|
|
class="link-to-prism">src/app/_services/user.service.ts:72</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Parameters :</b>
|
|
<table class="params">
|
|
<thead>
|
|
<tr>
|
|
<td>Name</td>
|
|
<td>Type</td>
|
|
<td>Optional</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>address</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>phoneNumber</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>age</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>bio</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>gender</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>businessCategory</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>userLocation</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>location</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>locationType</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>oldPhoneNumber</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
</div>
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code>Promise<boolean></code>
|
|
|
|
</div>
|
|
<div class="io-description">
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="getAccountByAddress"></a>
|
|
<span class="name">
|
|
<span class="modifier">Async</span>
|
|
<span ><b>getAccountByAddress</b></span>
|
|
<a href="#getAccountByAddress"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<span class="modifier-icon icon ion-ios-reset"></span>
|
|
<code>getAccountByAddress(accountAddress: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, limit: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank">number</a>, history: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank">boolean</a>, top: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank">boolean</a>)</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="234"
|
|
class="link-to-prism">src/app/_services/user.service.ts:234</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Parameters :</b>
|
|
<table class="params">
|
|
<thead>
|
|
<tr>
|
|
<td>Name</td>
|
|
<td>Type</td>
|
|
<td>Optional</td>
|
|
<td>Default value</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>accountAddress</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
<td>
|
|
</td>
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
<td>
|
|
<code>100</code>
|
|
</td>
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>history</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
<td>
|
|
<code>false</code>
|
|
</td>
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>top</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
<td>
|
|
<code>true</code>
|
|
</td>
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
</div>
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code><a href="../interfaces/AccountDetails.html" target="_self" >Promise<Observable<AccountDetails>></a></code>
|
|
|
|
</div>
|
|
<div class="io-description">
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="getAccountByPhone"></a>
|
|
<span class="name">
|
|
<span class="modifier">Async</span>
|
|
<span ><b>getAccountByPhone</b></span>
|
|
<a href="#getAccountByPhone"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<span class="modifier-icon icon ion-ios-reset"></span>
|
|
<code>getAccountByPhone(phoneNumber: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, limit: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank">number</a>)</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="270"
|
|
class="link-to-prism">src/app/_services/user.service.ts:270</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Parameters :</b>
|
|
<table class="params">
|
|
<thead>
|
|
<tr>
|
|
<td>Name</td>
|
|
<td>Type</td>
|
|
<td>Optional</td>
|
|
<td>Default value</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>phoneNumber</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
<td>
|
|
</td>
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
<td>
|
|
<code>100</code>
|
|
</td>
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
</div>
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code><a href="../interfaces/AccountDetails.html" target="_self" >Promise<Observable<AccountDetails>></a></code>
|
|
|
|
</div>
|
|
<div class="io-description">
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="getAccountDetailsFromMeta"></a>
|
|
<span class="name">
|
|
<span ><b>getAccountDetailsFromMeta</b></span>
|
|
<a href="#getAccountDetailsFromMeta"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<code>getAccountDetailsFromMeta(userKey: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="178"
|
|
class="link-to-prism">src/app/_services/user.service.ts:178</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Parameters :</b>
|
|
<table class="params">
|
|
<thead>
|
|
<tr>
|
|
<td>Name</td>
|
|
<td>Type</td>
|
|
<td>Optional</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>userKey</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
</div>
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code>Observable<any></code>
|
|
|
|
</div>
|
|
<div class="io-description">
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="getAccountStatus"></a>
|
|
<span class="name">
|
|
<span ><b>getAccountStatus</b></span>
|
|
<a href="#getAccountStatus"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<code>getAccountStatus(phone: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="63"
|
|
class="link-to-prism">src/app/_services/user.service.ts:63</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Parameters :</b>
|
|
<table class="params">
|
|
<thead>
|
|
<tr>
|
|
<td>Name</td>
|
|
<td>Type</td>
|
|
<td>Optional</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>phone</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
</div>
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code>Observable<any></code>
|
|
|
|
</div>
|
|
<div class="io-description">
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="getAccountTypes"></a>
|
|
<span class="name">
|
|
<span ><b>getAccountTypes</b></span>
|
|
<a href="#getAccountTypes"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<code>getAccountTypes()</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="313"
|
|
class="link-to-prism">src/app/_services/user.service.ts:313</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code>Observable<any></code>
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="getActionById"></a>
|
|
<span class="name">
|
|
<span ><b>getActionById</b></span>
|
|
<a href="#getActionById"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<code>getActionById(id: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="166"
|
|
class="link-to-prism">src/app/_services/user.service.ts:166</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Parameters :</b>
|
|
<table class="params">
|
|
<thead>
|
|
<tr>
|
|
<td>Name</td>
|
|
<td>Type</td>
|
|
<td>Optional</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
</div>
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code>Observable<any></code>
|
|
|
|
</div>
|
|
<div class="io-description">
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="getActions"></a>
|
|
<span class="name">
|
|
<span ><b>getActions</b></span>
|
|
<a href="#getActions"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<code>getActions()</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="159"
|
|
class="link-to-prism">src/app/_services/user.service.ts:159</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="getCategories"></a>
|
|
<span class="name">
|
|
<span ><b>getCategories</b></span>
|
|
<a href="#getCategories"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<code>getCategories()</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="293"
|
|
class="link-to-prism">src/app/_services/user.service.ts:293</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="getCategoryByProduct"></a>
|
|
<span class="name">
|
|
<span ><b>getCategoryByProduct</b></span>
|
|
<a href="#getCategoryByProduct"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<code>getCategoryByProduct(product: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, categories: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object" target="_blank">object</a>)</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="300"
|
|
class="link-to-prism">src/app/_services/user.service.ts:300</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Parameters :</b>
|
|
<table class="params">
|
|
<thead>
|
|
<tr>
|
|
<td>Name</td>
|
|
<td>Type</td>
|
|
<td>Optional</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>product</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>categories</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object" target="_blank" >object</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
</div>
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
|
|
</div>
|
|
<div class="io-description">
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="getGenders"></a>
|
|
<span class="name">
|
|
<span ><b>getGenders</b></span>
|
|
<a href="#getGenders"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<code>getGenders()</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="321"
|
|
class="link-to-prism">src/app/_services/user.service.ts:321</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code>Observable<any></code>
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="getLockedAccounts"></a>
|
|
<span class="name">
|
|
<span ><b>getLockedAccounts</b></span>
|
|
<a href="#getLockedAccounts"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<code>getLockedAccounts(offset: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank">number</a>, limit: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank">number</a>)</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="68"
|
|
class="link-to-prism">src/app/_services/user.service.ts:68</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Parameters :</b>
|
|
<table class="params">
|
|
<thead>
|
|
<tr>
|
|
<td>Name</td>
|
|
<td>Type</td>
|
|
<td>Optional</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>offset</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
</div>
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code>Observable<any></code>
|
|
|
|
</div>
|
|
<div class="io-description">
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="getTransactionTypes"></a>
|
|
<span class="name">
|
|
<span ><b>getTransactionTypes</b></span>
|
|
<a href="#getTransactionTypes"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<code>getTransactionTypes()</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="317"
|
|
class="link-to-prism">src/app/_services/user.service.ts:317</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code>Observable<any></code>
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="init"></a>
|
|
<span class="name">
|
|
<span class="modifier">Async</span>
|
|
<span ><b>init</b></span>
|
|
<a href="#init"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<span class="modifier-icon icon ion-ios-reset"></span>
|
|
<code>init()</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="52"
|
|
class="link-to-prism">src/app/_services/user.service.ts:52</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code>Promise<void></code>
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="loadAccounts"></a>
|
|
<span class="name">
|
|
<span class="modifier">Async</span>
|
|
<span ><b>loadAccounts</b></span>
|
|
<a href="#loadAccounts"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<span class="modifier-icon icon ion-ios-reset"></span>
|
|
<code>loadAccounts(limit: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank">number</a>, offset: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank">number</a>)</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="196"
|
|
class="link-to-prism">src/app/_services/user.service.ts:196</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Parameters :</b>
|
|
<table class="params">
|
|
<thead>
|
|
<tr>
|
|
<td>Name</td>
|
|
<td>Type</td>
|
|
<td>Optional</td>
|
|
<td>Default value</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>limit</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
<td>
|
|
<code>100</code>
|
|
</td>
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>offset</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
<td>
|
|
<code>0</code>
|
|
</td>
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
</div>
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code>Promise<void></code>
|
|
|
|
</div>
|
|
<div class="io-description">
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="loadChangesToAccountStructure"></a>
|
|
<span class="name">
|
|
<span class="modifier">Async</span>
|
|
<span ><b>loadChangesToAccountStructure</b></span>
|
|
<a href="#loadChangesToAccountStructure"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<span class="modifier-icon icon ion-ios-reset"></span>
|
|
<code>loadChangesToAccountStructure(name: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, phoneNumber: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, age: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, type: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, bio: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, gender: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, businessCategory: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, userLocation: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, location: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, locationType: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="357"
|
|
class="link-to-prism">src/app/_services/user.service.ts:357</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Parameters :</b>
|
|
<table class="params">
|
|
<thead>
|
|
<tr>
|
|
<td>Name</td>
|
|
<td>Type</td>
|
|
<td>Optional</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>phoneNumber</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>age</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>type</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>bio</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>gender</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>businessCategory</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>userLocation</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>location</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>locationType</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
</div>
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code><a href="../interfaces/AccountDetails.html" target="_self" >Promise<AccountDetails></a></code>
|
|
|
|
</div>
|
|
<div class="io-description">
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="resetAccountsList"></a>
|
|
<span class="name">
|
|
<span ><b>resetAccountsList</b></span>
|
|
<a href="#resetAccountsList"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<code>resetAccountsList()</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="288"
|
|
class="link-to-prism">src/app/_services/user.service.ts:288</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="resetPin"></a>
|
|
<span class="name">
|
|
<span ><b>resetPin</b></span>
|
|
<a href="#resetPin"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<code>resetPin(phone: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="58"
|
|
class="link-to-prism">src/app/_services/user.service.ts:58</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Parameters :</b>
|
|
<table class="params">
|
|
<thead>
|
|
<tr>
|
|
<td>Name</td>
|
|
<td>Type</td>
|
|
<td>Optional</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>phone</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
</div>
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code>Observable<any></code>
|
|
|
|
</div>
|
|
<div class="io-description">
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="revokeAction"></a>
|
|
<span class="name">
|
|
<span ><b>revokeAction</b></span>
|
|
<a href="#revokeAction"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<code>revokeAction(id: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="174"
|
|
class="link-to-prism">src/app/_services/user.service.ts:174</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Parameters :</b>
|
|
<table class="params">
|
|
<thead>
|
|
<tr>
|
|
<td>Name</td>
|
|
<td>Type</td>
|
|
<td>Optional</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>id</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
</div>
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code>Observable<any></code>
|
|
|
|
</div>
|
|
<div class="io-description">
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="updateMeta"></a>
|
|
<span class="name">
|
|
<span class="modifier">Async</span>
|
|
<span ><b>updateMeta</b></span>
|
|
<a href="#updateMeta"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<span class="modifier-icon icon ion-ios-reset"></span>
|
|
<code>updateMeta(syncableAccount: Syncable, accountKey: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, headers: <a href="https://angular.io/api/common/http/HttpHeaders" target="_blank">HttpHeaders</a>)</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="135"
|
|
class="link-to-prism">src/app/_services/user.service.ts:135</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Parameters :</b>
|
|
<table class="params">
|
|
<thead>
|
|
<tr>
|
|
<td>Name</td>
|
|
<td>Type</td>
|
|
<td>Optional</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>syncableAccount</td>
|
|
<td>
|
|
<code>Syncable</code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>accountKey</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>headers</td>
|
|
<td>
|
|
<code><a href="https://angular.io/api/common/http/HttpHeaders" target="_blank" >HttpHeaders</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
</div>
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code>Promise<boolean></code>
|
|
|
|
</div>
|
|
<div class="io-description">
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="updatePhonePointers"></a>
|
|
<span class="name">
|
|
<span class="modifier">Async</span>
|
|
<span ><b>updatePhonePointers</b></span>
|
|
<a href="#updatePhonePointers"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<span class="modifier-icon icon ion-ios-reset"></span>
|
|
<code>updatePhonePointers(address: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, oldPhoneNumber: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, newPhoneNumber: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="413"
|
|
class="link-to-prism">src/app/_services/user.service.ts:413</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Parameters :</b>
|
|
<table class="params">
|
|
<thead>
|
|
<tr>
|
|
<td>Name</td>
|
|
<td>Type</td>
|
|
<td>Optional</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>address</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>oldPhoneNumber</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>newPhoneNumber</td>
|
|
<td>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
</div>
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code>Promise<void></code>
|
|
|
|
</div>
|
|
<div class="io-description">
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="wrap"></a>
|
|
<span class="name">
|
|
<span ><b>wrap</b></span>
|
|
<a href="#wrap"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<code>wrap(syncable: Syncable, signer: <a href="../interfaces/Signer.html" target="_self">Signer</a>)</code>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="182"
|
|
class="link-to-prism">src/app/_services/user.service.ts:182</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="col-md-4">
|
|
|
|
<div class="io-description">
|
|
<b>Parameters :</b>
|
|
<table class="params">
|
|
<thead>
|
|
<tr>
|
|
<td>Name</td>
|
|
<td>Type</td>
|
|
<td>Optional</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>syncable</td>
|
|
<td>
|
|
<code>Syncable</code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
<td>signer</td>
|
|
<td>
|
|
<code><a href="../interfaces/Signer.html" target="_self" >Signer</a></code>
|
|
</td>
|
|
|
|
<td>
|
|
No
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
</div>
|
|
<div class="io-description">
|
|
<b>Returns : </b> <code>Promise<Envelope></code>
|
|
|
|
</div>
|
|
<div class="io-description">
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
<section>
|
|
|
|
<h3 id="inputs">
|
|
Properties
|
|
</h3>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="accounts"></a>
|
|
<span class="name">
|
|
<span ><b>accounts</b></span>
|
|
<a href="#accounts"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Type : </i> <code><a href="../interfaces/AccountDetails.html" target="_self" >Array<AccountDetails></a></code>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Default value : </i><code>[]</code>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="28" class="link-to-prism">src/app/_services/user.service.ts:28</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="accountsList"></a>
|
|
<span class="name">
|
|
<span class="modifier">Private</span>
|
|
<span ><b>accountsList</b></span>
|
|
<a href="#accountsList"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Type : </i> <code><a href="../interfaces/AccountDetails.html" target="_self" >BehaviorSubject<Array<AccountDetails>></a></code>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Default value : </i><code>new BehaviorSubject<
|
|
Array<AccountDetails>
|
|
>(this.accounts)</code>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="29" class="link-to-prism">src/app/_services/user.service.ts:29</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="accountsSubject"></a>
|
|
<span class="name">
|
|
<span ><b>accountsSubject</b></span>
|
|
<a href="#accountsSubject"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Type : </i> <code><a href="../interfaces/AccountDetails.html" target="_self" >Observable<Array<AccountDetails>></a></code>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Default value : </i><code>this.accountsList.asObservable()</code>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="32" class="link-to-prism">src/app/_services/user.service.ts:32</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="actions"></a>
|
|
<span class="name">
|
|
<span ><b>actions</b></span>
|
|
<a href="#actions"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Type : </i> <code>Array<any></code>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Default value : </i><code>[]</code>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="34" class="link-to-prism">src/app/_services/user.service.ts:34</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="actionsList"></a>
|
|
<span class="name">
|
|
<span class="modifier">Private</span>
|
|
<span ><b>actionsList</b></span>
|
|
<a href="#actionsList"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Type : </i> <code>BehaviorSubject<any></code>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Default value : </i><code>new BehaviorSubject<any>(this.actions)</code>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="35" class="link-to-prism">src/app/_services/user.service.ts:35</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="actionsSubject"></a>
|
|
<span class="name">
|
|
<span ><b>actionsSubject</b></span>
|
|
<a href="#actionsSubject"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Type : </i> <code>Observable<Array<any>></code>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Default value : </i><code>this.actionsList.asObservable()</code>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="36" class="link-to-prism">src/app/_services/user.service.ts:36</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="categories"></a>
|
|
<span class="name">
|
|
<span ><b>categories</b></span>
|
|
<a href="#categories"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object" target="_blank" >object</a></code>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Default value : </i><code>{}</code>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="38" class="link-to-prism">src/app/_services/user.service.ts:38</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="categoriesList"></a>
|
|
<span class="name">
|
|
<span class="modifier">Private</span>
|
|
<span ><b>categoriesList</b></span>
|
|
<a href="#categoriesList"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Type : </i> <code>BehaviorSubject<object></code>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Default value : </i><code>new BehaviorSubject<object>(this.categories)</code>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="39" class="link-to-prism">src/app/_services/user.service.ts:39</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="categoriesSubject"></a>
|
|
<span class="name">
|
|
<span ><b>categoriesSubject</b></span>
|
|
<a href="#categoriesSubject"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Type : </i> <code>Observable<object></code>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Default value : </i><code>this.categoriesList.asObservable()</code>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="40" class="link-to-prism">src/app/_services/user.service.ts:40</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="headers"></a>
|
|
<span class="name">
|
|
<span ><b>headers</b></span>
|
|
<a href="#headers"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Type : </i> <code><a href="https://angular.io/api/common/http/HttpHeaders" target="_blank" >HttpHeaders</a></code>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Default value : </i><code>new HttpHeaders({ 'x-cic-automerge': 'client' })</code>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="23" class="link-to-prism">src/app/_services/user.service.ts:23</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="history"></a>
|
|
<span class="name">
|
|
<span ><b>history</b></span>
|
|
<a href="#history"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Type : </i> <code>Array<any></code>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Default value : </i><code>[]</code>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="42" class="link-to-prism">src/app/_services/user.service.ts:42</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="historyList"></a>
|
|
<span class="name">
|
|
<span class="modifier">Private</span>
|
|
<span ><b>historyList</b></span>
|
|
<a href="#historyList"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Type : </i> <code>BehaviorSubject<any></code>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Default value : </i><code>new BehaviorSubject<any>(this.history)</code>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="43" class="link-to-prism">src/app/_services/user.service.ts:43</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="historySubject"></a>
|
|
<span class="name">
|
|
<span ><b>historySubject</b></span>
|
|
<a href="#historySubject"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Type : </i> <code>Observable<Array<any>></code>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Default value : </i><code>this.historyList.asObservable()</code>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="44" class="link-to-prism">src/app/_services/user.service.ts:44</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="keystore"></a>
|
|
<span class="name">
|
|
<span ><b>keystore</b></span>
|
|
<a href="#keystore"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Type : </i> <code><a href="../interfaces/MutableKeyStore.html" target="_self" >MutableKeyStore</a></code>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="24" class="link-to-prism">src/app/_services/user.service.ts:24</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="registry"></a>
|
|
<span class="name">
|
|
<span ><b>registry</b></span>
|
|
<a href="#registry"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Type : </i> <code>CICRegistry</code>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="26" class="link-to-prism">src/app/_services/user.service.ts:26</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm table-bordered">
|
|
<tbody>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<a name="signer"></a>
|
|
<span class="name">
|
|
<span ><b>signer</b></span>
|
|
<a href="#signer"><span class="icon ion-ios-link"></span></a>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<i>Type : </i> <code><a href="../interfaces/Signer.html" target="_self" >Signer</a></code>
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="col-md-4">
|
|
<div class="io-line">Defined in <a href="" data-line="25" class="link-to-prism">src/app/_services/user.service.ts:25</a></div>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="tab-pane fade tab-source-code" id="c-source">
|
|
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Injectable } from '@angular/core';
|
|
import { BehaviorSubject, Observable, Subject } from 'rxjs';
|
|
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
|
import { environment } from '@src/environments/environment';
|
|
import { first } from 'rxjs/operators';
|
|
import { ArgPair, Envelope, Phone, Syncable, User } from 'cic-client-meta';
|
|
import { AccountDetails } from '@app/_models';
|
|
import { LoggingService } from '@app/_services/logging.service';
|
|
import { TokenService } from '@app/_services/token.service';
|
|
import { MutableKeyStore, PGPSigner, Signer } from '@app/_pgp';
|
|
import { RegistryService } from '@app/_services/registry.service';
|
|
import { CICRegistry } from '@cicnet/cic-client';
|
|
import { personValidation, updateSyncable, vcardValidation } from '@app/_helpers';
|
|
import { add0x, strip0x } from '@src/assets/js/ethtx/dist/hex';
|
|
import { KeystoreService } from '@app/_services/keystore.service';
|
|
import * as Automerge from 'automerge';
|
|
const vCard = require('vcard-parser');
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
export class UserService {
|
|
headers: HttpHeaders = new HttpHeaders({ 'x-cic-automerge': 'client' });
|
|
keystore: MutableKeyStore;
|
|
signer: Signer;
|
|
registry: CICRegistry;
|
|
|
|
accounts: Array<AccountDetails> = [];
|
|
private accountsList: BehaviorSubject<Array<AccountDetails>> = new BehaviorSubject<
|
|
Array<AccountDetails>
|
|
>(this.accounts);
|
|
accountsSubject: Observable<Array<AccountDetails>> = this.accountsList.asObservable();
|
|
|
|
actions: Array<any> = [];
|
|
private actionsList: BehaviorSubject<any> = new BehaviorSubject<any>(this.actions);
|
|
actionsSubject: Observable<Array<any>> = this.actionsList.asObservable();
|
|
|
|
categories: object = {};
|
|
private categoriesList: BehaviorSubject<object> = new BehaviorSubject<object>(this.categories);
|
|
categoriesSubject: Observable<object> = this.categoriesList.asObservable();
|
|
|
|
history: Array<any> = [];
|
|
private historyList: BehaviorSubject<any> = new BehaviorSubject<any>(this.history);
|
|
historySubject: Observable<Array<any>> = this.historyList.asObservable();
|
|
|
|
constructor(
|
|
private httpClient: HttpClient,
|
|
private loggingService: LoggingService,
|
|
private tokenService: TokenService
|
|
) {}
|
|
|
|
async init(): Promise<void> {
|
|
this.keystore = await KeystoreService.getKeystore();
|
|
this.signer = new PGPSigner(this.keystore);
|
|
this.registry = await RegistryService.getRegistry();
|
|
}
|
|
|
|
resetPin(phone: string): Observable<any> {
|
|
const params: HttpParams = new HttpParams().set('phoneNumber', phone);
|
|
return this.httpClient.put(`${environment.cicUssdUrl}/pin`, { params });
|
|
}
|
|
|
|
getAccountStatus(phone: string): Observable<any> {
|
|
const params: HttpParams = new HttpParams().set('phoneNumber', phone);
|
|
return this.httpClient.get(`${environment.cicUssdUrl}/pin`, { params });
|
|
}
|
|
|
|
getLockedAccounts(offset: number, limit: number): Observable<any> {
|
|
return this.httpClient.get(`${environment.cicUssdUrl}/accounts/locked/${offset}/${limit}`);
|
|
}
|
|
|
|
async changeAccountInfo(
|
|
address: string,
|
|
name: string,
|
|
phoneNumber: string,
|
|
age: string,
|
|
type: string,
|
|
bio: string,
|
|
gender: string,
|
|
businessCategory: string,
|
|
userLocation: string,
|
|
location: string,
|
|
locationType: string,
|
|
oldPhoneNumber: string
|
|
): Promise<boolean> {
|
|
const accountInfo = await this.loadChangesToAccountStructure(
|
|
name,
|
|
phoneNumber,
|
|
age,
|
|
type,
|
|
bio,
|
|
gender,
|
|
businessCategory,
|
|
userLocation,
|
|
location,
|
|
locationType
|
|
);
|
|
const accountKey: string = await User.toKey(address);
|
|
return new Promise((resolve) => {
|
|
let status: boolean = false;
|
|
this.getAccountDetailsFromMeta(accountKey)
|
|
.pipe(first())
|
|
.subscribe(
|
|
async (res) => {
|
|
const syncableAccount: Syncable = Envelope.fromJSON(JSON.stringify(res)).unwrap();
|
|
const update: Array<ArgPair> = [];
|
|
for (const prop of Object.keys(accountInfo)) {
|
|
update.push(new ArgPair(prop, accountInfo[prop]));
|
|
}
|
|
updateSyncable(update, 'client-branch', syncableAccount);
|
|
await personValidation(syncableAccount.m.data);
|
|
status = await this.updateMeta(syncableAccount, accountKey, this.headers);
|
|
if (status && phoneNumber !== oldPhoneNumber) {
|
|
await this.updatePhonePointers(address, oldPhoneNumber, phoneNumber);
|
|
}
|
|
resolve(status);
|
|
},
|
|
async (error) => {
|
|
this.loggingService.sendErrorLevelMessage(
|
|
'Cannot find account info in meta service',
|
|
this,
|
|
{ error }
|
|
);
|
|
const syncableAccount: Syncable = new Syncable(accountKey, accountInfo);
|
|
status = await this.updateMeta(syncableAccount, accountKey, this.headers);
|
|
if (status && phoneNumber !== oldPhoneNumber) {
|
|
await this.updatePhonePointers(address, oldPhoneNumber, phoneNumber);
|
|
}
|
|
resolve(status);
|
|
}
|
|
);
|
|
});
|
|
}
|
|
|
|
async updateMeta(
|
|
syncableAccount: Syncable,
|
|
accountKey: string,
|
|
headers: HttpHeaders
|
|
): Promise<boolean> {
|
|
const envelope: Envelope = await this.wrap(syncableAccount, this.signer);
|
|
const reqBody: string = envelope.toJSON();
|
|
return new Promise((resolve) => {
|
|
this.httpClient
|
|
.put(`${environment.cicMetaUrl}/${accountKey}`, reqBody, { headers })
|
|
.pipe(first())
|
|
.subscribe(
|
|
(res) => {
|
|
this.loggingService.sendInfoLevelMessage(`Response: ${res}`);
|
|
resolve(true);
|
|
},
|
|
(error) => {
|
|
this.loggingService.sendErrorLevelMessage('Metadata update failed!', this, { error });
|
|
resolve(false);
|
|
}
|
|
);
|
|
});
|
|
}
|
|
|
|
getActions(): void {
|
|
this.httpClient
|
|
.get(`${environment.cicCacheUrl}/actions`)
|
|
.pipe(first())
|
|
.subscribe((res) => this.actionsList.next(res));
|
|
}
|
|
|
|
getActionById(id: string): Observable<any> {
|
|
return this.httpClient.get(`${environment.cicCacheUrl}/actions/${id}`);
|
|
}
|
|
|
|
approveAction(id: string): Observable<any> {
|
|
return this.httpClient.post(`${environment.cicCacheUrl}/actions/${id}`, { approval: true });
|
|
}
|
|
|
|
revokeAction(id: string): Observable<any> {
|
|
return this.httpClient.post(`${environment.cicCacheUrl}/actions/${id}`, { approval: false });
|
|
}
|
|
|
|
getAccountDetailsFromMeta(userKey: string): Observable<any> {
|
|
return this.httpClient.get(`${environment.cicMetaUrl}/${userKey}`, { headers: this.headers });
|
|
}
|
|
|
|
wrap(syncable: Syncable, signer: Signer): Promise<Envelope> {
|
|
return new Promise<Envelope>(async (resolve, reject) => {
|
|
syncable.setSigner(signer);
|
|
syncable.onwrap = async (env) => {
|
|
if (env === undefined) {
|
|
reject();
|
|
return;
|
|
}
|
|
resolve(env);
|
|
};
|
|
await syncable.sign();
|
|
});
|
|
}
|
|
|
|
async loadAccounts(limit: number = 100, offset: number = 0): Promise<void> {
|
|
try {
|
|
const accountRegistry = await RegistryService.getAccountRegistry();
|
|
const accountAddresses: Array<string> = await accountRegistry.last(offset + limit);
|
|
this.loggingService.sendInfoLevelMessage(accountAddresses);
|
|
if (typeof Worker !== 'undefined') {
|
|
const worker = new Worker('@app/_workers/fetch-accounts.worker', { type: 'module' });
|
|
worker.onmessage = ({ data }) => {
|
|
if (data) {
|
|
this.tokenService.load.subscribe(async (status: boolean) => {
|
|
if (status) {
|
|
data.balance = await this.tokenService.getTokenBalance(
|
|
data.identities.evm[`bloxberg:${environment.bloxbergChainId}`][0]
|
|
);
|
|
}
|
|
});
|
|
this.addAccount(data, limit, false);
|
|
}
|
|
};
|
|
worker.postMessage({
|
|
addresses: accountAddresses.slice(offset, offset + limit),
|
|
url: environment.cicMetaUrl,
|
|
token: sessionStorage.getItem(btoa('CICADA_SESSION_TOKEN')),
|
|
});
|
|
} else {
|
|
this.loggingService.sendInfoLevelMessage(
|
|
'Web workers are not supported in this environment'
|
|
);
|
|
for (const accountAddress of accountAddresses.slice(offset, offset + limit)) {
|
|
await this.getAccountByAddress(accountAddress, limit, false, false);
|
|
}
|
|
}
|
|
} catch (error) {
|
|
this.loggingService.sendErrorLevelMessage('Unable to load accounts.', 'user.service', error);
|
|
throw error;
|
|
}
|
|
}
|
|
|
|
async getAccountByAddress(
|
|
accountAddress: string,
|
|
limit: number = 100,
|
|
history: boolean = false,
|
|
top: boolean = true
|
|
): Promise<Observable<AccountDetails>> {
|
|
const accountSubject: Subject<any> = new Subject<any>();
|
|
this.getAccountDetailsFromMeta(await User.toKey(add0x(accountAddress)))
|
|
.pipe(first())
|
|
.subscribe(async (res) => {
|
|
const account: Syncable = Envelope.fromJSON(JSON.stringify(res)).unwrap();
|
|
if (history) {
|
|
try {
|
|
// @ts-ignore
|
|
this.historyList.next(Automerge.getHistory(account.m).reverse());
|
|
} catch (error) {
|
|
this.loggingService.sendErrorLevelMessage('No history found', this, { error });
|
|
}
|
|
}
|
|
const accountInfo = account.m.data;
|
|
await personValidation(accountInfo);
|
|
this.tokenService.load.subscribe(async (status: boolean) => {
|
|
if (status) {
|
|
accountInfo.balance = await this.tokenService.getTokenBalance(
|
|
accountInfo.identities.evm[`bloxberg:${environment.bloxbergChainId}`][0]
|
|
);
|
|
}
|
|
});
|
|
accountInfo.vcard = vCard.parse(atob(accountInfo.vcard));
|
|
await vcardValidation(accountInfo.vcard);
|
|
this.addAccount(accountInfo, limit, top);
|
|
accountSubject.next(accountInfo);
|
|
});
|
|
return accountSubject.asObservable();
|
|
}
|
|
|
|
async getAccountByPhone(
|
|
phoneNumber: string,
|
|
limit: number = 100
|
|
): Promise<Observable<AccountDetails>> {
|
|
const accountSubject: Subject<any> = new Subject<any>();
|
|
this.getAccountDetailsFromMeta(await Phone.toKey(phoneNumber))
|
|
.pipe(first())
|
|
.subscribe(async (res) => {
|
|
const response: Syncable = Envelope.fromJSON(JSON.stringify(res)).unwrap();
|
|
const address: string = response.m.data;
|
|
const account: Observable<AccountDetails> = await this.getAccountByAddress(address, limit);
|
|
account.subscribe((result) => {
|
|
accountSubject.next(result);
|
|
});
|
|
});
|
|
return accountSubject.asObservable();
|
|
}
|
|
|
|
resetAccountsList(): void {
|
|
this.accounts = [];
|
|
this.accountsList.next(this.accounts);
|
|
}
|
|
|
|
getCategories(): void {
|
|
this.httpClient
|
|
.get(`${environment.cicMetaUrl}/categories`)
|
|
.pipe(first())
|
|
.subscribe((res: object) => this.categoriesList.next(res));
|
|
}
|
|
|
|
getCategoryByProduct(product: string, categories: object): string {
|
|
const keywords = product.toLowerCase().split(' ');
|
|
for (const keyword of keywords) {
|
|
const queriedCategory: string = Object.keys(categories).find((key) =>
|
|
categories[key].includes(keyword)
|
|
);
|
|
if (queriedCategory) {
|
|
return queriedCategory;
|
|
}
|
|
}
|
|
return 'other';
|
|
}
|
|
|
|
getAccountTypes(): Observable<any> {
|
|
return this.httpClient.get(`${environment.cicMetaUrl}/accounttypes`);
|
|
}
|
|
|
|
getTransactionTypes(): Observable<any> {
|
|
return this.httpClient.get(`${environment.cicMetaUrl}/transactiontypes`);
|
|
}
|
|
|
|
getGenders(): Observable<any> {
|
|
return this.httpClient.get(`${environment.cicMetaUrl}/genders`);
|
|
}
|
|
|
|
addAccount(account: AccountDetails, cacheSize: number, top: boolean = true): void {
|
|
const savedIndex = this.accounts.findIndex(
|
|
(acc) =>
|
|
acc.identities.evm[`bloxberg:${environment.bloxbergChainId}`][0] ===
|
|
account.identities.evm[`bloxberg:${environment.bloxbergChainId}`][0]
|
|
);
|
|
if (top) {
|
|
if (savedIndex === 0) {
|
|
return;
|
|
}
|
|
if (savedIndex > 0) {
|
|
this.accounts.splice(savedIndex, 1);
|
|
}
|
|
this.accounts.unshift(account);
|
|
if (this.accounts.length > cacheSize) {
|
|
this.accounts.length = Math.min(this.accounts.length, cacheSize);
|
|
}
|
|
} else {
|
|
if (
|
|
this.accounts.length >= cacheSize ||
|
|
(savedIndex !== -1 && savedIndex === this.accounts.length - 1)
|
|
) {
|
|
return;
|
|
}
|
|
if (savedIndex !== -1 && savedIndex < this.accounts.length - 1) {
|
|
this.accounts.splice(savedIndex, 1);
|
|
}
|
|
this.accounts.push(account);
|
|
}
|
|
this.accountsList.next(this.accounts);
|
|
}
|
|
|
|
async loadChangesToAccountStructure(
|
|
name: string,
|
|
phoneNumber: string,
|
|
age: string,
|
|
type: string,
|
|
bio: string,
|
|
gender: string,
|
|
businessCategory: string,
|
|
userLocation: string,
|
|
location: string,
|
|
locationType: string
|
|
): Promise<AccountDetails> {
|
|
const accountInfo: any = {
|
|
vcard: {
|
|
fn: [{}],
|
|
n: [{}],
|
|
tel: [{}],
|
|
},
|
|
location: {},
|
|
};
|
|
if (name) {
|
|
accountInfo.vcard.fn[0].value = name;
|
|
accountInfo.vcard.n[0].value = name.split(' ');
|
|
}
|
|
if (phoneNumber) {
|
|
accountInfo.vcard.tel[0].value = phoneNumber;
|
|
}
|
|
if (bio) {
|
|
accountInfo.products = [bio];
|
|
}
|
|
if (gender) {
|
|
accountInfo.gender = gender;
|
|
}
|
|
if (age) {
|
|
accountInfo.age = age;
|
|
}
|
|
if (type) {
|
|
accountInfo.type = type;
|
|
}
|
|
if (businessCategory) {
|
|
accountInfo.category = businessCategory;
|
|
}
|
|
if (location) {
|
|
accountInfo.location.area = location;
|
|
}
|
|
if (userLocation) {
|
|
accountInfo.location.area_name = userLocation;
|
|
}
|
|
if (locationType) {
|
|
accountInfo.location.area_type = locationType;
|
|
}
|
|
await vcardValidation(accountInfo.vcard);
|
|
accountInfo.vcard = btoa(vCard.generate(accountInfo.vcard));
|
|
return accountInfo;
|
|
}
|
|
|
|
async updatePhonePointers(
|
|
address: string,
|
|
oldPhoneNumber: string,
|
|
newPhoneNumber: string
|
|
): Promise<void> {
|
|
const oldPhoneKey: string = await Phone.toKey(oldPhoneNumber);
|
|
const newPhoneKey: string = await Phone.toKey(newPhoneNumber);
|
|
const newPhoneData: Syncable = new Syncable(newPhoneKey, strip0x(address));
|
|
const newPhoneSetStatus = await this.updateMeta(newPhoneData, newPhoneKey, this.headers);
|
|
if (!newPhoneSetStatus) {
|
|
const error = `Failed to update new phone number pointer: ${newPhoneNumber}`;
|
|
this.loggingService.sendErrorLevelMessage(error, this, { error });
|
|
} else {
|
|
const oldPhoneData: Syncable = new Syncable(oldPhoneKey, '');
|
|
const oldPhoneSetStatus = await this.updateMeta(oldPhoneData, oldPhoneKey, this.headers);
|
|
if (!oldPhoneSetStatus) {
|
|
const error = `Failed to update old phone number pointer: ${oldPhoneNumber}`;
|
|
this.loggingService.sendErrorLevelMessage(error, this, { error });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</code></pre>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div><div class="search-results">
|
|
<div class="has-results">
|
|
<h1 class="search-results-title"><span class='search-results-count'></span> result-matching "<span class='search-query'></span>"</h1>
|
|
<ul class="search-results-list"></ul>
|
|
</div>
|
|
<div class="no-results">
|
|
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- END CONTENT -->
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
var COMPODOC_CURRENT_PAGE_DEPTH = 1;
|
|
var COMPODOC_CURRENT_PAGE_CONTEXT = 'injectable';
|
|
var COMPODOC_CURRENT_PAGE_URL = 'UserService.html';
|
|
var MAX_SEARCH_RESULTS = 15;
|
|
</script>
|
|
|
|
<script src="../js/libs/custom-elements.min.js"></script>
|
|
<script src="../js/libs/lit-html.js"></script>
|
|
|
|
<script type="module" src="../js/menu-wc.js" defer></script>
|
|
<script nomodule src="../js/menu-wc_es5.js" defer></script>
|
|
|
|
<script src="../js/libs/bootstrap-native.js"></script>
|
|
|
|
<script src="../js/libs/es6-shim.min.js"></script>
|
|
<script src="../js/libs/EventDispatcher.js"></script>
|
|
<script src="../js/libs/promise.min.js"></script>
|
|
<script src="../js/libs/zepto.min.js"></script>
|
|
|
|
<script src="../js/compodoc.js"></script>
|
|
|
|
<script src="../js/tabs.js"></script>
|
|
<script src="../js/menu.js"></script>
|
|
<script src="../js/libs/clipboard.min.js"></script>
|
|
<script src="../js/libs/prism.js"></script>
|
|
<script src="../js/sourceCode.js"></script>
|
|
<script src="../js/search/search.js"></script>
|
|
<script src="../js/search/lunr.min.js"></script>
|
|
<script src="../js/search/search-lunr.js"></script>
|
|
<script src="../js/search/search_index.js"></script>
|
|
<script src="../js/lazy-load-graphs.js"></script>
|
|
|
|
|
|
</body>
|
|
</html>
|