### polymath.js

`v0.1.0`
Need help reading this?

## Contracts

### ContractWrapper

ContractWrapper is the base class for all contract wrappers in this library.

Methods
▸ unsubscribe

Unsubscribes from an event previously subscribed to on the contract.

unsubscribe(subscriptionID: string)
Parameters
subscriptionID `(string)` The subscription ID returned from the `subscribe` method
▸ unsubscribeAll

Unsubscribes from all events subscribed to on the contract.

unsubscribeAll()

### PolyToken

Wrapper for the PolyToken Solidity contract

Methods
▸ subscribe

Subscribes to events emitted by the contract.

subscribe(eventName: `Transfer` | `Approval`, indexedFilterValues: IndexedFilterValues, callback: EventCallback<PolyTokenEventArgs>): string
Parameters
eventName `(`Transfer` | `Approval`)` The name of the event to subscribe to
indexedFilterValues `(IndexedFilterValues)` Event argument values with which to filter logs
callback `(EventCallback<PolyTokenEventArgs>)` Callback to receive event logs
Returns
An identifier used to unsubscribe
▸ getLogs

Retrieves events emitted by this contract in an arbitrary block range.

getLogs(eventName: `Transfer` | `Approval`, indexedFilterValues: IndexedFilterValues, blockRange: BlockRange): Promise<Array<Log<PolyTokenEventArgs>>>
Parameters
eventName `(`Transfer` | `Approval`)` The name of the event to look for
indexedFilterValues `(IndexedFilterValues)` Event argument values with which to filter logs
blockRange `(BlockRange)` A range of blocks to look in. By default starts and ends at 'latest' block.
Returns
An array of logs
▸ getTotalSupply

Gets the total supply of POLY tokens.

getTotalSupply(): Promise<BigNumber>
Returns
Total supply in base units
▸ getDecimals

Gets the number of decimals the POLY token uses.

getDecimals(): Promise<number>
Returns
Number of decimals
▸ getSymbol

Gets the POLY token symbol (i.e. POLY).

getSymbol(): Promise<string>
Returns
The POLY token symbol
▸ getBalanceOf

Gets the account balance of `address`.

getBalanceOf(address: string): BigNumber
Parameters
address `(string)` The Ethereum address of the account
Returns
Account balance in base units
▸ transfer

Transfers `amount` POLY tokens from `fromAddress` to `toAddress`.

transfer(fromAddress: string, toAddress: string, amount: BigNumber)
Parameters
fromAddress `(string)` The Ethereum address of the account to withdraw from
toAddress `(string)` The Ethereum address of the account receiving POLY
amount `(BigNumber)` The amount, in base units, of POLY to transfer
▸ approve

Approves `spenderAddress` to withdraw `amount` POLY tokens from `ownerAddress`.

approve(ownerAddress: string, spenderAddress: string, amount: BigNumber)
Parameters
ownerAddress `(string)` The Ethereum address of the account setting the allowance
spenderAddress `(string)` The Ethereum address of the account approved to withdraw the allowance
amount `(BigNumber)` The amount, in base units, of POLY tokens that the spender will be able to withdraw
▸ getAllowance

Gets the amount of POLY tokens that `spenderAddress` is allowed to withdraw from `ownerAddress`.

getAllowance(ownerAddress: string, spenderAddress: string): Promise<BigNumber>
Parameters
ownerAddress `(string)` The Ethereum address that may be withdrawn from
spenderAddress `(string)` The Ethereum address that may spend the returned allowance
Returns
Amount of POLY allowed to be withdrawn, in base units
▸ transferFrom

Transfers `amount` POLY tokens from `fromAddress` to `toAddress` using `spenderAddress`'s previously approved allowance.

transferFrom(fromAddress: string, toAddress: string, spenderAddress: string, amount: BigNumber)
Parameters
fromAddress `(string)` The Ethereum address from which the POLY is withdrawn
toAddress `(string)` The Ethereum address receiving the POLY
spenderAddress `(string)` The Ethereum address that was approved to withdraw POLY
amount `(BigNumber)` The amount, in base units, of POLY to transfer

### Customers

Wrapper for the Customers Solidity contract

Methods
▸ subscribe

Subscribes to events emitted by the contract.

subscribe(eventName: `LogNewProvider` | `LogCustomerVerified`, indexedFilterValues: IndexedFilterValues, callback: EventCallback<CustomersEventArgs>): string
Parameters
eventName `(`LogNewProvider` | `LogCustomerVerified`)` The name of the event to subscribe to
indexedFilterValues `(IndexedFilterValues)` Event argument values with which to filter logs
callback `(EventCallback<CustomersEventArgs>)` Callback to receive event logs
Returns
An identifier used to unsubscribe
▸ getLogs

Retrieves events emitted by this contract in an arbitrary block range.

getLogs(eventName: `LogNewProvider` | `LogCustomerVerified`, indexedFilterValues: IndexedFilterValues, blockRange: BlockRange): Promise<Array<Log<CustomersEventArgs>>>
Parameters
eventName `(`LogNewProvider` | `LogCustomerVerified`)` The name of the event to look for
indexedFilterValues `(IndexedFilterValues)` Event argument values with which to filter logs
blockRange `(BlockRange)` A range of blocks to look in. By default starts and ends at 'latest' block.
Returns
An array of logs
▸ getKYCProviderByAddress

Retrieve a KYC provider by their Ethereum address

getKYCProviderByAddress(address: string): Promise<KYCProvider?>
Parameters
address `(string)` The Ethereum address of the KYC provider
Returns
The KYC provider, or null if none exists with the given address
▸ newKYCProvider

Turns the provided account into a KYC provider, withdrawing the required fee.

newKYCProvider(providerAddress: string, name: string, detailsHash: string, verificationFee: BigNumber)
Parameters
providerAddress `(string)` The Ethereum address of the account that you would like to turn into a KYC provider
name `(string)` The name attached to your KYC services
detailsHash `(string)` An SHA-256 hash of further information about your services
verificationFee `(BigNumber)` Your fee per customer verification
▸ changeVerificationFee

As a KYC provider, changes your fee per customer verification.

changeVerificationFee(kycProviderAddress: string, newVerificationFee: BigNumber)
Parameters
kycProviderAddress `(string)` The Ethereum address of the KYC provider account
newVerificationFee `(BigNumber)` The new fee in base units of POLY per customer verification
▸ verifyCustomer

Submit an on-chain record that you have verified a customer's information.

verifyCustomer(kycProviderAddress: string, customerAddress: string, countryJurisdiction: string, divisionJurisdiction: string, role: CustomerRole, accredited: boolean, expires: BigNumber)
Parameters
kycProviderAddress `(string)` The Ethereum address of your KYC provider account
customerAddress `(string)` The Ethereum address of the customer you verified
countryJurisdiction `(string)` The customer's jurisdiction that you verified. An ISO 3166-1 alpha-2 country code
divisionJurisdiction `(string)` The customer's jurisdiction that you verified. An ISO 3166-2 country subdivision code.
role `(CustomerRole)` The type of Polymath user that the customer is (e.g. investor)
accredited `(boolean)` Whether the customer is accredited
expires `(BigNumber)` The time at which this verification should expire, in seconds since the Unix epoch
▸ getCustomer

Retrieve a Polymath user by their associated KYC provider and their Ethereum address. Users can be associated with multiple KYC providers.

getCustomer(kycProviderAddress: string, customerAddress: string): Promise<Customer?>
Parameters
kycProviderAddress `(string)` The Ethereum address of the associated KYC provider
customerAddress `(string)` The Ethereum address of the user you're looking up
Returns
The user's `Customer` object

### Compliance

Wrapper for the Compliance Solidity contract

Methods
▸ subscribe

Subscribes to events emitted by the contract.

subscribe(eventName: `LogTemplateCreated` | `LogNewTemplateProposal` | `LogCancelTemplateProposal` | `LogNewContractProposal` | `LogCancelContractProposal`, indexedFilterValues: IndexedFilterValues, callback: EventCallback<ComplianceEventArgs>): string
Parameters
eventName `(`LogTemplateCreated` | `LogNewTemplateProposal` | `LogCancelTemplateProposal` | `LogNewContractProposal` | `LogCancelContractProposal`)` The name of the event to subscribe to
indexedFilterValues `(IndexedFilterValues)` Event argument values with which to filter logs
callback `(EventCallback<ComplianceEventArgs>)` Callback to receive event logs
Returns
An identifier used to unsubscribe
▸ getLogs

Retrieves events emitted by this contract in an arbitrary block range.

getLogs(eventName: `LogTemplateCreated` | `LogNewTemplateProposal` | `LogNewContractProposal`, indexedFilterValues: IndexedFilterValues, blockRange: BlockRange): Promise<Array<Log<ComplianceEventArgs>>>
Parameters
eventName `(`LogTemplateCreated` | `LogNewTemplateProposal` | `LogNewContractProposal`)` The name of the event to look for
indexedFilterValues `(IndexedFilterValues)` Event argument values with which to filter logs
blockRange `(BlockRange)` A range of blocks to look in. By default starts and ends at 'latest' block.
Returns
An array of logs
▸ createTemplate

Creates a new Template smart contract on the blockchain

createTemplate(legalDelegateAddress: string, offeringType: string, issuerJurisdiction: string, accredited: boolean, kycProviderAddress: string, details: string, expires: BigNumber, fee: BigNumber, quorum: BigNumber, vestingPeriod: BigNumber): Promise<string>
Parameters
legalDelegateAddress `(string)` Ethereum address of legal delegate creating the template
offeringType `(string)` What type of security the template is being created for
issuerJurisdiction `(string)` The jurisdiction ID the issuer resides in
accredited `(boolean)` Indicates if accreditation is required to buy this security
kycProviderAddress `(string)` Eth address of the KYC provider who will verify the investors
details `(string)` Hashed details of the offering requirements
expires `(BigNumber)` Timestamp of when the template will expire
fee `(BigNumber)` Amount of POLY to use the template (held in escrow until issuance)
quorum `(BigNumber)` Minimum percent of shareholders which need to vote to freeze
vestingPeriod `(BigNumber)` Length of time to vest funds
Returns
The address of the created template
▸ proposeTemplate

Allows a legal delegate to propose a template to a security token.

proposeTemplate(legalDelegateAddress: string, securityTokenAddress: string, templateAddress: string)
Parameters
legalDelegateAddress `(string)` Ethereum address of legal delegate creating the template
securityTokenAddress `(string)` Ethereum address of the security token the template is created for
templateAddress `(string)` Ethereum address of the template being proposed
▸ cancelTemplateProposal

Allows a legal delegate to cancle an already proposed template.

cancelTemplateProposal(proposalMakerAddress: string, securityTokenAddress: string, proposalIndex: number)
Parameters
proposalMakerAddress `(string)` Ethereum address of legal delegate who originally proposed the template
securityTokenAddress `(string)` Ethereum address of the security token the template is created for
proposalIndex `(number)` The offering proposal array index
▸ setSTO

Set an STO contract to be stored in the offerings mapping in Compliance.sol

setSTO(stoDeveloperAddress: string, stoAddress: string, fee: BigNumber, vestingPeriod: BigNumber, quorum: BigNumber)
Parameters
stoDeveloperAddress `(string)` Address of the creator of the STO
stoAddress `(string)` Address of the STO contract deployed over the network
fee `(BigNumber)` Fee to be paid in poly to use that contract
vestingPeriod `(BigNumber)` Number of days investor binded to hold the Security token
quorum `(BigNumber)` Minimum percent of shareholders which need to vote to freeze
▸ proposeSTO

Propose a Security Token Offering Contract for an issuance

proposeSTO(stoCreatorAddress: string, securityTokenAddress: string, stoContractAddress: string)
Parameters
stoCreatorAddress `(string)` Address of the STO developer
securityTokenAddress `(string)` Address of the security token deployed over the network
stoContractAddress `(string)` Address of the STO contract deployed over the network
▸ cancelSTOProposal

Allows an STO developer to cancle an already proposed STO.

cancelSTOProposal(proposalMakerAddress: string, securityTokenAddress: string, offeringIndex: number)
Parameters
proposalMakerAddress `(string)` Ethereum address of STO developer who originally proposed the template
securityTokenAddress `(string)` Ethereum address of the security token the template is created for
offeringIndex `(number)` The STO proposal array index
▸ getTemplateAddressByProposal

Get the template address for a security token by passing its proposal index.

getTemplateAddressByProposal(securityTokenAddress: string, proposalIndex: number): Promise<string>
Parameters
securityTokenAddress `(string)` Ethereum address of the security token the template is created for
proposalIndex `(number)` The template proposal array index
Returns
The template address
▸ getSTOAddressByProposal

Get the STO address for a security token by passing its proposal index.

getSTOAddressByProposal(securityTokenAddress: string, proposalIndex: number): Promise<string>
Parameters
securityTokenAddress `(string)` Ethereum address of the security token the STO is created for
proposalIndex `(number)` The STO proposal array index
Returns
The template address
▸ getSTOProposal

Get an STO that has been proposed for a security token by passing its offering index.

getSTOProposal(securityTokenAddress: string, offeringIndex: string): Promise<STOProposal>
Parameters
securityTokenAddress `(string)` Ethereum address of the security token the STO is created for
offeringIndex `(string)` The STO proposal array index
Returns
The type Offering .
▸ getMinimumVestingPeriod

Returns the minimum vesting period for POLY earned.

getMinimumVestingPeriod(): Promise<BigNumber>
Returns
Minimum vesting period.
▸ getTemplateReputation

Get the Template reputation details.

getTemplateReputation(templateAddress: string): Promise<TemplateReputation>
Parameters
templateAddress `(string)` Ethereum address of the template on the EVM
Returns
The type TemplateReputation .
▸ getAllTemplateProposals

Returns all Template proposals

getAllTemplateProposals(securityTokenAddress: string, SecurityTokenAddress: any): Promise<Array<string>>
Parameters
securityTokenAddress `(string)`
SecurityTokenAddress `(any)` Address of the Security Token
Returns
An array of addresses
▸ getAllOfferingProposals

Returns all STO proposal addresses

getAllOfferingProposals(securityTokenAddress: string, SecurityTokenAddress: any): Promise<Array<string>>
Parameters
securityTokenAddress `(string)`
SecurityTokenAddress `(any)` Address of the Security Token
Returns
An array of addresses

### SecurityToken

Wrapper for the SecurityToken Solidity contract

Methods
▸ subscribe

Subscribes to events emitted by the contract.

subscribe(eventName: `LogTemplateSet` | `LogUpdatedComplianceProof` | `LogSetSTOContract` | `LogNewWhitelistedAddress` | `LogNewBlacklistedAddress` | `LogVoteToFreeze` | `LogTokenIssued`, indexedFilterValues: IndexedFilterValues, callback: EventCallback<SecurityTokenEventArgs>): string
Parameters
eventName `(`LogTemplateSet` | `LogUpdatedComplianceProof` | `LogSetSTOContract` | `LogNewWhitelistedAddress` | `LogNewBlacklistedAddress` | `LogVoteToFreeze` | `LogTokenIssued`)` The name of the event to subscribe to
indexedFilterValues `(IndexedFilterValues)` Event argument values with which to filter logs
callback `(EventCallback<SecurityTokenEventArgs>)` Callback to receive event logs
Returns
An identifier used to unsubscribe
▸ getLogs

Retrieves events emitted by this contract in an arbitrary block range.

getLogs(eventName: `LogTemplateSet` | `LogUpdatedComplianceProof` | `LogSetSTOContract` | `LogNewWhitelistedAddress` | `LogVoteToFreeze` | `LogTokenIssued`, indexedFilterValues: IndexedFilterValues, blockRange: BlockRange): Promise<Array<Log<SecurityTokenEventArgs>>>
Parameters
eventName `(`LogTemplateSet` | `LogUpdatedComplianceProof` | `LogSetSTOContract` | `LogNewWhitelistedAddress` | `LogVoteToFreeze` | `LogTokenIssued`)` The name of the event to look for
indexedFilterValues `(IndexedFilterValues)` Event argument values with which to filter logs
blockRange `(BlockRange)` A range of blocks to look in. By default starts and ends at 'latest' block.
Returns
An array of logs
▸ getName

Gets the name of the security token.

getName(): Promise<string>
Returns
Name of security token
▸ getSymbol

Gets the security token ticker symbol.

getSymbol(): Promise<string>
Returns
Ticker symbol
▸ getOwnerAddress

Gets the address of the security token contract owner.

getOwnerAddress(): Promise<string>
Returns
The token owner address
▸ getTotalSupply

Gets the total supply of tokens.

getTotalSupply(): Promise<BigNumber>
Returns
Total supply in base units
▸ getDelegateAddress

Gets the delegate address if set.

getDelegateAddress(): Promise<string?>
Returns
If set, the delegate address. Otherwise null
▸ getMerkleRoot

Gets the compliance proof hash.

getMerkleRoot(): Promise<string>
Returns
Compliance proof hash
▸ getKYCProviderAddress

Gets the KYC address if set.

getKYCProviderAddress(): Promise<string>
Returns
If set, the KYC address. Otherwise null
▸ getSTOContractAddress

Gets the STO contract address if set.

getSTOContractAddress(): Promise<string>
Returns
If set, the STO contract address. Otherwise null
▸ getMaximumPOLYContribution

Gets the Max Poly contribution allowed for the security token.

getMaximumPOLYContribution(): Promise<BigNumber>
Returns
Max poly allowed.
▸ getSTOStart

Gets the STO start time as a unix timestamp.

getSTOStart(): Promise<BigNumber>
Returns
The start time
▸ getSTOEnd

Gets the STO end time as a unix timestamp.

getSTOEnd(): Promise<BigNumber>
Returns
The end time
▸ getOfferingStatus

Gets the boolean value of the hasOfferingStarted.

getOfferingStatus(): Promise<string>
Returns
The bool value
▸ updateComplianceProof

Update compliance proof hash for the issuance

updateComplianceProof(ownerOrLegalDelegateAddress: string, newMerkleRoot: string, merkleRoot: string)
Parameters
ownerOrLegalDelegateAddress `(string)` Owner or legal delegate address which have access to update the contract
newMerkleRoot `(string)` New merkle root hash of the compliance Proofs
merkleRoot `(string)` Compliance Proof hash
▸ selectTemplate

Select a proposed template for the issuance

selectTemplate(ownerAddress: string, templateIndex: number)
Parameters
ownerAddress `(string)` Owner address who can select the template
templateIndex `(number)` Array index of the delegates proposed template
▸ selectSTOProposal

Select an security token offering proposal for the issuance

selectSTOProposal(delegateAddress: string, proposalIndex: number, offeringProposalIndex: any)
Parameters
delegateAddress `(string)` Delegate address of the choosen template
proposalIndex `(number)`
offeringProposalIndex `(any)` Array index of the STO proposal
▸ startSecurityTokenOffering

Start the Offering after the template and STO selection

startSecurityTokenOffering(owner: string)
Parameters
owner `(string)` Address of the Owner of a Security Token
▸ addToWhitelist

Add a verified address to the Security Token whitelist

addToWhitelist(owner: string, investorAddress: string)
Parameters
owner `(string)` Owner of the security token contract
investorAddress `(string)` Investor address to whitelist
▸ withdrawPoly

Allow POLY allocations to be withdrawn by owner, delegate, and the STO auditor at appropriate times

withdrawPoly(address: string): Promise<boolean>
Parameters
address `(string)` User withdrawing their POLY
Returns
▸ voteToFreeze

Voting to freeze the funds of the recipient address

voteToFreeze(shareHolderAddress: string, recipientAddress: string)
Parameters
shareHolderAddress `(string)` shareholder of the security token
recipientAddress `(string)` User who is getting voted agaisnt to freeze their POLY
▸ getTokenDetails

Get security token details

getTokenDetails(): Promise<TokenDetails>
Returns
Return the template address, the delegate address, the compliance proof, the STO creator address and the KYC provider address
▸ getBalanceOf

Gets the account balance of `address`.

getBalanceOf(address: string): BigNumber
Parameters
address `(string)` The Ethereum address of the account
Returns
Account balance
▸ transfer

Transfers `amount` security tokens from `fromAddress` to `toAddress`.

transfer(fromAddress: string, toAddress: string, amount: BigNumber)
Parameters
fromAddress `(string)` The Ethereum address of the account to withdraw from
toAddress `(string)` The Ethereum address of the account receiving tokens
amount `(BigNumber)` The number of tokens to transfer
▸ approve

Approves `spenderAddress` to withdraw `amount` security tokens from `ownerAddress`.

approve(ownerAddress: string, spenderAddress: string, amount: Promise<BigNumber>)
Parameters
ownerAddress `(string)` The Ethereum address of the account setting the allowance
spenderAddress `(string)` The Ethereum address of the account approved to withdraw the allowance
amount `(Promise<BigNumber>)` The number of tokens the spender will be able to withdraw
▸ getAllowance

Gets the number of security tokens that `spenderAddress` is allowed to withdraw from `ownerAddress`.

getAllowance(ownerAddress: string, spenderAddress: string): Promise<BigNumber>
Parameters
ownerAddress `(string)` The Ethereum address that may be withdrawn from
spenderAddress `(string)` The Ethereum address that may spend the returned allowance
Returns
Number of tokens to be withdrawn
▸ transferFrom

Transfers `amount` security tokens from `fromAddress` to `toAddress` using `spenderAddress`'s previously approved allowance.

transferFrom(fromAddress: string, toAddress: string, spenderAddress: string, amount: BigNumber)
Parameters
fromAddress `(string)` The Ethereum address from which the tokens are withdrawn
toAddress `(string)` The Ethereum address receiving the tokens
spenderAddress `(string)` The Ethereum address that was approved to withdraw tokens
amount `(BigNumber)` The number of security tokens to transfer
▸ getDecimals

Amount of decimals the security token is divisable by.

getDecimals(): Promise<number>
Returns
The number of decimals
▸ isSTOProposed

Returns if the STO is propsed or not

isSTOProposed(): Promise<boolean>
Returns
Returns true if it has been proposed.
▸ tokensIssuedBySTO

Gets how many security tokens have been issued so far for the security token offering

tokensIssuedBySTO(): Promise<BigNumber>
Returns
The number of tokens issued.
▸ getShareholderDetails

Queries the shareholder details.

getShareholderDetails(shareholderAddress: string): Promise<Shareholder>
Parameters
shareholderAddress `(string)`
Returns
Returns the type Shareholder
▸ getPolyAllocationDetails

Queries the POLY allocation details, which cover the rules determining if the stakeholder will receive their POLY vesting.

getPolyAllocationDetails(polyStakeholderAddress: string): Promise<PolyAllocation>
Parameters
polyStakeholderAddress `(string)` The address of the stakeholder
Returns
Returns the type PolyAllocation
▸ getContributedToSTO

Checks to see how much a shareholder has contributed to the Security token.

getContributedToSTO(contributorAddress: string): Promise<BigNumber>
Parameters
contributorAddress `(string)` The address of the contributor
Returns
The amount the user has contributed contributed
▸ getVoted

Get information on if a shareholder has voted to freeze a POLY allocation.

getVoted(userAddress: string, addressBeingVotedOn: string): Promise<boolean>
Parameters
userAddress `(string)` The address of the user who wants to vote
addressBeingVotedOn `(string)` The stakeholder who is being voted agaisnt
Returns
True if the shareholder has voted to freeze
▸ startOffering

Call to start the security token offering contract.

startOffering(ownerAddress: string)
Parameters
ownerAddress `(string)` The owner of the SecurityToken contract is the only one who can start the offering
▸ addToBlacklist

Add a verified address to the Security Token blacklist

addToBlacklist(ownerAddress: string, blacklistAddress: string, owner: any)
Parameters
ownerAddress `(string)`
blacklistAddress `(string)` The address being added to the blacklist
owner `(any)` Owner of the security token contract

### SecurityTokenRegistrar

Wrapper for the SecurityTokenRegistrar Solidity contract

Methods
▸ subscribe

Subscribes to events emitted by the contract.

subscribe(eventName: `LogNewSecurityToken`, indexedFilterValues: IndexedFilterValues, callback: EventCallback<SecurityTokenRegistrarEventArgs>): string
Parameters
eventName `(`LogNewSecurityToken`)` The name of the event to subscribe to
indexedFilterValues `(IndexedFilterValues)` Event argument values with which to filter logs
callback `(EventCallback<SecurityTokenRegistrarEventArgs>)` Callback to receive event logs
Returns
An identifier used to unsubscribe
▸ getLogs

Retrieves events emitted by this contract in an arbitrary block range.

getLogs(eventName: `LogNewSecurityToken`, indexedFilterValues: IndexedFilterValues, blockRange: BlockRange): Promise<Array<Log<SecurityTokenRegistrarEventArgs>>>
Parameters
eventName `(`LogNewSecurityToken`)` The name of the event to look for
indexedFilterValues `(IndexedFilterValues)` Event argument values with which to filter logs
blockRange `(BlockRange)` A range of blocks to look in. By default starts and ends at 'latest' block.
Returns
An array of logs
▸ createSecurityToken

Creates a security token and stores it in the security token registry. Returns a promise of true it the security token was successfully created. This is done by event watching for the event LogNewSecurityToken().

createSecurityToken(creator: string, name: string, ticker: string, totalSupply: BigNumber, decimals: number, owner: string, maxPoly: BigNumber, host: string, fee: BigNumber, type: number, lockupPeriod: BigNumber, quorum: number)
Parameters
creator `(string)` The address from which the token is created
name `(string)` Name of the security token
ticker `(string)` Ticker name of the security
totalSupply `(BigNumber)` Total amount of tokens being created
decimals `(number)` The number of decimal places that the tokens can be split up into
owner `(string)` Public Key address of the security token owner
maxPoly `(BigNumber)` Amount of POLY being raised
host `(string)` The host of the security token wizard
fee `(BigNumber)` POLY Fee being requested by the wizard host
type `(number)` Type of security being tokenized (NEED TOKEN NUMBERS ie. security:1, somethingelse:2)
lockupPeriod `(BigNumber)` Length of time (unix) raised POLY will be locked up for dispute
quorum `(number)` Percent of initial investors required to freeze POLY raise
▸ getSecurityTokenData

Getter function for ST data by passing the address as the argument.

getSecurityTokenData(tokenAddress: string): Promise<SecurityTokenData>
Parameters
tokenAddress `(string)` Address of the security token
Returns
The security token data
▸ getSecurityTokenAddress

Getter function for ST addresses by passing the ticker/symbol as the argument.

getSecurityTokenAddress(ticker: string): Promise<string>
Parameters
ticker `(string)` The security token ticker
Returns
The security token address
▸ getPolyTokenAddress

Getter function for the state variable in the registrar for the polytoken address

getPolyTokenAddress(): Promise<string>
Returns
The address of polyToken on the blockchain that the registrar is connected to
▸ getCustomersAddress

Getter function for the state variable in the registrar for the customers address

getCustomersAddress(): Promise<string>
Returns
The address of customers on the blockchain that the registrar is connected to
▸ getComplianceAddress

Getter function for the state variable in the registrar for the compliance address

getComplianceAddress(): Promise<string>
Returns
The address of compliance on the blockchain that the registrar is connected to

### Template

Wrapper for the Template Solidity contract

Methods
▸ subscribe

Subscribes to events emitted by the contract.

subscribe(eventName: `DetailsUpdated`, indexedFilterValues: IndexedFilterValues, callback: EventCallback<DetailsUpdated>): string
Parameters
eventName `(`DetailsUpdated`)` The name of the event to subscribe to
indexedFilterValues `(IndexedFilterValues)` Event argument values with which to filter logs
callback `(EventCallback<DetailsUpdated>)` Callback to receive event logs
Returns
An identifier used to unsubscribe
▸ getLogs

Retrieves events emitted by this contract in an arbitrary block range.

getLogs(eventName: `DetailsUpdated`, indexedFilterValues: IndexedFilterValues, blockRange: BlockRange): Promise<Array<Log<DetailsUpdated>>>
Parameters
eventName `(`DetailsUpdated`)` The name of the event to look for
indexedFilterValues `(IndexedFilterValues)` Event argument values with which to filter logs
blockRange `(BlockRange)` A range of blocks to look in. By default starts and ends at 'latest' block.
Returns
An array of logs
▸ addJurisdiction

Add a jurisdiction to the Security token that indicates investors in that jurisdiction are allowed to purchase this security token.

addJurisdiction(legalDelegateAddress: string, allowedJurisdictions: Array<string>, allowed: Array<boolean>)
Parameters
legalDelegateAddress `(string)` The Ethereum address of the legal delegate who made the template
allowedJurisdictions `(Array<string>)` An array of strings (solidity type bytes32) that represent the jurisdiction
allowed `(Array<boolean>)` An array of whether the jurisdiction is allowed to purchase the security or not
▸ addDivisionJurisdiction

Add a jurisdiction division to the Security token that indicates investors in that division are allowed to purchase this security token.

addDivisionJurisdiction(legalDelegateAddress: string, allowedDivisionJurisdictions: Array<string>, allowed: Array<boolean>)
Parameters
legalDelegateAddress `(string)` The Ethereum address of the legal delegate who made the template
allowedDivisionJurisdictions `(Array<string>)` An array of strings (solidity type bytes32) that represent the jurisdiction divisiom
allowed `(Array<boolean>)` An array of whether the division is allowed to purchase the security or not
▸ addRoles

Allows the adding of new roles to be added to whitelist

addRoles(legalDelegateAddress: string, allowedRoles: Array<string>)
Parameters
legalDelegateAddress `(string)` The Ethereum address of the legal delegate who made the template
allowedRoles `(Array<string>)` An array of strings that adds new roles to the whitelist
▸ updateTemplateDetails

Allows the legal delegate to update the hash of the details of the template that is stored off the blockchain.

updateTemplateDetails(legalDelegateAddress: string, details: string): Promise<string | boolean>
Parameters
legalDelegateAddress `(string)` The Ethereum address of the legal delegate who made the template
details `(string)` Hash of the new details documentation (solidity type bytes32)
Returns
True in case of success, string error in case of fail
▸ finalizeTemplate

Allows the legal delegate to finalize the template.

finalizeTemplate(legalDelegateAddress: string): Promise<string | boolean>
Parameters
legalDelegateAddress `(string)` The Ethereum address of the legal delegate who made the template
Returns
True in case of success, string error in case of fail
▸ checkTemplateRequirements

Checks if the template requirements for jurisdiction, accreditation, and role are met.

checkTemplateRequirements(countryJurisdiction: string, divisionJurisdiction: string, accredited: boolean, role: string): Promise<boolean>
Parameters
countryJurisdiction `(string)` The customer's jurisdiction that you verified. An ISO 3166-1 alpha-2 country code
divisionJurisdiction `(string)` The customer's jurisdiction that you verified. An ISO 3166-2 country subdivision code.
accredited `(boolean)` Defines if the investor is accredited or not
role `(string)` Role string used to see if the role is allowed for a security token (solidity type uint8)
Returns
True if it all template requirements are met
▸ getTemplateDetails

Get the template details, which is a hash that points to a document off the blockchain with more detailed information on the template.It also returns the finalization status of the template

getTemplateDetails(): Promise<Array<any>>
Returns
An array [ details, finalized ] , where details is a string and finalized is a boolean
▸ getTemplateUsageDetails

Gets multiple usage details for the template bignumber, number, bignumber, string, string

getTemplateUsageDetails(): Promise<Array<any>>
Returns
An array of details for the template being used.
▸ getOfferingType

Returns what type of offering the Security Token is by calling the state variable .

getOfferingType(): Promise<string>
Returns
The type of offering of the Security token (solidity type string).
▸ getIssuerJurisdiction

Returns the issuers jurisdiction by calling the state variable.

getIssuerJurisdiction(): Promise<string>
Returns
The issuer jurisdiction code (solidity type bytes32)
▸ checkIfCountryJurisdictionIsAllowed

Checks if the jurisdiction is allowed for this template

checkIfCountryJurisdictionIsAllowed(countryJurisdiction: string): Promise<boolean>
Parameters
countryJurisdiction `(string)` The customer's jurisdiction that you verified. An ISO 3166-1 alpha-2 country code
Returns
True if the jurisdiction is allowed
▸ checkIfDivisionJurisdictionIsAllowed

Checks if the jurisdiction division is allowed for this template

checkIfDivisionJurisdictionIsAllowed(divisionJurisdiction: string): Promise<boolean>
Parameters
divisionJurisdiction `(string)` The customer's jurisdiction that you verified. An ISO 3166-2 country subdivision code.
Returns
True if the division is allowed
▸ checkIfRoleIsAllowed

Checks if a role is allowed for the template

checkIfRoleIsAllowed(role: number): Promise<boolean>
Parameters
role `(number)` The role we are checking
Returns
True if the role is allowed
▸ checkIfAccreditationIsRequired

Checks for investor accreditation

checkIfAccreditationIsRequired(): Promise<boolean>
Returns
True if the template does require investors to be accredited
▸ getTemplateExpiry

Returns when the template expires by calling the state variable

getTemplateExpiry(): Promise<BigNumber>
Returns
A BigNumber object representing the UNIX time the template expires (solidity type uint256)

## Types

### Web3Provider

A Web3 provider

Web3.Provider

### Web3Filter

A Web3 filter

Filter

### IndexedFilterValues

Argument values for filtering event logs

{
filterValues: Array<string> | Array<BigNumber>
}

### EventCallback

Callback for event logs

function (err: Error?, log: Log<LogArgs>): void

### BlockRange

A range of blocks on the blockchain

{
fromBlock: number | string?,
toBlock: number | string?
}

### Log

An event log

{
args: LogArgs,
address: string,
blockHash: string?,
blockNumber: number?,
data: string,
event: string,
logIndex: number?,
topics: Array<string>,
transactionHash: string,
transactionIndex: number?
}

### TransferEventArgs

Arguments for the PolyToken Transfer event

{
_from: string,
_to: string,
_value: BigNumber
}

### ApprovalEventArgs

Arguments for the PolyToken Approval event

{
_owner: string,
_spender: string,
_value: BigNumber
}

### PolyTokenEventArgs

Arguments for the PolyToken events

TransferEventArgs | ApprovalEventArgs

### CustomerRole

An enum of the types of `Customer`

`investor` | `issuer` | `delegate` | `marketmaker`

### Customer

A user of the Polymath platform

{
jurisdiction: string,
accredited: boolean,
role: CustomerRole,
verified: boolean,
expires: BigNumber
}

### KYCProvider

A KYC provider

{
name: string,
joined: BigNumber,
detailsHash: string,
verificationFee: BigNumber,
active: boolean
}

### LogNewProviderArgs

Arguments for the Customers LogNewProvider event

{
providerAddress: string,
name: string,
details: string
}

### LogCustomerVerifiedArgs

Arguments for the Customers LogCustomerVerified event

{
customer: string,
provider: string,
role: CustomerRole
}

### CustomersEventArgs

Arguments for the Customers events

LogNewProviderArgs | LogCustomerVerifiedArgs

### STOProposal

STOProposal struct from Compliance.sol

{
stoContractAddress: string,
auditorAddress: string,
vestingPeriod: BigNumber,
quorum: BigNumber,
fee: BigNumber
}

### TemplateReputation

TemplateReputation struct from Compliance.sol

{
owner: string,
totalRaised: BigNumber,
timesUsed: BigNumber,
expires: BigNumber
}

### LogTemplateCreated

Arguments for the Compliance.sol LogTemplateCreated event

{
creator: string,
_template: string,
_offeringType: string
}

### LogNewTemplateProposal

Arguments for the Compliance.sol LogNewTemplateProposal event

{
_securityToken: string,
_template: string,
_delegate: string,
_templateProposalIndex: number
}

### LogCancelTemplateProposal

Arguments for the Compliance.sol LogCancelTemplateProposal event

{
_securityToken: string,
_offeringContract: string,
_proposalIndex: number
}

### LogNewContractProposal

Arguments for the Compliance.sol LogNewContractProposal event

{
_securityToken: string,
_offeringContract: string,
_auditor: string,
_offeringProposalIndex: number
}

### LogCancelContractProposal

Arguments for the Compliance.sol LogCancelContractProposal event

{
_securityToken: string,
_offeringContract: string,
_proposalIndex: number
}

### ComplianceEventArgs

Arguments for the Compliance events

LogTemplateCreated | LogNewTemplateProposal | LogCancelTemplateProposal | LogNewContractProposal | LogCancelContractProposal

### TokenDetails

Token details gathered from SecurityToken.sol

{
templateAddress: string,
delegateAddress: string,
merkleRoot: string,
STO: string,
KYC: string
}

### PolyAllocation

PolyAllocation struct from SecurityToken.sol

{
amount: BigNumber,
vestingPeriod: BigNumber,
quorum: number,
yayVotes: BigNumber,
yayPercent: BigNumber,
frozen: boolean
}

### Shareholder

Shareholder struct from SecurityToken.sol

{
verifier: string,
allowed: boolean,
role: number
}

### LogTemplateSet

Arguments for the SecurityToken.sol LogTemplateSet event

{
_delegateAddress: string,
_template: string,
_KYC: string
}

### LogUpdatedComplianceProof

Arguments for the SecurityToken.sol LogUpdatedComplianceProof event

{
merkleRoot: string,
_complianceProofHash: string
}

### LogSetSTOContract

Arguments for the SecurityToken.sol LogSetSTOContract event

{
_STO: string,
_STOtemplate: string,
_auditor: string,
_startTime: BigNumber,
_endTime: BigNumber
}

### LogNewWhitelistedAddress

Arguments for the SecurityToken.sol LogNewWhitelistedAddress event

{
_KYC: string,
_shareholder: string,
_role: CustomerRole
}

### LogNewBlacklistedAddress

Arguments for the SecurityToken.sol LogNewBlacklistedAddress event

{
_KYC: string,
_shareholder: string
}

### LogVoteToFreeze

Arguments for the SecurityToken.sol LogVoteToFreeze event

{
_recipient: string,
_yayPercent: BigNumber,
quorum: BigNumber,
_frozen: boolean
}

### LogTokenIssued

Arguments for the SecurityToken.sol LogTokenIssued event

{
_contributor: string,
_stAmount: BigNumber,
_polyContributed: BigNumber,
_timestamp: BigNumber
}

### SecurityTokenEventArgs

Arguments for the SecurityToken events

LogTemplateSet | LogUpdatedComplianceProof | LogSetSTOContract | LogNewWhitelistedAddress | LogNewBlacklistedAddress | LogVoteToFreeze | LogTokenIssued

### SecurityTokenData

SecurityTokenData struct from SecurityTokenRegistrar.sol

{
totalSupply: BigNumber,
owner: string,
ticker: string,
securityType: number
}

### LogNewSecurityToken

Arguments for the SecurityTokenRegistrar.sol LogNewSecurityToken event

{
ticker: string,
securityTokenAddress: string,
owner: string,
host: string,
fee: BigNumber,
_type: Number
}

### SecurityTokenRegistrarEventArgs

Arguments for the SecurityTokenRegistrar events

LogNewSecurityToken

### LogBoughtSecurityToken

Arguments for the STOContract.sol LogBoughtSecurityToken event

{
_contributor: string,
_ployContribution: BigNumber,
_timestamp: BigNumber
}

### DetailsUpdated

Arguments for the Template.sol DetailsUpdated event

{
previousDetails: string,
newDetails: string,
updateDate: BigNumber
}