Interface ResourceCreditsOptions

Hierarchy

  • ResourceCreditsOptions

Properties

adjustRcLimit?: ((receipt: TransactionReceipt) => string | number | Promise<string | number>)

Type declaration

    • (receipt: TransactionReceipt): string | number | Promise<string | number>
    • Function to adjust the rc limit after the estimation. It is useful to give an extra margin to the rc limit. By default the Signer will use a function that increases the rcLimit by 10% with respect to the estimation.

      Example

      const signer = Signer.fromWif("Kab...");
      signer.rcOptions = {
      estimateRc: true,
      adjustRcLimit: async (receipt) => {
      return Math.min(
      Number(receipt.max_payer_rc),
      Math.floor(1.1 * Number(receipt.rc_used))
      );
      },
      }

      Parameters

      Returns string | number | Promise<string | number>

estimateRc?: boolean

Boolean to define if the mana should be estimated and the rcLimit be updated before signing the transaction. It is true by default

Generated using TypeDoc