Create

POST /shared-wallets

status: stable

Create a shared wallet from either an account public key and script templates or mnemonic and script templates.

application/json

Body object Required

One of:

Responses

  • 415 application/json

    Unsupported Media Type

    Hide response attributes Show response attributes object
    • message string Required

      May occur when providing an invalid 'Content-Type' header.

    • code string Required

      Value is unsupported_media_type.

  • 409 application/json

    Conflict

    Hide response attributes Show response attributes object
    • message string Required

      May occur when a otherwise valid request would yield a wallet that already exists.

    • code string Required

      Value is wallet_already_exists.

  • 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.

  • 403 application/json

    Forbidden

    Hide response attributes Show response attributes object
    • message string Required

      Returned when a user tries to create a shared wallet with script template that does not pass validation.

    • code string Required

      Value is shared_wallet_script_template_invalid.

  • 500 application/json

    Forbidden

    Hide response attributes Show response attributes object
    • message string Required

      May occur when there is a missing reward account but wallet participates in staking.

    • code string Required

      Value is missing_reward_account.

  • 201 application/json

    Created

    One of:
POST /shared-wallets
curl \
 --request POST https://localhost:8090/v2/shared-wallets \
 --header "Content-Type: application/json" \
 --data '{"name":"Alan's Wallet","mnemonic_sentence":["squirrel","material","silly","twice","direct","slush","pistol","razor","become","junk","kingdom","flee","squirrel","silly","twice"],"mnemonic_second_factor":["squirrel","material","silly","twice","direct","slush","pistol","razor","become"],"passphrase":"Secure Passphrase","account_index":"1852H","payment_script_template":{"cosigners":[{"cosigner#0":"acct_shared_xvk1z8kc04yh544ksc9h2yhp7p6qwpf6syv5qnm8sgnhdne5z2esht5cwssxsec2wzw3nhxm2d9ph4s6ldmqdvxa0zuxzmukpajhyc7flug3te037"},{"cosigner#0":"self"}],"template":"string"},"delegation_script_template":{"cosigners":[{"cosigner#0":"acct_shared_xvk1z8kc04yh544ksc9h2yhp7p6qwpf6syv5qnm8sgnhdne5z2esht5cwssxsec2wzw3nhxm2d9ph4s6ldmqdvxa0zuxzmukpajhyc7flug3te037"},{"cosigner#0":"self"}],"template":"string"},"script_validation":"required","one_change_address_mode":false}'
{
  "name": "Alan's Wallet",
  "mnemonic_sentence": [
    "squirrel",
    "material",
    "silly",
    "twice",
    "direct",
    "slush",
    "pistol",
    "razor",
    "become",
    "junk",
    "kingdom",
    "flee",
    "squirrel",
    "silly",
    "twice"
  ],
  "mnemonic_second_factor": [
    "squirrel",
    "material",
    "silly",
    "twice",
    "direct",
    "slush",
    "pistol",
    "razor",
    "become"
  ],
  "passphrase": "Secure Passphrase",
  "account_index": "1852H",
  "payment_script_template": {
    "cosigners": [
      {
        "cosigner#0": "acct_shared_xvk1z8kc04yh544ksc9h2yhp7p6qwpf6syv5qnm8sgnhdne5z2esht5cwssxsec2wzw3nhxm2d9ph4s6ldmqdvxa0zuxzmukpajhyc7flug3te037"
      },
      {
        "cosigner#0": "self"
      }
    ],
    "template": "string"
  },
  "delegation_script_template": {
    "cosigners": [
      {
        "cosigner#0": "acct_shared_xvk1z8kc04yh544ksc9h2yhp7p6qwpf6syv5qnm8sgnhdne5z2esht5cwssxsec2wzw3nhxm2d9ph4s6ldmqdvxa0zuxzmukpajhyc7flug3te037"
      },
      {
        "cosigner#0": "self"
      }
    ],
    "template": "string"
  },
  "script_validation": "required",
  "one_change_address_mode": false
}
{
  "name": "Alan's Wallet",
  "account_public_key": "string",
  "account_index": "1852H",
  "payment_script_template": {
    "cosigners": [
      {
        "cosigner#0": "acct_shared_xvk1z8kc04yh544ksc9h2yhp7p6qwpf6syv5qnm8sgnhdne5z2esht5cwssxsec2wzw3nhxm2d9ph4s6ldmqdvxa0zuxzmukpajhyc7flug3te037"
      },
      {
        "cosigner#0": "self"
      }
    ],
    "template": "string"
  },
  "delegation_script_template": {
    "cosigners": [
      {
        "cosigner#0": "acct_shared_xvk1z8kc04yh544ksc9h2yhp7p6qwpf6syv5qnm8sgnhdne5z2esht5cwssxsec2wzw3nhxm2d9ph4s6ldmqdvxa0zuxzmukpajhyc7flug3te037"
      },
      {
        "cosigner#0": "self"
      }
    ],
    "template": "string"
  },
  "script_validation": "required"
}
Response examples (415)
{
  "message": "string",
  "code": "unsupported_media_type"
}
Response examples (409)
{
  "message": "string",
  "code": "wallet_already_exists"
}
Response examples (406)
{
  "message": "string",
  "code": "not_acceptable"
}
Response examples (400)
{
  "message": "string",
  "code": "bad_request"
}
Response examples (403)
{
  "message": "string",
  "code": "shared_wallet_script_template_invalid"
}
Response examples (500)
{
  "message": "string",
  "code": "missing_reward_account"
}
{
  "id": "2512a00e9653fe49a44a5886202e24d77eeb998f",
  "name": "Alan's Wallet",
  "account_index": "1852H",
  "address_pool_gap": 20,
  "payment_script_template": {
    "cosigners": [
      {
        "cosigner#0": "acct_shared_xvk1z8kc04yh544ksc9h2yhp7p6qwpf6syv5qnm8sgnhdne5z2esht5cwssxsec2wzw3nhxm2d9ph4s6ldmqdvxa0zuxzmukpajhyc7flug3te037"
      }
    ],
    "template": "string"
  },
  "delegation_script_template": {
    "cosigners": [
      {
        "cosigner#0": "acct_shared_xvk1z8kc04yh544ksc9h2yhp7p6qwpf6syv5qnm8sgnhdne5z2esht5cwssxsec2wzw3nhxm2d9ph4s6ldmqdvxa0zuxzmukpajhyc7flug3te037"
      }
    ],
    "template": "string"
  },
  "state": {
    "status": "incomplete"
  }
}
{
  "id": "2512a00e9653fe49a44a5886202e24d77eeb998f",
  "name": "Alan's Wallet",
  "account_index": "1852H",
  "address_pool_gap": 20,
  "passphrase": {
    "last_updated_at": "2019-02-27T14:46:45Z"
  },
  "payment_script_template": {
    "cosigners": [
      {
        "cosigner#0": "acct_shared_xvk1z8kc04yh544ksc9h2yhp7p6qwpf6syv5qnm8sgnhdne5z2esht5cwssxsec2wzw3nhxm2d9ph4s6ldmqdvxa0zuxzmukpajhyc7flug3te037"
      }
    ],
    "template": "string"
  },
  "delegation_script_template": {
    "cosigners": [
      {
        "cosigner#0": "acct_shared_xvk1z8kc04yh544ksc9h2yhp7p6qwpf6syv5qnm8sgnhdne5z2esht5cwssxsec2wzw3nhxm2d9ph4s6ldmqdvxa0zuxzmukpajhyc7flug3te037"
      }
    ],
    "template": "string"
  },
  "balance": {
    "available": {
      "quantity": 42000000,
      "unit": "lovelace"
    },
    "reward": {
      "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
      }
    ]
  },
  "delegation": {
    "active": {
      "status": "delegating",
      "target": "1423856bc91c49e928f6f30f4e8d665d53eb4ab6028bd0ac971809d514c92db1"
    },
    "next": [
      {
        "status": "not_delegating",
        "changes_at": {
          "epoch_number": 14,
          "epoch_start_time": "2020-01-22T10:06:39Z"
        }
      }
    ]
  },
  "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"
    }
  }
}