Docs
chromia.com

Function

mapLoginConfigRulesToAuthDescriptorRules

  • mapLoginConfigRulesToAuthDescriptorRules(
        rules: LoginConfigRules | AuthDescriptorRules,
        getBlockHeight: () => Promise<number>,
    ): Promise<AuthDescriptorRules>

    Maps list of login config rules to auth descriptor rules.

    For example, null => null lessThan(relativeBlockTime(10)) => lessThan(blockTime(Date.now()+10)) lessThan(opCount(10)) => lessThan(opCount(10)) lessThan(relativeBlockHeight(10)) => lessThan(blockHeight(currentBlockHeight+10)) ["and", loginRule1, authDescRule2] => ["and", authDescRule1, authDescRule2]

    Parameters

    • rules: LoginConfigRules | AuthDescriptorRules

      a list of login config rules

    • getBlockHeight: () => Promise<number>

      a function which returns the current block height of the chain. It allows caching

    Returns Promise<AuthDescriptorRules>

    a list of auth descriptor rules