Home Reference Source Repository
public class | source

Deployer

Deployer allows for deployment of Fincontract to the blockchain in a series of transaction. It makes sure that the topological order of FincNodes is preserved. It also allows for immediate issuance of the Fincontract to a given proposed owner.

Example:

import Deployer from './fincontract-deployer';
try {
  const d = new Deployer(marketplace, web3);
  const id = await d.deploy(fincontract);
catch (err) {
  console.log(err);
}

Constructor Summary

Public Constructor
public

constructor(marketplace: FincontractMarketplace, web3: Web3)

Constructs the Deployer object with Fincontracts smart contract instance and web3 instance connected to an Ethereum node

Method Summary

Public Methods
public

async deploy(description: FincNode): Promise<String, Error>

Deploys a description of a Fincontract to the blockchain by traversing the Fincontract description (See FincNode and DescriptionDeployer) and returns a promise that resolves to id of the deployed Fincontract.

public

Deploys the actual Fincontract to the blockchain given that the description was already deployed and it's id is given as the argument

public

async issue(description: FincNode, proposedOwner: String): Promise<String, Error>

Deploys a description of a Fincontract to the blockchain (See Deployer#deploy) and then issues it for the proposed owner.

public

issueFincontract(fctID: String, proposedOwner: String): Promise<String, Error>

Issues the actual Fincontract to the proposed owner in the blockchain given that the Fincontract was already deployed and it's id is given as the argument

Public Constructors

public constructor(marketplace: FincontractMarketplace, web3: Web3) source

Constructs the Deployer object with Fincontracts smart contract instance and web3 instance connected to an Ethereum node

Params:

NameTypeAttributeDescription
marketplace FincontractMarketplace

a Fincontracts smart contract instance

web3 Web3

a web3 instance connected to an Ethereum node

Public Methods

public async deploy(description: FincNode): Promise<String, Error> source

Deploys a description of a Fincontract to the blockchain by traversing the Fincontract description (See FincNode and DescriptionDeployer) and returns a promise that resolves to id of the deployed Fincontract.

Params:

NameTypeAttributeDescription
description FincNode

Root description of Fincontract

Return:

Promise<String, Error>

promise that resolves to id of blockchain deployed Fincontract or rejects with an error

public deployFincontract(descID: String): Promise<String, Error> source

Deploys the actual Fincontract to the blockchain given that the description was already deployed and it's id is given as the argument

Params:

NameTypeAttributeDescription
descID String

Fincontract description's id deployed to the blockchain

Return:

Promise<String, Error>

Promise that resolves to Fincontract's id deployed to the blockchain or rejects with an error

public async issue(description: FincNode, proposedOwner: String): Promise<String, Error> source

Deploys a description of a Fincontract to the blockchain (See Deployer#deploy) and then issues it for the proposed owner.

Params:

NameTypeAttributeDescription
description FincNode

Root description of Fincontract

proposedOwner String

address of the proposed owner's Ethereum account

Return:

Promise<String, Error>

promise that resolves to id of blockchain deployed Fincontractor rejects with an error

public issueFincontract(fctID: String, proposedOwner: String): Promise<String, Error> source

Issues the actual Fincontract to the proposed owner in the blockchain given that the Fincontract was already deployed and it's id is given as the argument

Params:

NameTypeAttributeDescription
fctID String

Fincontract's id deployed to the blockchain

proposedOwner String

address of the proposed owner's Ethereum account

Return:

Promise<String, Error>

Promise that resolves to Fincontract's id deployed to the blockchain or rejects with an error