api.entities.Offering - PolymeshAssociation/polymesh-sdk GitHub Wiki

@polymeshassociation/polymesh-sdk / api/entities/Offering

api/entities/Offering

Classes

Offering

Defined in: api/entities/Offering/index.ts:67

Represents an Asset Offering in the Polymesh blockchain

Extends

Properties

asset

asset: FungibleAsset

Defined in: api/entities/Offering/index.ts:86

Asset being offered

id

id: BigNumber

Defined in: api/entities/Offering/index.ts:81

identifier number of the Offering

uuid

uuid: string

Defined in: api/entities/Entity.ts:46

Inherited from

Entity.uuid

Methods

close()

close(opts?): Promise<GenericPolymeshTransaction<void, void>>

Defined in: api/entities/Offering/index.ts:202

Close the Offering

Parameters
Parameter Type
opts? ProcedureOpts
Returns

Promise<GenericPolymeshTransaction<void, void>>

Note

this method is of type NoArgsProcedureMethod, which means you can call close.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

details()
Call Signature

details(): Promise<OfferingDetails>

Defined in: api/entities/Offering/index.ts:141

Retrieve the Offering's details

Returns

Promise<OfferingDetails>

Promise that resolves to the Offering details

Call Signature

details(callback): Promise<UnsubCallback>

Defined in: api/entities/Offering/index.ts:152

Retrieve the Offering's details (with subscription support)

Parameters
Parameter Type Description
callback SubCallback<OfferingDetails> Callback function that receives offering detail updates
Returns

Promise<UnsubCallback>

Promise that resolves to an unsubscribe function

Note

can be subscribed to, if connected to node using a web socket

enableOffChainFunding()

enableOffChainFunding(args, opts?): Promise<GenericPolymeshTransaction<void, void>>

Defined in: api/entities/Offering/index.ts:222

Enable off-chain funding for the Offering

Parameters
Parameter Type
args EnableOffChainFundingParams
opts? ProcedureOpts
Returns

Promise<GenericPolymeshTransaction<void, void>>

Throws

if:

  • Trying to enable off-chain funding on an Offering that does not exist
  • Trying to enable off-chain funding on an Offering that has already ended
  • Trying to enable off-chain funding on an Offering that is already closed
Note

this method is of type ProcedureMethod, which means you can call enableOffChainFunding.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

exists()

exists(): Promise<boolean>

Defined in: api/entities/Offering/index.ts:330

Determine whether this Offering exists on chain

Returns

Promise<boolean>

Overrides

Entity.exists

freeze()

freeze(opts?): Promise<GenericPolymeshTransaction<Offering, Offering>>

Defined in: api/entities/Offering/index.ts:207

Freeze the Offering

Parameters
Parameter Type
opts? ProcedureOpts
Returns

Promise<GenericPolymeshTransaction<Offering, Offering>>

Note

this method is of type NoArgsProcedureMethod, which means you can call freeze.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

generateOffChainFundingReceipt()

generateOffChainFundingReceipt(args): Promise<OffChainFundingReceipt>

Defined in: api/entities/Offering/index.ts:380

Generate an off-chain funding receipt for this offering

Parameters
Parameter Type Description
args { amount: BigNumber; expiresAt: Date; metadata?: string; offChainTicker: string; sender: string | Identity; signer?: string | Account; signerKeyRingType?: SignerKeyRingType; uid: BigNumber; } -
args.amount BigNumber equivalent investment amount in the raising asset (calculated from the off-chain asset value based on STO tier pricing)
args.expiresAt Date timestamp at which the receipt expires and can no longer be used to invest
args.metadata? string (optional) additional metadata to be associated with the receipt
args.offChainTicker string ticker symbol of the off-chain asset being transferred (e.g., 'BTC', 'ETH')
args.sender string | Identity Identity or DID of the investor providing the off-chain funding
args.signer? string | Account (optional) authorized venue receipt signer to generate the cryptographic signature. Defaults to signing Account associated with the SDK
args.signerKeyRingType? SignerKeyRingType (optional) keyring type for signature generation. Defaults to 'Sr25519'. Supported types: SR25519, ED25519, ECDSA
args.uid BigNumber unique receipt ID (UID) for this off-chain funding transaction
Returns

Promise<OffChainFundingReceipt>

Note

The generated receipt contains SCALE-encoded data wrapped with <Bytes> tags, including:

  • Chain genesis hash
  • Receipt UID
  • Receipt label
  • Receipt expiry
  • Fundraiser ID
  • Sender's DID (investor)
  • Receiver's DID (raising portfolio owner)
  • Off-chain asset ticker
  • Equivalent investment amount in raising asset (calculated from STO tier pricing)
Note

The amount must represent the exact investment cost as calculated by the STO's blended pricing mechanism

getInvestments()

getInvestments(opts?): Promise<ResultSet<Investment>>

Defined in: api/entities/Offering/index.ts:252

Retrieve all investments made on this Offering

Parameters
Parameter Type Description
opts { size?: BigNumber; start?: BigNumber; } -
opts.size? BigNumber page size
opts.start? BigNumber page offset
Returns

Promise<ResultSet<Investment>>

Note

supports pagination

Note

uses the middleware V2

invest()

invest(args, opts?): Promise<GenericPolymeshTransaction<void, void>>

Defined in: api/entities/Offering/index.ts:241

Invest in the Offering

Parameters
Parameter Type
args object & { fundingPortfolio: PortfolioLike; } | { offChainFundingReceipt: OffChainFundingReceipt; offChainTicker: string; }
opts? ProcedureOpts
Returns

Promise<GenericPolymeshTransaction<void, void>>

Note

required roles:

  • Purchase Portfolio Custodian
  • Funding Portfolio Custodian
Note

this method is of type ProcedureMethod, which means you can call invest.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

isEqual()

isEqual(entity): boolean

Defined in: api/entities/Entity.ts:61

Determine whether this Entity is the same as another one

Parameters
Parameter Type
entity Entity<unknown, unknown>
Returns

boolean

Inherited from

Entity.isEqual

modifyTimes()

modifyTimes(args, opts?): Promise<GenericPolymeshTransaction<void, void>>

Defined in: api/entities/Offering/index.ts:232

Modify the start/end time of the Offering

Parameters
Parameter Type
args ModifyOfferingTimesParams
opts? ProcedureOpts
Returns

Promise<GenericPolymeshTransaction<void, void>>

Throws

if:

  • Trying to modify the start time on an Offering that already started
  • Trying to modify anything on an Offering that already ended
  • Trying to change start or end time to a past date
Note

this method is of type ProcedureMethod, which means you can call modifyTimes.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

offChainFundingDetails()

offChainFundingDetails(): Promise<OffChainFundingDetails>

Defined in: api/entities/Offering/index.ts:303

Retrieve off chain funding details

Returns

Promise<OffChainFundingDetails>

toHuman()

toHuman(): HumanReadable

Defined in: api/entities/Offering/index.ts:346

Return the Offering's ID and Asset ticker

Returns

HumanReadable

Overrides

Entity.toHuman

unfreeze()

unfreeze(opts?): Promise<GenericPolymeshTransaction<Offering, Offering>>

Defined in: api/entities/Offering/index.ts:212

Unfreeze the Offering

Parameters
Parameter Type
opts? ProcedureOpts
Returns

Promise<GenericPolymeshTransaction<Offering, Offering>>

Note

this method is of type NoArgsProcedureMethod, which means you can call unfreeze.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

generateUuid()

static generateUuid<Identifiers>(identifiers): string

Defined in: api/entities/Entity.ts:14

Generate the Entity's UUID from its identifying properties

Type Parameters
Type Parameter
Identifiers
Parameters
Parameter Type Description
identifiers Identifiers -
Returns

string

Inherited from

Entity.generateUuid

unserialize()

static unserialize<Identifiers>(serialized): Identifiers

Defined in: api/entities/Entity.ts:23

Unserialize a UUID into its Unique Identifiers

Type Parameters
Type Parameter
Identifiers
Parameters
Parameter Type Description
serialized string UUID to unserialize
Returns

Identifiers

Inherited from

Entity.unserialize

Interfaces

HumanReadable

Defined in: api/entities/Offering/index.ts:59

Properties

assetId

assetId: string

Defined in: api/entities/Offering/index.ts:61

id

id: string

Defined in: api/entities/Offering/index.ts:60


UniqueIdentifiers

Defined in: api/entities/Offering/index.ts:54

Properties

assetId

assetId: string

Defined in: api/entities/Offering/index.ts:56

id

id: BigNumber

Defined in: api/entities/Offering/index.ts:55

⚠️ **GitHub.com Fallback** ⚠️