Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Key

Hierarchy

  • Key

Index

Constructors

constructor

  • new Key(options: object): Key

Properties

classes

classes: object = Key.classes

Type declaration

Methods

approveTransaction

  • approveTransaction(transaction: AssetTransaction, params: object): Promise<string>
  • Approves the transaction

    Parameters

    • transaction: AssetTransaction

      A transaction

    • params: object
      • account: PlatformAddressValue

        An account.

      • Optional keyStore?: KeyStore

        A key store.

      • Optional passphrase?: undefined | string

        The passphrase for the given account

    Returns Promise<string>

    An approval

createAssetAddress

  • createAssetAddress(params?: object): Promise<AssetAddress>
  • Creates a new asset address

    Parameters

    • Default value params: object = {}
      • Optional keyStore?: KeyStore

        A key store.

      • Optional passphrase?: undefined | string
      • Optional type?: "P2PKH" | "P2PKHBurn"

        The type of AssetAddress. The default value is "P2PKH".

    Returns Promise<AssetAddress>

    A new asset address

createLocalKeyStore

  • createLocalKeyStore(dbPath?: undefined | string): Promise<KeyStore>
  • Creates persistent key store which stores data in the filesystem.

    Parameters

    • Optional dbPath: undefined | string

      A keystore file path

    Returns Promise<KeyStore>

createP2PKH

  • createP2PKH(params: object): P2PKH

createP2PKHBurn

createPlatformAddress

  • createPlatformAddress(params?: object): Promise<PlatformAddress>
  • Creates a new platform address

    Parameters

    • Default value params: object = {}
      • Optional keyStore?: KeyStore

        A key store.

      • Optional passphrase?: undefined | string

    Returns Promise<PlatformAddress>

    A new platform address

createRemoteKeyStore

  • createRemoteKeyStore(keystoreURL: string): Promise<KeyStore>

signTransaction

  • Signs a Transaction with the given account.

    throws

    When seq or fee in the Transaction is null

    throws

    When account or its passphrase is invalid

    Parameters

    • tx: Transaction

      A Transaction

    • params: object
      • account: PlatformAddressValue

        An account.

      • fee: U64Value
      • Optional keyStore?: KeyStore

        A key store.

      • Optional passphrase?: undefined | string

        The passphrase for the given account

      • seq: number

    Returns Promise<SignedTransaction>

    A SignedTransaction

signTransactionBurn

  • Signs a transaction's burn with a given key store.

    Parameters

    • tx: TransferAsset | UnwrapCCC

      An TransferAsset.

    • index: number

      The index of a burn to sign.

    • Default value params: object = {}
      • Optional keyStore?: KeyStore

        A key store.

      • Optional passphrase?: undefined | string

        The passphrase for the given burn.

      • Optional signatureTag?: SignatureTag

    Returns Promise<void>

signTransactionInput

  • Signs a transaction's input with a given key store.

    Parameters

    • tx: TransferAsset | ComposeAsset | DecomposeAsset

      An TransferAsset.

    • index: number

      The index of an input to sign.

    • Default value params: object = {}
      • Optional keyStore?: KeyStore

        A key store.

      • Optional passphrase?: undefined | string

        The passphrase for the given input.

      • Optional signatureTag?: SignatureTag

    Returns Promise<void>

signTransactionInputWithOrder

  • Signs a transaction's input with an order.

    Parameters

    • input: AssetTransferInput

      An AssetTransferInput.

    • order: Order

      An order to be used as a signature message.

    • Default value params: object = {}
      • Optional keyStore?: KeyStore

        A key store.

      • Optional passphrase?: undefined | string

        The passphrase for the given input.

    Returns Promise<void>

Object literals

Static classes

classes: object

LocalKeyStore

LocalKeyStore: LocalKeyStore

RemoteKeyStore

RemoteKeyStore: RemoteKeyStore

Generated using TypeDoc