Function mapLoginConfigRulesToAuthDescriptorRules

  • 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

        • (): Promise<number>
        • Returns Promise<number>

    Returns Promise<AuthDescriptorRules>

    a list of auth descriptor rules