Begin Wallet Registration
curl --request POST \
--url https://api.moonkey.fun/v1/auth/wallets/registrations/begin \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"wallet_type": "ethereum",
"user_id": "user_24wFP9pDa9YiMJLun94iKykoZs2",
"public_address": "0xF7E9D631bfBd90C19691566Db4AB96697A2663C6"
}
'import requests
url = "https://api.moonkey.fun/v1/auth/wallets/registrations/begin"
payload = {
"wallet_type": "ethereum",
"user_id": "user_24wFP9pDa9YiMJLun94iKykoZs2",
"public_address": "0xF7E9D631bfBd90C19691566Db4AB96697A2663C6"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
wallet_type: 'ethereum',
user_id: 'user_24wFP9pDa9YiMJLun94iKykoZs2',
public_address: '0xF7E9D631bfBd90C19691566Db4AB96697A2663C6'
})
};
fetch('https://api.moonkey.fun/v1/auth/wallets/registrations/begin', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.moonkey.fun/v1/auth/wallets/registrations/begin",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'wallet_type' => 'ethereum',
'user_id' => 'user_24wFP9pDa9YiMJLun94iKykoZs2',
'public_address' => '0xF7E9D631bfBd90C19691566Db4AB96697A2663C6'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.moonkey.fun/v1/auth/wallets/registrations/begin"
payload := strings.NewReader("{\n \"wallet_type\": \"ethereum\",\n \"user_id\": \"user_24wFP9pDa9YiMJLun94iKykoZs2\",\n \"public_address\": \"0xF7E9D631bfBd90C19691566Db4AB96697A2663C6\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.moonkey.fun/v1/auth/wallets/registrations/begin")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"wallet_type\": \"ethereum\",\n \"user_id\": \"user_24wFP9pDa9YiMJLun94iKykoZs2\",\n \"public_address\": \"0xF7E9D631bfBd90C19691566Db4AB96697A2663C6\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonkey.fun/v1/auth/wallets/registrations/begin")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"wallet_type\": \"ethereum\",\n \"user_id\": \"user_24wFP9pDa9YiMJLun94iKykoZs2\",\n \"public_address\": \"0xF7E9D631bfBd90C19691566Db4AB96697A2663C6\"\n}"
response = http.request(request)
puts response.read_body{
"id": "walletrr_24vOpv4TpCr2h7urXlV1rkwQPy7",
"app_id": "app_24ydphdixx2ydhF0E5WUFUKWNqi",
"user_id": "user_24wFP9pDa9YiMJLun94iKykoZs2",
"public_address": "0xf7e9d631bfbd90c19691566db4ab96697a2663c6",
"wallet_type": "ethereum",
"challenge": "Login for My App: 5djrPeuvVwO8TAomZJCQ8uig9VeMb8eCxqgz9PIKrFY",
"updated_at": 1644507779,
"created_at": 1644507779
}Wallets Login
Begin Wallet Registration
Initiates a wallet registration request for the specified user. This endpoint will return a challenge that must be signed by the private key of the wallet address you are registering against the user. Once verified, we will attach the wallet to the user specified.
Returns
A successful response returns a WalletRegistration object.
POST
/
v1
/
auth
/
wallets
/
registrations
/
begin
Begin Wallet Registration
curl --request POST \
--url https://api.moonkey.fun/v1/auth/wallets/registrations/begin \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"wallet_type": "ethereum",
"user_id": "user_24wFP9pDa9YiMJLun94iKykoZs2",
"public_address": "0xF7E9D631bfBd90C19691566Db4AB96697A2663C6"
}
'import requests
url = "https://api.moonkey.fun/v1/auth/wallets/registrations/begin"
payload = {
"wallet_type": "ethereum",
"user_id": "user_24wFP9pDa9YiMJLun94iKykoZs2",
"public_address": "0xF7E9D631bfBd90C19691566Db4AB96697A2663C6"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
wallet_type: 'ethereum',
user_id: 'user_24wFP9pDa9YiMJLun94iKykoZs2',
public_address: '0xF7E9D631bfBd90C19691566Db4AB96697A2663C6'
})
};
fetch('https://api.moonkey.fun/v1/auth/wallets/registrations/begin', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.moonkey.fun/v1/auth/wallets/registrations/begin",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'wallet_type' => 'ethereum',
'user_id' => 'user_24wFP9pDa9YiMJLun94iKykoZs2',
'public_address' => '0xF7E9D631bfBd90C19691566Db4AB96697A2663C6'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.moonkey.fun/v1/auth/wallets/registrations/begin"
payload := strings.NewReader("{\n \"wallet_type\": \"ethereum\",\n \"user_id\": \"user_24wFP9pDa9YiMJLun94iKykoZs2\",\n \"public_address\": \"0xF7E9D631bfBd90C19691566Db4AB96697A2663C6\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.moonkey.fun/v1/auth/wallets/registrations/begin")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"wallet_type\": \"ethereum\",\n \"user_id\": \"user_24wFP9pDa9YiMJLun94iKykoZs2\",\n \"public_address\": \"0xF7E9D631bfBd90C19691566Db4AB96697A2663C6\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonkey.fun/v1/auth/wallets/registrations/begin")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"wallet_type\": \"ethereum\",\n \"user_id\": \"user_24wFP9pDa9YiMJLun94iKykoZs2\",\n \"public_address\": \"0xF7E9D631bfBd90C19691566Db4AB96697A2663C6\"\n}"
response = http.request(request)
puts response.read_body{
"id": "walletrr_24vOpv4TpCr2h7urXlV1rkwQPy7",
"app_id": "app_24ydphdixx2ydhF0E5WUFUKWNqi",
"user_id": "user_24wFP9pDa9YiMJLun94iKykoZs2",
"public_address": "0xf7e9d631bfbd90c19691566db4ab96697a2663c6",
"wallet_type": "ethereum",
"challenge": "Login for My App: 5djrPeuvVwO8TAomZJCQ8uig9VeMb8eCxqgz9PIKrFY",
"updated_at": 1644507779,
"created_at": 1644507779
}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
OK