Options
All
  • Public
  • Public/Protected
  • All
Menu

Provides a set of methods to manage contract deployment

Hierarchy

  • ContractDeployer

Index

Methods

Static deploy

  • deploy<T>(contractIdentifier: string): Promise<T>
  • Deploys contract files to a randomly generated account

    // Deploy the contract with identifier
    ContractDeployer.deploy<MyContractTypeDef>('mycontract');
    author

    Kevin Brown <github.com/thekevinbrown>

    Type parameters

    Parameters

    • contractIdentifier: string

      Contract identifier, typically the contract filename minus the extension

    Returns Promise<T>

    Deployed contract instance

Static deployToAccount

  • deployToAccount<T>(contractIdentifier: string, account: Account): Promise<T>
  • Deploys contract files to a specified account

    // Create a new account
    const account = await AccountManager.createAccount();
    // Deploy the contract `mycontract` to the account
    ContractDeployer.deployToAccount<MyContractTypeDef>('mycontract', account);
    author

    Kevin Brown <github.com/thekevinbrown>

    Type parameters

    Parameters

    • contractIdentifier: string

      Contract identifier, typically the contract filename minus the extension

    • account: Account

      Account to apply contract code

    Returns Promise<T>

    Deployed contract instance

Static deployWithName

  • deployWithName<T>(contractIdentifier: string, accountName: string): Promise<T>
  • Deploys contract files to a specified account name

    // Deploy the `mycontract` contract to the account with name `mycontractname`
    ContractDeployer.deployWithName<MyContractTypeDef>('mycontract', 'mycontractname');
    note

    Generating a pseudorandom private key is not safe in the cryptographic sense. It can be used for testing.

    author

    Mitch Pierias <github.com/MitchPierias>

    Type parameters

    Parameters

    • contractIdentifier: string

      Contract identifier, typically the contract filename minus the extension

    • accountName: string

      Account name

    Returns Promise<T>

    Deployed contract instance

Generated using TypeDoc