Skip to main content

Class: TargetProject

Project encapsulating all contracts and contract factories for a particular target chain. This class largely abstracts over any particular chain details; instead all the hard work is done by TargetProjectHandlers. We currently only have a handler for Solidity projects, but we plan to add support for other languages in the future and will make the handler interface public so the community can add handlers to different kinds of projects.

This class is largley internal and will likely not be exposed in future versions. The only user-facing methods for now are for getting information from the project node (e.g., accounts, balances, etc.).

Exports

Properties

Methods

Properties

config

Readonly config: Config

Underlying config

Defined in

submodules/cubist-node-sdk/src/internal/index.ts:59

Methods

accounts

accounts(): Promise<string[]>

Retrieve all accounts used on this target.

Returns

Promise<string[]>

Accounts.

Defined in

submodules/cubist-node-sdk/src/internal/index.ts:136


getBalance

getBalance(addr): Promise<BigNumber>

Get the balance of the given address.

Parameters

NameTypeDescription
addrstringThe address.

Returns

Promise<BigNumber>

The balance.

Defined in

submodules/cubist-node-sdk/src/internal/index.ts:149


getSignerAddress

getSignerAddress(): Promise<string>

Return default signer address (accounts[0]) for now.

Returns

Promise<string>

Default signer address.

Defined in

submodules/cubist-node-sdk/src/internal/index.ts:142


isDeployed

isDeployed(name): boolean

Check if contract has been deployed.

Parameters

NameTypeDescription
namestringThe contract name.

Returns

boolean

true if contract was deployed at least once.

Defined in

submodules/cubist-node-sdk/src/internal/index.ts:129


target

target(): Target

Returns

Target

  • The target chain

Defined in

submodules/cubist-node-sdk/src/internal/index.ts:83