Top up the owner's credits from the Mind's wallet
curl --request POST \
--url https://api.hellopie.xyz/internal/v1/wallet/topup_credits \
--header 'Content-Type: application/json' \
--header 'X-Engine-Key: <api-key>' \
--header 'X-Wallet-Token: <api-key>' \
--data '
{
"amount": "<string>",
"token": "USDC"
}
'import requests
url = "https://api.hellopie.xyz/internal/v1/wallet/topup_credits"
payload = {
"amount": "<string>",
"token": "USDC"
}
headers = {
"X-Engine-Key": "<api-key>",
"X-Wallet-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Engine-Key': '<api-key>',
'X-Wallet-Token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amount: '<string>', token: 'USDC'})
};
fetch('https://api.hellopie.xyz/internal/v1/wallet/topup_credits', 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.hellopie.xyz/internal/v1/wallet/topup_credits",
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([
'amount' => '<string>',
'token' => 'USDC'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Engine-Key: <api-key>",
"X-Wallet-Token: <api-key>"
],
]);
$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.hellopie.xyz/internal/v1/wallet/topup_credits"
payload := strings.NewReader("{\n \"amount\": \"<string>\",\n \"token\": \"USDC\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Engine-Key", "<api-key>")
req.Header.Add("X-Wallet-Token", "<api-key>")
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.hellopie.xyz/internal/v1/wallet/topup_credits")
.header("X-Engine-Key", "<api-key>")
.header("X-Wallet-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"<string>\",\n \"token\": \"USDC\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hellopie.xyz/internal/v1/wallet/topup_credits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Engine-Key"] = '<api-key>'
request["X-Wallet-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"<string>\",\n \"token\": \"USDC\"\n}"
response = http.request(request)
puts response.read_bodyInternal (engine)
Top up the owner's credits from the Mind's wallet
ERC-20 approve plus Credits.deposit(token, amount, owner) from the governed account through the Mind’s role. Loopback only.
POST
/
internal
/
v1
/
wallet
/
topup_credits
Top up the owner's credits from the Mind's wallet
curl --request POST \
--url https://api.hellopie.xyz/internal/v1/wallet/topup_credits \
--header 'Content-Type: application/json' \
--header 'X-Engine-Key: <api-key>' \
--header 'X-Wallet-Token: <api-key>' \
--data '
{
"amount": "<string>",
"token": "USDC"
}
'import requests
url = "https://api.hellopie.xyz/internal/v1/wallet/topup_credits"
payload = {
"amount": "<string>",
"token": "USDC"
}
headers = {
"X-Engine-Key": "<api-key>",
"X-Wallet-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Engine-Key': '<api-key>',
'X-Wallet-Token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amount: '<string>', token: 'USDC'})
};
fetch('https://api.hellopie.xyz/internal/v1/wallet/topup_credits', 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.hellopie.xyz/internal/v1/wallet/topup_credits",
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([
'amount' => '<string>',
'token' => 'USDC'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Engine-Key: <api-key>",
"X-Wallet-Token: <api-key>"
],
]);
$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.hellopie.xyz/internal/v1/wallet/topup_credits"
payload := strings.NewReader("{\n \"amount\": \"<string>\",\n \"token\": \"USDC\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Engine-Key", "<api-key>")
req.Header.Add("X-Wallet-Token", "<api-key>")
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.hellopie.xyz/internal/v1/wallet/topup_credits")
.header("X-Engine-Key", "<api-key>")
.header("X-Wallet-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"<string>\",\n \"token\": \"USDC\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hellopie.xyz/internal/v1/wallet/topup_credits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Engine-Key"] = '<api-key>'
request["X-Wallet-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"<string>\",\n \"token\": \"USDC\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Response
{ status: "topped_up", amount, token, account, paymentId, txHash, explorer } or a refusal { status: "limit_exceeded" | "not_allowed" | "failed", message, paymentId }. Counts against the daily cap and is stored as a payment (counterparty: the Credits contract), so it shows in the payment history and CSV; over the review threshold it is refused. 400 token_not_accepted_for_credits; 403 demo_not_allowed; 503 credits_not_deployed