Documentation
    Preparing search index...

    Class BalanceManagerContract

    BalanceManagerContract class for managing BalanceManager operations.

    Index

    Constructors

    Methods

    • Parameters

      • managerKey: string

        The key of the BalanceManager

      • coinKey: string

        The key of the coin to check the balance of

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Check the balance of the BalanceManager

    • Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Create and share a new BalanceManager

    • Parameters

      • ownerAddress: string

      Returns (tx: Transaction) => TransactionResult

      A function that takes a Transaction object

      Create a new BalanceManager, manually set the owner. Returns the manager.

    • Parameters

      • ownerAddress: string

      Returns (
          tx: Transaction,
      ) => {
          depositCap: { $kind: "NestedResult"; NestedResult: [number, number] };
          manager: { $kind: "NestedResult"; NestedResult: [number, number] };
          tradeCap: { $kind: "NestedResult"; NestedResult: [number, number] };
          withdrawCap: { $kind: "NestedResult"; NestedResult: [number, number] };
      }

      A function that takes a Transaction object

      Create a new BalanceManager, manually set the owner. Returns the manager, depositCap, withdrawCap, and tradeCap.

    • Parameters

      • managerKey: string

        The key of the BalanceManager

      • coinKey: string

        The key of the coin to deposit

      • amountToDeposit: number

        The amount to deposit

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Deposit funds into the BalanceManager

    • Parameters

      • managerKey: string

        The name of the BalanceManager

      • coinKey: string

        The name of the coin to deposit

      • amountToDeposit: number

        The amount to deposit

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Deposit using the DepositCap

    • Parameters

      • managerKey: string

        The key of the BalanceManager

      Returns (tx: Transaction) => TransactionResult

      A function that takes a Transaction object

      Generate a trade proof for the BalanceManager. Calls the appropriate function based on whether tradeCap is set.

    • Parameters

      • managerId: string

        The ID of the BalanceManager

      Returns (tx: Transaction) => TransactionResult

      A function that takes a Transaction object

      Generate a trade proof as the owner

    • Parameters

      • managerId: string

        The ID of the BalanceManager

      • tradeCapId: string

        The ID of the tradeCap

      Returns (tx: Transaction) => TransactionResult

      A function that takes a Transaction object

      Generate a trade proof as a trader

    • Parameters

      • managerKey: string

        The key of the BalanceManager

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Get the ID of the BalanceManager

    • Parameters

      • managerKey: string

        The name of the BalanceManager

      Returns (tx: Transaction) => TransactionResult

      A function that takes a Transaction object

      Mint a DepositCap

    • Parameters

      • managerKey: string

        The name of the BalanceManager

      Returns (tx: Transaction) => TransactionResult

      A function that takes a Transaction object

      Mint a TradeCap

    • Parameters

      • managerKey: string

        The name of the BalanceManager

      Returns (tx: Transaction) => TransactionResult

      A function that takes a Transaction object

      Mint a WithdrawalCap

    • Parameters

      • managerKey: string

        The key of the BalanceManager

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Get the owner of the BalanceManager

    • Parameters

      • referral_id: string

        The ID of the referral to get the owner of

      Returns (tx: Transaction) => TransactionResult

      A function that takes a Transaction object

      Get the owner of the referral

    • Parameters

      • managerKey: string

      Returns (tx: Transaction) => void

    • Parameters

      • managerKey: string

        The name of the BalanceManager

      • referral: string

        The referral to set the BalanceManager to

      • tradeCap: TransactionArgument

        The tradeCap for permission checking

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Set the referral for the BalanceManager

    • Parameters

      • manager: TransactionArgument

        The BalanceManager to share

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Share the BalanceManager

    • Parameters

      • managerKey: string

        The name of the BalanceManager

      • tradeCap: TransactionArgument

        The tradeCap for permission checking

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Unset the referral for the BalanceManager

    • Parameters

      • managerKey: string

        The key of the BalanceManager

      • coinKey: string

        The key of the coin to withdraw

      • recipient: string

        The recipient of the withdrawn funds

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Withdraw all funds from the BalanceManager

    • Parameters

      • managerKey: string

        The key of the BalanceManager

      • coinKey: string

        The key of the coin to withdraw

      • amountToWithdraw: number

        The amount to withdraw

      • recipient: string

        The recipient of the withdrawn funds

      Returns (tx: Transaction) => void

      A function that takes a Transaction object

      Withdraw funds from the BalanceManager

    • Parameters

      • managerKey: string

        The name of the BalanceManager

      • coinKey: string

        The name of the coin to withdraw

      • amountToWithdraw: number

        The amount to withdraw

      Returns (tx: Transaction) => TransactionResult

      A function that takes a Transaction object

      Withdraw using the WithdrawCap