Import a wallet

How to import an existing wallet.

Import wallets by specifying the importWalletType. We allow:

  1. Importing using a private key
  2. Importing using a keystore
  3. Importing using a WIF
  4. Importing using a WIF with a passphrase
  5. Migration

Additionally, you can specify the userId in the request body to automatically import the wallet and link it to a user. Note that you need to provide a valid signing method in the header request.

Import Wallet Types

{
  "importWalletType": {
    "enum": [
      "AETERNITY_KEYSTORE",
      "AETERNITY_PRIVATE_KEY",
      "BSC_KEYSTORE",
      "BSC_PRIVATE_KEY",
      "AVAC_KEYSTORE",
      "AVAC_PRIVATE_KEY",
      "ETHEREUM_KEYSTORE",
      "MATIC_KEYSTORE",
      "ETHEREUM_PRIVATE_KEY",
      "MATIC_PRIVATE_KEY",
      "GOCHAIN_KEYSTORE",
      "GOCHAIN_PRIVATE_KEY",
      "HEDERA_KEYSTORE",
      "HEDERA_PRIVATE_KEY",
      "VECHAIN_PRIVATE_KEY",
      "VECHAIN_KEYSTORE",
      "BITCOIN_WIF",
      "BITCOIN_WIF_PASSPHRASE",
      "LITECOIN_WIF",
      "LITECOIN_WIF_PASSPHRASE",
      "NEO_KEYSTORE",
      "NEO_PRIVATE_KEY",
      "NEO_WIF",
      "IMX_KEYSTORE",
      "IMX_PRIVATE_KEY",
      "ARBITRUM_KEYSTORE",
      "ARBITRUM_PRIVATE_KEY",
      "MIGRATION"
    ]
  }
}

1. Import using private key

Request Endpoint: reference

POST /api/wallets/import
ParameterParam TypeValueDescription
Signing-MethodHeaderid:valueid: This is the ID of the signing method
value: This is the value of the signing method
ParameterParam TypeDescriptionData TypeMandatory
importWalletTypeBodyThe type of import (eg. MATIC_PRIVATE_KEY)String
privateKeyBodyThe private key of the existing walletString
userIdBodyThe ID of the user you want to link this wallet toString
pincode (Deprecated)BodyThe pincode to encrypt the walletString

2. Import using keystore

Request Endpoint: reference

POST /api/wallets/import
ParameterParam TypeValueDescription
Signing-MethodHeaderid:valueid: This is the ID of the signing method
value: This is the value of the signing method
ParameterParam TypeDescriptionData TypeMandatory
importWalletTypeBodyThe type of import (eg. MATIC_KEYSTORE)String
keystoreBodyJSON file that represents the wallet (warning: this is a string field so make sure the JSON body is escaped properly)String
passwordBodyThe password of the KeystoreString
userIdBodyThe ID of the user you want to link this wallet toString
pincode (Deprecated)BodyThe pincode to encrypt the walletString

3. Import using WIF

Request Endpoint: reference

POST /api/wallets/import
ParameterParam TypeValueDescription
Signing-MethodHeaderid:valueid: This is the ID of the signing method
value: This is the value of the signing method
ParameterParam TypeDescriptionData TypeMandatory
importWalletTypeBodyThe type of import (eg. BITCOIN_WIF)String
wifBodyThe wif (wallet import format)String
userIdBodyThe ID of the user you want to link this wallet toString
pincode (Deprecated)BodyThe pincode to encrypt the walletString

4. Import using WIF with a passphrase

Request Endpoint: reference

POST /api/wallets/import
ParameterParam TypeValueDescription
Signing-MethodHeaderid:valueid: This is the ID of the signing method
value: This is the value of the signing method
ParameterParam TypeDescriptionData TypeMandatory
importWalletTypeBodyThe type of import (eg. LITECOIN_WIF_PASSPHRASE)String
wifBodyThe wif (wallet import format)String
passphraseBodyThe passphrase of the walletString
userIdBodyThe ID of the user you want to link this wallet toString
pincode (Deprecated)BodyThe pincode to encrypt the walletString

5. Import from other secret types (blockchain)

Using this endpoint, it is possible to use the same wallet (address) for a different blockchain. Currently, it is only possible to import to/from these chains:

  • ETHEREUM <-> MATIC
  • BSC <-> ETHEREUM

Request Endpoint: reference

POST /api/wallets/import
ParameterParam TypeValueDescription
Signing-MethodHeaderid:valueid: This is the ID of the signing method
value: This is the value of the signing method
ParameterParam TypeDescriptionData TypeMandatory
importWalletTypeBodyThe type of import (eg. MIGRATION)String
walletIdBodyThe ID of the wallet you want to import into another secret typeString
toBodyDestination SecretType (blockchain), ex: MATICObject
userIdBodyThe ID of the user you want to link this wallet toString
pincode (Deprecated)BodyThe pincode to encrypt the walletString