Documentation
    Preparing search index...
    • Merges multiple coins into a single coin for transaction building

      This function takes multiple coin objects and merges them into a single coin that can be used in a transaction. It supports optional splitting to create a specific balance amount.

      Parameters

      • tx: Transaction

        Transaction object to add merge operations to

      • coins: (
            {
                balance: string
                | number
                | bigint;
                coinObjectId: string;
                coinType: string;
            } & CoinStruct
        )[]

        Array of coin objects to merge

      • Optionaloptions: { balance?: number; useGasCoin?: boolean }

        Optional parameters for balance splitting and gas coin usage

        • balance - If provided, splits this amount from the resulting coin object
        • useGasCoin - If true, uses the gas coin for the operation

      Returns
          | TransactionResult
          | { $kind: "Input"; Input: number; type?: "object" }
          | { $kind: "GasCoin"; GasCoin: true }

      Transaction result representing the merged coin