curl --request POST \
--url https://api.moonkey.fun/v1/wallets/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_id": "user_2sfOL5Kwoymy8KdtzWrhZQY5V6s",
"wallet": {
"public_address": "HJkpTBbR7Q5dg3cuuXgrFptyftGB5gDFqs5BvnVaHRr8",
"wallet_type": "solana",
"encryption_type": "HPKE",
"entropy_type": "private_key",
"ciphertext": "YRl6RRq7En6SoxR9GfAh7nre7ubQBpMoeIHGzcfviw8VCcfwl9+b6vtRJm3ESIGm11n++09AfZoqspogSvDIw5LHZgbNEyTHj6VV/xTTikY9D3Btlz9UqqtW5NLYNBPHx+xD6Y5zQ80=",
"encapsulated_key": "KYWtb3Q4IOm2iMespNPMm/n691cxE2vJoFE7wLDe1gI="
}
}
'{
"id": "wallet_36l2o0DBM2fSGozFKrVxgNWdKYW",
"app_id": "6e7c9f1b-5e66-400c-99a7-783411e03aac",
"user_id": "user_2sfOL5Kwoymy8KdtzWrhZQY5V6s",
"public_address": "HJkpTBbR7Q5dg3cuuXgrFptyftGB5gDFqs5BvnVaHRr8",
"wallet_type": "solana",
"wallet_client_type": null,
"wallet_pk_id": "walletpk_36l2o1Q0L2H3mnfGZJ51O2cgqv6",
"verified": true,
"is_default": false,
"is_read_only": false,
"is_imported": true,
"delegated": false,
"account_index": null,
"updated_at": 1765567007,
"created_at": 1765567007
}Wallet Import
Import Wallet
Completes the wallet import process by submitting the HPKE-encrypted wallet entropy.
This endpoint receives the encrypted entropy (either HD seed or private key) that was encrypted using the public key obtained from the /v1/wallets/import/begin endpoint.
Security Model
- The wallet entropy is encrypted client-side using HPKE with the server’s public key.
- The ciphertext and encapsulated key are submitted to this endpoint.
- Raw entropy never touches the server in plaintext.
- If an existing wallet of the given wallet type has been created for that user, it will be returned.
Returns
A successful response returns a Wallet object with is_imported set to true.
POST
/
v1
/
wallets
/
import
curl --request POST \
--url https://api.moonkey.fun/v1/wallets/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_id": "user_2sfOL5Kwoymy8KdtzWrhZQY5V6s",
"wallet": {
"public_address": "HJkpTBbR7Q5dg3cuuXgrFptyftGB5gDFqs5BvnVaHRr8",
"wallet_type": "solana",
"encryption_type": "HPKE",
"entropy_type": "private_key",
"ciphertext": "YRl6RRq7En6SoxR9GfAh7nre7ubQBpMoeIHGzcfviw8VCcfwl9+b6vtRJm3ESIGm11n++09AfZoqspogSvDIw5LHZgbNEyTHj6VV/xTTikY9D3Btlz9UqqtW5NLYNBPHx+xD6Y5zQ80=",
"encapsulated_key": "KYWtb3Q4IOm2iMespNPMm/n691cxE2vJoFE7wLDe1gI="
}
}
'{
"id": "wallet_36l2o0DBM2fSGozFKrVxgNWdKYW",
"app_id": "6e7c9f1b-5e66-400c-99a7-783411e03aac",
"user_id": "user_2sfOL5Kwoymy8KdtzWrhZQY5V6s",
"public_address": "HJkpTBbR7Q5dg3cuuXgrFptyftGB5gDFqs5BvnVaHRr8",
"wallet_type": "solana",
"wallet_client_type": null,
"wallet_pk_id": "walletpk_36l2o1Q0L2H3mnfGZJ51O2cgqv6",
"verified": true,
"is_default": false,
"is_read_only": false,
"is_imported": true,
"delegated": false,
"account_index": null,
"updated_at": 1765567007,
"created_at": 1765567007
}Authorizations
Auth Platform API includes all the Auth related features. All Users, Phone Numbers, Emails, and OTPs are associated with an App as the container.
Endpoints only accept App's Secret API keys other than certain endpoints that are used client side or via SDK that accept the public_token.
Authentication using App Api Key
Header:
Authorization: Bearer {api_key}
Authenticated Request
curl \
-X GET https://api.moonkey.fun/v1/auth/users/user_24wFP9pDa9YiMJLun94iKykoZs2 \
-H "Authorization: Bearer sk_test_pRqweh3wvWmJAAVYv7Z0T5iPLzFM4ql0muoyQcjOxGeN3p1r"
Body
application/json
Response
200 - application/json
Import Wallet response