lib/zold/wallet.rb
def init(id, pubkey, overwrite: false, network: 'test')
      raise "File '#{path}' already exists" if File.exist?(path) && !overwrite
      raise "Invalid network name '#{network}'" unless network =~ /^[a-z]{4,16}$/
      FileUtils.mkdir_p(File.dirname(path))
      IO.write(path, "#{network}\n#{PROTOCOL}\n#{id}\n#{pubkey.to_pub}\n\n")
      @txns.flush
      @head.flush
    end
def init(id, pubkey, overwrite: false, network: 'test')
      raise "File '#{path}' already exists" if File.exist?(path) && !overwrite
      raise "Invalid network name '#{network}'" unless network =~ /^[a-z]{4,16}$/
      FileUtils.mkdir_p(File.dirname(path))
      IO.write(path, "#{network}\n#{PROTOCOL}\n#{id}\n#{pubkey.to_pub}\n\n")
      @txns.flush
      @head.flush
    end
def init ( id , pubkey , overwrite : false , network : 'test' ) raise "File '#{path}' already exists" if File . exist? ( path ) && ! overwrite raise "Invalid network name '#{network}'" unless network =~ / / FileUtils . mkdir_p ( File . dirname ( path ) ) IO . write ( path , "#{network}\n#{PROTOCOL}\n#{id}\n#{pubkey.to_pub}\n\n" ) @txns . flush @head . flush end
Creates an empty wallet with the specified ID and public key.
Creates an empty wallet with the specified ID and public key .