Skip to content

Commit

Permalink
refactor: embed restrictions into transfer namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
monitz87 committed Dec 11, 2019
1 parent 2226628 commit c4585d5
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 18 deletions.
4 changes: 0 additions & 4 deletions src/entities/SecurityToken/SecurityToken.ts
Expand Up @@ -9,7 +9,6 @@ import { Permissions } from './Permissions';
import { Transfers } from './Transfers';
import { PolymathError } from '../../PolymathError';
import { ErrorCode } from '../../types';
import { Restrictions } from './Restrictions';
import { Documents } from './Documents';

export interface UniqueIdentifiers {
Expand Down Expand Up @@ -72,8 +71,6 @@ export class SecurityToken extends Entity<Params> {

public transfers: Transfers;

public restrictions: Restrictions;

public documents: Documents;

constructor(params: Params & UniqueIdentifiers, context: Context) {
Expand All @@ -92,7 +89,6 @@ export class SecurityToken extends Entity<Params> {
this.offerings = new Offerings(this, context);
this.permissions = new Permissions(this, context);
this.transfers = new Transfers(this, context);
this.restrictions = new Restrictions(this, context);
this.documents = new Documents(this, context);
}

Expand Down
@@ -1,8 +1,8 @@
import { ModuleName } from '@polymathnetwork/contract-wrappers';
import { ErrorCode } from '../../../types';
import { ModifyMaxHolderCount } from '../../../procedures';
import { SubModule } from '../SubModule';
import { PolymathError } from '../../../PolymathError';
import { ErrorCode } from '../../../../types';
import { ModifyMaxHolderCount } from '../../../../procedures';
import { SubModule } from '../../SubModule';
import { PolymathError } from '../../../../PolymathError';

export class CountRestrictions extends SubModule {
/**
Expand Down
Expand Up @@ -8,11 +8,11 @@ import {
ErrorCode,
PercentageWhitelistEntry,
ModifyPercentageExemptionsProcedureArgs,
} from '../../../types';
import { ModifyMaxHolderPercentage, ModifyPercentageExemptions } from '../../../procedures';
import { SubModule } from '../SubModule';
import { PolymathError } from '../../../PolymathError';
import { TransactionQueue } from '../../TransactionQueue';
} from '../../../../types';
import { ModifyMaxHolderPercentage, ModifyPercentageExemptions } from '../../../../procedures';
import { SubModule } from '../../SubModule';
import { PolymathError } from '../../../../PolymathError';
import { TransactionQueue } from '../../../TransactionQueue';

interface PercentageWhitelistParams {
whitelistEntries: PercentageWhitelistEntry[];
Expand Down
@@ -1,8 +1,8 @@
import { SubModule } from '../SubModule';
import { SubModule } from '../../SubModule';
import { CountRestrictions } from './CountRestrictions';
import { PercentageRestrictions } from './PercentageRestrictions';
import { SecurityToken } from '../SecurityToken';
import { Context } from '../../../Context';
import { SecurityToken } from '../../SecurityToken';
import { Context } from '../../../../Context';

export class Restrictions extends SubModule {
public count: CountRestrictions;
Expand Down
@@ -1,8 +1,19 @@
import { BigNumber } from '@polymathnetwork/contract-wrappers';
import { SubModule } from './SubModule';
import { ControllerTransfer, SetController } from '../../procedures';
import { SubModule } from '../SubModule';
import { ControllerTransfer, SetController } from '../../../procedures';
import { Restrictions } from './Restrictions';
import { SecurityToken } from '../SecurityToken';
import { Context } from '../../../Context';

export class Transfers extends SubModule {
public restrictions: Restrictions;

constructor(securityToken: SecurityToken, context: Context) {
super(securityToken, context);

this.restrictions = new Restrictions(securityToken, context);
}

/**
* Set the address of the Security Token's Controller. The controller may perform forced transfers
*/
Expand Down
1 change: 1 addition & 0 deletions src/entities/SecurityToken/Transfers/index.ts
@@ -0,0 +1 @@
export { Transfers } from './Transfers';

0 comments on commit c4585d5

Please sign in to comment.