Migrate
Migrate the UTxO balance of this wallet to the given set of addresses.
This operation will attempt to transfer as much of the wallet's balance as possible to the given set of addresses, by creating and submitting as many transactions as may be necessary to migrate the entire balance.
In order to minimize the total transaction fee required, UTxO entries are coalesced together to the greatest extent possible in the resulting transactions. No attempt is made to preserve the wallet's UTxO distribution.
This operation is performed on a best-effort basis. If there is insufficient ada available to pay for the entire UTxO set to be migrated, then only a subset of the wallet's UTxO set will be migrated.
A typical use of this operation would be to move all funds from an old wallet to a new wallet, by providing addresses that belong to the new wallet.
Path parameters
-
walletId
string(hex) Required Minimum length is
40
, maximum length is40
.
Body
Required
-
passphrase
string Required The wallet's master passphrase.
Minimum length is
0
, maximum length is255
. -
addresses
array[string(base58) | bech32] Required A sequence of characters that encodes (in Base58 or Bech32) a sequence of bytes which represents an address on the Cardano blockchain. Sequences in Base58 encoding are expected to be legacy Byron addresses, whereas sequences in Bech32 encoding correspond to current Shelley addresses.
For more details, see CIP-0019 — Cardano addresses .
At least
1
element.
curl \
--request POST https://localhost:8090/v2/byron-wallets/{walletId}/migrations \
--header "Content-Type: application/json" \
--data '{"passphrase":"Secure Passphrase","addresses":["addr1sjck9mdmfyhzvjhydcjllgj9vjvl522w0573ncustrrr2rg7h9azg4cyqd36yyd48t5ut72hgld0fg2xfvz82xgwh7wal6g2xt8n996s3xvu5g"]}'
{
"passphrase": "Secure Passphrase",
"addresses": [
"addr1sjck9mdmfyhzvjhydcjllgj9vjvl522w0573ncustrrr2rg7h9azg4cyqd36yyd48t5ut72hgld0fg2xfvz82xgwh7wal6g2xt8n996s3xvu5g"
]
}
{
"message": "string",
"code": "unsupported_media_type"
}
{
"message": "string",
"code": "not_acceptable"
}
{
"message": "string",
"code": "no_such_wallet",
"info": {
"wallet_id": "2512a00e9653fe49a44a5886202e24d77eeb998f"
}
}
{
"message": "string",
"code": "nothing_to_migrate"
}
{
"message": "string",
"code": "no_root_key"
}
{
"message": "string",
"code": "wrong_encryption_passphrase",
"info": {
"wallet_id": "2512a00e9653fe49a44a5886202e24d77eeb998f"
}
}
[
{
"id": "1423856bc91c49e928f6f30f4e8d665d53eb4ab6028bd0ac971809d514c92db1",
"amount": {
"quantity": 42000000,
"unit": "lovelace"
},
"fee": {
"quantity": 42000000,
"unit": "lovelace"
},
"deposit_taken": {
"quantity": 42000000,
"unit": "lovelace"
},
"deposit_returned": {
"quantity": 42000000,
"unit": "lovelace"
},
"inserted_at": {
"absolute_slot_number": 8086,
"slot_number": 1337,
"epoch_number": 14,
"time": "2019-02-27T14:46:45Z",
"height": {
"quantity": 1337,
"unit": "block"
}
},
"expires_at": {
"absolute_slot_number": 8086,
"epoch_number": 14,
"slot_number": 1337,
"time": "2019-02-27T14:46:45Z"
},
"pending_since": {
"absolute_slot_number": 8086,
"slot_number": 1337,
"epoch_number": 14,
"time": "2019-02-27T14:46:45Z",
"height": {
"quantity": 1337,
"unit": "block"
}
},
"depth": {
"quantity": 1337,
"unit": "block"
},
"direction": "outgoing",
"inputs": [
{
"address": "addr1sjck9mdmfyhzvjhydcjllgj9vjvl522w0573ncustrrr2rg7h9azg4cyqd36yyd48t5ut72hgld0fg2xfvz82xgwh7wal6g2xt8n996s3xvu5g",
"amount": {
"quantity": 42000000,
"unit": "lovelace"
},
"assets": [
{
"policy_id": "65ab82542b0ca20391caaf66a4d4d7897d281f9c136cd3513136945b",
"asset_name": "string",
"quantity": 42
}
],
"id": "1423856bc91c49e928f6f30f4e8d665d53eb4ab6028bd0ac971809d514c92db1",
"index": 42
}
],
"outputs": [
{
"address": "addr1sjck9mdmfyhzvjhydcjllgj9vjvl522w0573ncustrrr2rg7h9azg4cyqd36yyd48t5ut72hgld0fg2xfvz82xgwh7wal6g2xt8n996s3xvu5g",
"amount": {
"quantity": 42000000,
"unit": "lovelace"
},
"assets": [
{
"policy_id": "65ab82542b0ca20391caaf66a4d4d7897d281f9c136cd3513136945b",
"asset_name": "string",
"quantity": 42
}
]
}
],
"collateral": [
{
"address": "addr1sjck9mdmfyhzvjhydcjllgj9vjvl522w0573ncustrrr2rg7h9azg4cyqd36yyd48t5ut72hgld0fg2xfvz82xgwh7wal6g2xt8n996s3xvu5g",
"amount": {
"quantity": 42000000,
"unit": "lovelace"
},
"id": "1423856bc91c49e928f6f30f4e8d665d53eb4ab6028bd0ac971809d514c92db1",
"index": 42
}
],
"collateral_outputs": [
{
"address": "addr1sjck9mdmfyhzvjhydcjllgj9vjvl522w0573ncustrrr2rg7h9azg4cyqd36yyd48t5ut72hgld0fg2xfvz82xgwh7wal6g2xt8n996s3xvu5g",
"amount": {
"quantity": 42000000,
"unit": "lovelace"
},
"assets": [
{
"policy_id": "65ab82542b0ca20391caaf66a4d4d7897d281f9c136cd3513136945b",
"asset_name": "string",
"quantity": 42
}
]
}
],
"withdrawals": [
{
"stake_address": "stake1sjck9mdmfyhzvjhydcjllgj9vjvl522w0573ncustrrr2rg7h9azg4cyqd36yyd48t5ut72hgld0fg2x",
"amount": {
"quantity": 42000000,
"unit": "lovelace"
}
}
],
"status": "pending",
"metadata": {
"0": {
"string": "cardano"
},
"1": {
"int": 14
},
"2": {
"bytes": "2512a00e9653fe49a44a5886202e24d77eeb998f"
},
"3": {
"list": [
{
"int": 14
},
{
"int": 42
},
{
"string": "1337"
}
]
},
"4": {
"map": [
{
"k": {
"string": "key"
},
"v": {
"string": "value"
}
},
{
"k": {
"int": 14
},
"v": {
"int": 42
}
}
]
}
},
"script_validity": "valid",
"certificates": [
{
"certificate_type": "join_pool",
"pool": "pool1wqaz0q0zhtxlgn0ewssevn2mrtm30fgh2g7hr7z9rj5856457mm",
"reward_account_path": [
"string"
]
}
],
"mint": {
"tokens": [
{
"policy_id": "65ab82542b0ca20391caaf66a4d4d7897d281f9c136cd3513136945b",
"policy_script": {
"script_type": "native",
"script": "string",
"reference": {
"id": "1423856bc91c49e928f6f30f4e8d665d53eb4ab6028bd0ac971809d514c92db1",
"index": 42
}
},
"assets": [
{
"asset_name": "string",
"quantity": 42,
"fingerprint": "asset1rjklcrnsdzqp65wjgrg55sy9723kw09mlgvlc3"
}
]
}
],
"wallet_policy_key_hash": "string",
"wallet_policy_key_index": "1852H"
},
"burn": {
"tokens": [
{
"policy_id": "65ab82542b0ca20391caaf66a4d4d7897d281f9c136cd3513136945b",
"policy_script": {
"script_type": "native",
"script": "string",
"reference": {
"id": "1423856bc91c49e928f6f30f4e8d665d53eb4ab6028bd0ac971809d514c92db1",
"index": 42
}
},
"assets": [
{
"asset_name": "string",
"quantity": 42,
"fingerprint": "asset1rjklcrnsdzqp65wjgrg55sy9723kw09mlgvlc3"
}
]
}
],
"wallet_policy_key_hash": "string",
"wallet_policy_key_index": "1852H"
},
"validity_interval": {
"invalid_before": {
"quantity": 42000,
"unit": "slot"
},
"invalid_hereafter": {
"quantity": 42000,
"unit": "slot"
}
},
"script_integrity": [
"script_data16apaenn9ut6s40lcw3l8v68xawlrlq20z2966uzcx8jmv2q9uy7qau558d"
],
"extra_signatures": [
"addr_keyhash1gr69m385thgvkrtspk73zmkwk537wxyxuevs2u9cukglvtlkz4k"
]
}
]