Restore

POST /byron-wallets

status: stable

Restore a Byron wallet from a mnemonic sentence or encrypted root private key (deprecated).

⚠️ WARNING ⚠️

The construction of random wallet in itself is deprecated, in particular the restoration from an encrypted root private key. These endpoints exist to ease migrations from legacy software such as cardano-sl but should be avoided by new applications.

application/json

Body object Required

One of:

Responses

  • 415 application/json

    Unsupported Media Type

    Hide response attributes Show response attributes object
    • message string Required

      A descriptive error message.

    • code string Required

      A specific error code for this error, more precise than HTTP ones.

  • 409 application/json

    Conflict

    Hide response attributes Show response attributes object
    • message string Required

      A descriptive error message.

    • code string Required

      A specific error code for this error, more precise than HTTP ones.

  • 406 application/json

    Not Acceptable

    Hide response attributes Show response attributes object
    • message string Required

      May occur when providing an invalid 'Accept' header.

    • code string Required

      Value is not_acceptable.

  • 400 application/json

    Bad Request

    Hide response attributes Show response attributes object
    • message string Required

      May occur when a request is not well-formed; that is, it fails to parse successfully. This could be the case when some required parameters are missing or, when malformed values are provided.

    • code string Required

      Value is bad_request.

  • 201 application/json

    Created

    Hide response attributes Show response attributes object
    • id string(hex) Required

      A unique identifier for the wallet

      Minimum length is 40, maximum length is 40.

    • balance object Required

      Byron wallet's current balance(s)

      Hide balance attributes Show balance attributes object
      • available object Required

        Available balance (funds that can be spent)

        Hide available attributes Show available attributes object
        • quantity integer Required

          Minimum value is 0.

        • unit string Required

          Value is lovelace.

      • total object Required

        Total balance (available balance plus pending change)

        Hide total attributes Show total attributes object
        • quantity integer Required

          Minimum value is 0.

        • unit string Required

          Value is lovelace.

    • assets object Required

      Current non-Ada asset holdings of the wallet.

      The amount of assets available to spend may be less than the total unspent assets due to transaction change amounts which are yet to be fully confirmed (pending).

      Hide assets attributes Show assets attributes object
      • available array[object] Required

        Available UTxO asset balances (funds that can be spent without condition).

        Hide available attributes Show available attributes object
        • policy_id string(hex) Required

          A unique identifier of the asset's monetary policy. The policy controls how assets of this kind are created and destroyed.

          The contents are the blake2b-224 hash of the monetary policy script, encoded in hexadecimal.

          Minimum length is 56, maximum length is 56.

        • asset_name string(hex) Required

          The asset on-chain type which acts as a sub-identifier within a policy. Although we call it "asset name", the value needn't be text, and it could even be empty.

          For policies with a single fungible asset item, asset name is typically an empty string.

          This value can be up to 32 bytes of arbitrary data (which is 64 hexadecimal digits).

          Maximum length is 64.

        • quantity integer Required

          Number of assets for the given policy_id and asset_name.

          Minimum value is 0.

      • total array[object] Required

        Total asset balances (available balances plus pending change balances).

        Hide total attributes Show total attributes object
        • policy_id string(hex) Required

          A unique identifier of the asset's monetary policy. The policy controls how assets of this kind are created and destroyed.

          The contents are the blake2b-224 hash of the monetary policy script, encoded in hexadecimal.

          Minimum length is 56, maximum length is 56.

        • asset_name string(hex) Required

          The asset on-chain type which acts as a sub-identifier within a policy. Although we call it "asset name", the value needn't be text, and it could even be empty.

          For policies with a single fungible asset item, asset name is typically an empty string.

          This value can be up to 32 bytes of arbitrary data (which is 64 hexadecimal digits).

          Maximum length is 64.

        • quantity integer Required

          Number of assets for the given policy_id and asset_name.

          Minimum value is 0.

    • discovery string Required

      Mechanism used for discovering addresses.

      Values are random or sequential.

    • name string Required

      Minimum length is 1, maximum length is 255.

    • Information about the wallet's passphrase

      Hide passphrase attribute Show passphrase attribute object
    • state object Required

      Whether a wallet is ready to use or still syncing

      Hide state attributes Show state attributes object
      • status string Required

        Values are ready, syncing, or not_responding.

      • progress object

        if: status == syncing

        Hide progress attributes Show progress attributes object
        • quantity number Required

          Minimum value is 0, maximum value is 100.

        • unit string Required

          Value is percent.

    • tip object Required

      A reference to a particular time slot, and the block height at that point.

      Hide tip attributes Show tip attributes object
      • absolute_slot_number integer Required

        The 0-based slot index starting from genesis of the blockchain.

        Minimum value is 0.

      • slot_number integer Required

        The zero-based slot index within an epoch.

        Minimum value is 0.

      • epoch_number integer Required

        An epoch is a time period which is divided into slots.

        Minimum value is 0.

      • time string(iso-8601-date-and-time) Required
      • height object Required
        Hide height attributes Show height attributes object
        • quantity integer Required

          Minimum value is 0.

        • unit string Required

          Value is block.

POST /byron-wallets
curl \
 --request POST https://localhost:8090/v2/byron-wallets \
 --header "Content-Type: application/json" \
 --data '{"style":"random","name":"Alan's Wallet","passphrase":"Secure Passphrase","mnemonic_sentence":["squirrel","material","silly","twice","direct","slush","pistol","razor","become","junk","kingdom","flee","squirrel","silly","twice"]}'
{
  "style": "random",
  "name": "Alan's Wallet",
  "passphrase": "Secure Passphrase",
  "mnemonic_sentence": [
    "squirrel",
    "material",
    "silly",
    "twice",
    "direct",
    "slush",
    "pistol",
    "razor",
    "become",
    "junk",
    "kingdom",
    "flee",
    "squirrel",
    "silly",
    "twice"
  ]
}
{
  "style": "icarus",
  "name": "Alan's Wallet",
  "passphrase": "Secure Passphrase",
  "mnemonic_sentence": [
    "squirrel",
    "material",
    "silly",
    "twice",
    "direct",
    "slush",
    "pistol",
    "razor",
    "become",
    "junk",
    "kingdom",
    "flee",
    "squirrel",
    "silly",
    "twice"
  ]
}
{
  "style": "trezor",
  "name": "Alan's Wallet",
  "passphrase": "Secure Passphrase",
  "mnemonic_sentence": [
    "squirrel",
    "material",
    "silly",
    "twice",
    "direct",
    "slush",
    "pistol",
    "razor",
    "become",
    "junk",
    "kingdom",
    "flee",
    "squirrel",
    "silly",
    "twice"
  ]
}
{
  "style": "ledger",
  "name": "Alan's Wallet",
  "passphrase": "Secure Passphrase",
  "mnemonic_sentence": [
    "squirrel",
    "material",
    "silly",
    "twice",
    "direct",
    "slush",
    "pistol",
    "razor",
    "become",
    "junk",
    "kingdom",
    "flee",
    "squirrel",
    "silly",
    "twice"
  ]
}
{
  "name": "Alan's Wallet",
  "account_public_key": "1423856bc91c49e928f6f30f4e8d665d53eb4ab6028bd0ac971809d514c92db11423856bc91c49e928f6f30f4e8d665d53eb4ab6028bd0ac971809d514c92db1",
  "address_pool_gap": 20
}
{
  "style": "random",
  "name": "Alan's Wallet",
  "encrypted_root_private_key": "string",
  "passphrase_hash": "31347c387c317c574342652b796362417576356c2b4258676a344a314c6343675375414c2f5653393661364e576a2b7550766655513d3d7c2f376738486c59723174734e394f6e4e753253302b6a65515a6b5437316b45414941366a515867386539493d"
}
Response examples (415)
{
  "message": "string",
  "code": "an_error_code"
}
Response examples (409)
{
  "message": "string",
  "code": "an_error_code"
}
Response examples (406)
{
  "message": "string",
  "code": "not_acceptable"
}
Response examples (400)
{
  "message": "string",
  "code": "bad_request"
}
Response examples (201)
{
  "id": "2512a00e9653fe49a44a5886202e24d77eeb998f",
  "balance": {
    "available": {
      "quantity": 42000000,
      "unit": "lovelace"
    },
    "total": {
      "quantity": 42000000,
      "unit": "lovelace"
    }
  },
  "assets": {
    "available": [
      {
        "policy_id": "65ab82542b0ca20391caaf66a4d4d7897d281f9c136cd3513136945b",
        "asset_name": "string",
        "quantity": 42
      }
    ],
    "total": [
      {
        "policy_id": "65ab82542b0ca20391caaf66a4d4d7897d281f9c136cd3513136945b",
        "asset_name": "string",
        "quantity": 42
      }
    ]
  },
  "discovery": "sequential",
  "name": "Alan's Wallet",
  "passphrase": {
    "last_updated_at": "2019-02-27T14:46:45Z"
  },
  "state": {
    "status": "ready"
  },
  "tip": {
    "absolute_slot_number": 8086,
    "slot_number": 1337,
    "epoch_number": 14,
    "time": "2019-02-27T14:46:45Z",
    "height": {
      "quantity": 1337,
      "unit": "block"
    }
  }
}