Class: CardanoWallet::Shelley::Migrations

Inherits:
Base
  • Object
show all
Defined in:
lib/cardano_wallet/shelley.rb

Overview

Shelley migrations

Examples:

@cw = CardanoWallet.new
@cw.shelley.migrations # API for Shelley migrations

See Also:

Instance Attribute Summary

Attributes inherited from Base

#opt

Instance Method Summary collapse

Methods inherited from Base

#byron, #initialize, #misc, #shared, #shelley, #utils

Constructor Details

This class inherits a constructor from CardanoWallet::Base

Instance Method Details

#migrate(wid, passphrase, addresses) ⇒ Object

Migrate all funds from Shelley wallet.

Parameters:

  • wid (String)

    wallet id

  • passphrase (String)

    wallet’s passphrase

  • array (Array)

    of addresses

See Also:



549
550
551
552
553
554
# File 'lib/cardano_wallet/shelley.rb', line 549

def migrate(wid, passphrase, addresses)
  self.class.post("/wallets/#{wid}/migrations",
                  body: { addresses: addresses,
                          passphrase: passphrase }.to_json,
                  headers: { 'Content-Type' => 'application/json' })
end

#plan(wid, addresses) ⇒ Object

Get migration plan



538
539
540
541
542
# File 'lib/cardano_wallet/shelley.rb', line 538

def plan(wid, addresses)
  self.class.post("/wallets/#{wid}/migrations/plan",
                  body: { addresses: addresses }.to_json,
                  headers: { 'Content-Type' => 'application/json' })
end