generated from PolymeshAssociation/typescript-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(offerings): add
offerings.launchSto
method
Also improved the signature of `getPortfolio`
- Loading branch information
Showing
16 changed files
with
932 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,43 @@ | ||
import { Namespace, SecurityToken } from '~/internal'; | ||
import { Context, launchSto, LaunchStoParams, Namespace, SecurityToken, Sto } from '~/internal'; | ||
import { ProcedureMethod } from '~/types/internal'; | ||
import { createProcedureMethod } from '~/utils/internal'; | ||
|
||
/** | ||
* Handles all Security Token Offerings related functionality | ||
*/ | ||
export class Offerings extends Namespace<SecurityToken> {} | ||
export class Offerings extends Namespace<SecurityToken> { | ||
/** | ||
* @hidden | ||
*/ | ||
constructor(parent: SecurityToken, context: Context) { | ||
super(parent, context); | ||
|
||
const { ticker } = parent; | ||
|
||
this.launch = createProcedureMethod(args => [launchSto, { ticker, ...args }], context); | ||
} | ||
|
||
/** | ||
* Launch a Security Token Offering | ||
* | ||
* @param args.offeringPortfolio - portfolio in which the Tokens to be sold are stored | ||
* (optional, defaults to the default portfolio of the Security Token's Primary Issuance Agent) | ||
* @param args.raisingPorfolio - portfolio in which the raised funds will be stored | ||
* @param args.raisingCurrency - ticker symbol of the currency in which the funds are being raised (i.e. 'USD' or 'CAD'). | ||
* Other Security Tokens can be used as currency as well | ||
* @param args.venue - venue through which all offering related trades will be settled | ||
* (optional, defaults to the first `Sto` type Venue owned by the owner of the Offering Portfolio. | ||
* If passed, it must be of type `Sto`) | ||
* @param start - start date of the Offering (optional, defaults to right now) | ||
* @param end - end date of the Offering (optional, defaults to never) | ||
* @param tiers - array of sale tiers. Each tier consists of an amount of Tokens to be sold at a certain price. | ||
* Tokens in a tier can only be bought when all Tokens in previous tiers have been bought | ||
* @param minInvestment - minimum amount that can be spent on this offering | ||
* | ||
* @note required roles: | ||
* - Security Token Primary Issuance Agent | ||
* - Offering Portfolio Custodian | ||
* - Raising Portfolio Custodian | ||
*/ | ||
public launch: ProcedureMethod<LaunchStoParams, Sto>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
export interface Placeholder { | ||
foo: number; | ||
import BigNumber from 'bignumber.js'; | ||
|
||
export interface StoTier { | ||
amount: BigNumber; | ||
price: BigNumber; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.