curl --request POST \
--url https://hip4-api.totalis.trade/v1/me/wallet-approval \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"value": "10000000000",
"nonce": "1",
"deadline": "1794153600",
"signature": "0xabababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab1b"
}
'import requests
url = "https://hip4-api.totalis.trade/v1/me/wallet-approval"
payload = {
"value": "10000000000",
"nonce": "1",
"deadline": "1794153600",
"signature": "0xabababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab1b"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
value: '10000000000',
nonce: '1',
deadline: '1794153600',
signature: '0xabababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab1b'
})
};
fetch('https://hip4-api.totalis.trade/v1/me/wallet-approval', 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://hip4-api.totalis.trade/v1/me/wallet-approval",
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([
'value' => '10000000000',
'nonce' => '1',
'deadline' => '1794153600',
'signature' => '0xabababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab1b'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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://hip4-api.totalis.trade/v1/me/wallet-approval"
payload := strings.NewReader("{\n \"value\": \"10000000000\",\n \"nonce\": \"1\",\n \"deadline\": \"1794153600\",\n \"signature\": \"0xabababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab1b\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://hip4-api.totalis.trade/v1/me/wallet-approval")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"value\": \"10000000000\",\n \"nonce\": \"1\",\n \"deadline\": \"1794153600\",\n \"signature\": \"0xabababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab1b\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hip4-api.totalis.trade/v1/me/wallet-approval")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"value\": \"10000000000\",\n \"nonce\": \"1\",\n \"deadline\": \"1794153600\",\n \"signature\": \"0xabababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab1b\"\n}"
response = http.request(request)
puts response.read_body{
"request_id": "0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a41",
"operation_id": "0x3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d",
"value": "10000000000",
"nonce": "1",
"deadline": "1794153600",
"status": "QUEUED",
"transaction_hash": null
}{
"error": {
"code": "ORIGIN_REQUIRED",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "FORBIDDEN",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "IDENTITY_NOT_FOUND",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "IDEMPOTENCY_KEY_REUSED",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "INVALID_SIGNATURE",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "RATE_LIMITED",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "BACKOFF"
}
}{
"error": {
"code": "AUTHORIZATION_UNAVAILABLE",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "BACKOFF"
}
}Create wallet approval
Relays the account wallet’s USDC permit setting its approval to the active vault’s WalletAccept to value, with Totalis paying the gas; value 0 revokes it.
Requires a key for your account with funding:deposit, sponsorship:use.
A wallet session for the account also works, with no scope limit, sent from its Origin.
curl --request POST \
--url https://hip4-api.totalis.trade/v1/me/wallet-approval \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"value": "10000000000",
"nonce": "1",
"deadline": "1794153600",
"signature": "0xabababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab1b"
}
'import requests
url = "https://hip4-api.totalis.trade/v1/me/wallet-approval"
payload = {
"value": "10000000000",
"nonce": "1",
"deadline": "1794153600",
"signature": "0xabababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab1b"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
value: '10000000000',
nonce: '1',
deadline: '1794153600',
signature: '0xabababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab1b'
})
};
fetch('https://hip4-api.totalis.trade/v1/me/wallet-approval', 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://hip4-api.totalis.trade/v1/me/wallet-approval",
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([
'value' => '10000000000',
'nonce' => '1',
'deadline' => '1794153600',
'signature' => '0xabababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab1b'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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://hip4-api.totalis.trade/v1/me/wallet-approval"
payload := strings.NewReader("{\n \"value\": \"10000000000\",\n \"nonce\": \"1\",\n \"deadline\": \"1794153600\",\n \"signature\": \"0xabababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab1b\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://hip4-api.totalis.trade/v1/me/wallet-approval")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"value\": \"10000000000\",\n \"nonce\": \"1\",\n \"deadline\": \"1794153600\",\n \"signature\": \"0xabababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab1b\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hip4-api.totalis.trade/v1/me/wallet-approval")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"value\": \"10000000000\",\n \"nonce\": \"1\",\n \"deadline\": \"1794153600\",\n \"signature\": \"0xabababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab1b\"\n}"
response = http.request(request)
puts response.read_body{
"request_id": "0199a1b2-c3d4-7e5f-8a6b-7c8d9e0f1a41",
"operation_id": "0x3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d",
"value": "10000000000",
"nonce": "1",
"deadline": "1794153600",
"status": "QUEUED",
"transaction_hash": null
}{
"error": {
"code": "ORIGIN_REQUIRED",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "FORBIDDEN",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "IDENTITY_NOT_FOUND",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "IDEMPOTENCY_KEY_REUSED",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "INVALID_SIGNATURE",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "NEVER"
}
}{
"error": {
"code": "RATE_LIMITED",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "BACKOFF"
}
}{
"error": {
"code": "AUTHORIZATION_UNAVAILABLE",
"field_violations": [
{
"code": "REQUIRED",
"field": "<string>"
}
],
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry": "BACKOFF"
}
}Authorizations
Scoped API key (ttk_...), created in the Totalis app or by a wallet-session user through the API keys routes with a fresh wallet signature; those routes never accept a key. Each key acts for one account, yours or a maker's, and holds only scopes that account can use. Each operation lists the scopes it requires. Send no Origin.
Headers
Lowercase UUIDv7 naming this command, unique per caller and route. A retry with the same key and body returns the original result; the same key with a different body returns 409 IDEMPOTENCY_KEY_REUSED.
^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$Body
Unix seconds after which USDC refuses the permit; a permit sent after it ends PERMIT_EXPIRED.
20^(0|[1-9][0-9]{0,18}|1[0-7][0-9]{18}|18[0-3][0-9]{17}|184[0-3][0-9]{16}|1844[0-5][0-9]{15}|18446[0-6][0-9]{14}|184467[0-3][0-9]{13}|1844674[0-3][0-9]{12}|184467440[0-6][0-9]{10}|1844674407[0-2][0-9]{9}|18446744073[0-6][0-9]{8}|1844674407370[0-8][0-9]{6}|18446744073709[0-4][0-9]{5}|184467440737095[0-4][0-9]{4}|18446744073709550[0-9]{3}|18446744073709551[0-5][0-9]{2}|1844674407370955160[0-9]|1844674407370955161[0-5])$Response
Admitted, not yet on chain: the permit request as it stands. The approval, or a revoke, takes effect only once its operation is COMMITTED; until then the old approval stands. Follow the operation on the account stream (OPERATION_UPDATED, kind USDC_PERMIT) or resend this request: the same Idempotency-Key and body return the request as it stands before anything else is checked, so save both before the first send. The same permit under another key returns the request it already started.
The permit's deadline, Unix seconds.
20^(0|[1-9][0-9]{0,18}|1[0-7][0-9]{18}|18[0-3][0-9]{17}|184[0-3][0-9]{16}|1844[0-5][0-9]{15}|18446[0-6][0-9]{14}|184467[0-3][0-9]{13}|1844674[0-3][0-9]{12}|184467440[0-6][0-9]{10}|1844674407[0-2][0-9]{9}|18446744073[0-6][0-9]{8}|1844674407370[0-8][0-9]{6}|18446744073709[0-4][0-9]{5}|184467440737095[0-4][0-9]{4}|18446744073709550[0-9]{3}|18446744073709551[0-5][0-9]{2}|1844674407370955160[0-9]|1844674407370955161[0-5])$Why it changed nothing, present only once status is REVERTED or EXPIRED_UNEXECUTED. PERMIT_EXPIRED: its deadline passed first. PERMIT_NONCE_USED: another permit used its nonce first; read the approval before signing again, as it may already be what you wanted. PERMIT_REVERTED: USDC refused it for another reason.
PERMIT_EXPIRED, PERMIT_NONCE_USED, PERMIT_REVERTED Was this page helpful?

