def add_output(output, network: @network)
      if output.is_a?(Output)
        output.set_transaction(self, @outputs.size)
      else
        output = Output.new(output.merge(transaction: self,
                                         index: @outputs.size),
                            network: network)
      end

      @outputs << output
      self.update_native do |native|
        native.add_out(output.native)
      end
    end
def add_output(output, network: @network)
      if output.is_a?(Output)
        output.set_transaction(self, @outputs.size)
      else
        output = Output.new(output.merge(transaction: self,
                                         index: @outputs.size),
                            network: network)
      end

      @outputs << output
      self.update_native do |native|
        native.add_out(output.native)
      end
    end
Takes either an Output or a Hash describing an output.