Upload Reserve Attestation
curl --request POST \
--url https://api.stateset.com/v1/stablecoin/attestation/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"attestation_date": "<string>",
"report_file": "<string>",
"report_hash": "<string>",
"auditor": {
"firm_name": "<string>",
"license_number": "<string>",
"lead_auditor_name": "<string>",
"signature_date": "<string>"
},
"officer_signatures": [
{
"name": "<string>",
"title": "<string>",
"signature": "<string>",
"signature_date": "<string>"
}
],
"reserve_summary": {
"total_reserves_usd": "<string>",
"total_supply_susd": "<string>",
"reserve_ratio": 123,
"composition": {}
},
"metadata": {
"notes": "<string>",
"material_changes": true
}
}
'import requests
url = "https://api.stateset.com/v1/stablecoin/attestation/upload"
payload = {
"attestation_date": "<string>",
"report_file": "<string>",
"report_hash": "<string>",
"auditor": {
"firm_name": "<string>",
"license_number": "<string>",
"lead_auditor_name": "<string>",
"signature_date": "<string>"
},
"officer_signatures": [
{
"name": "<string>",
"title": "<string>",
"signature": "<string>",
"signature_date": "<string>"
}
],
"reserve_summary": {
"total_reserves_usd": "<string>",
"total_supply_susd": "<string>",
"reserve_ratio": 123,
"composition": {}
},
"metadata": {
"notes": "<string>",
"material_changes": True
}
}
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({
attestation_date: '<string>',
report_file: '<string>',
report_hash: '<string>',
auditor: {
firm_name: '<string>',
license_number: '<string>',
lead_auditor_name: '<string>',
signature_date: '<string>'
},
officer_signatures: [
{
name: '<string>',
title: '<string>',
signature: '<string>',
signature_date: '<string>'
}
],
reserve_summary: {
total_reserves_usd: '<string>',
total_supply_susd: '<string>',
reserve_ratio: 123,
composition: {}
},
metadata: {notes: '<string>', material_changes: true}
})
};
fetch('https://api.stateset.com/v1/stablecoin/attestation/upload', 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.stateset.com/v1/stablecoin/attestation/upload",
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([
'attestation_date' => '<string>',
'report_file' => '<string>',
'report_hash' => '<string>',
'auditor' => [
'firm_name' => '<string>',
'license_number' => '<string>',
'lead_auditor_name' => '<string>',
'signature_date' => '<string>'
],
'officer_signatures' => [
[
'name' => '<string>',
'title' => '<string>',
'signature' => '<string>',
'signature_date' => '<string>'
]
],
'reserve_summary' => [
'total_reserves_usd' => '<string>',
'total_supply_susd' => '<string>',
'reserve_ratio' => 123,
'composition' => [
]
],
'metadata' => [
'notes' => '<string>',
'material_changes' => true
]
]),
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.stateset.com/v1/stablecoin/attestation/upload"
payload := strings.NewReader("{\n \"attestation_date\": \"<string>\",\n \"report_file\": \"<string>\",\n \"report_hash\": \"<string>\",\n \"auditor\": {\n \"firm_name\": \"<string>\",\n \"license_number\": \"<string>\",\n \"lead_auditor_name\": \"<string>\",\n \"signature_date\": \"<string>\"\n },\n \"officer_signatures\": [\n {\n \"name\": \"<string>\",\n \"title\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_date\": \"<string>\"\n }\n ],\n \"reserve_summary\": {\n \"total_reserves_usd\": \"<string>\",\n \"total_supply_susd\": \"<string>\",\n \"reserve_ratio\": 123,\n \"composition\": {}\n },\n \"metadata\": {\n \"notes\": \"<string>\",\n \"material_changes\": true\n }\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.stateset.com/v1/stablecoin/attestation/upload")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"attestation_date\": \"<string>\",\n \"report_file\": \"<string>\",\n \"report_hash\": \"<string>\",\n \"auditor\": {\n \"firm_name\": \"<string>\",\n \"license_number\": \"<string>\",\n \"lead_auditor_name\": \"<string>\",\n \"signature_date\": \"<string>\"\n },\n \"officer_signatures\": [\n {\n \"name\": \"<string>\",\n \"title\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_date\": \"<string>\"\n }\n ],\n \"reserve_summary\": {\n \"total_reserves_usd\": \"<string>\",\n \"total_supply_susd\": \"<string>\",\n \"reserve_ratio\": 123,\n \"composition\": {}\n },\n \"metadata\": {\n \"notes\": \"<string>\",\n \"material_changes\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stateset.com/v1/stablecoin/attestation/upload")
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 \"attestation_date\": \"<string>\",\n \"report_file\": \"<string>\",\n \"report_hash\": \"<string>\",\n \"auditor\": {\n \"firm_name\": \"<string>\",\n \"license_number\": \"<string>\",\n \"lead_auditor_name\": \"<string>\",\n \"signature_date\": \"<string>\"\n },\n \"officer_signatures\": [\n {\n \"name\": \"<string>\",\n \"title\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_date\": \"<string>\"\n }\n ],\n \"reserve_summary\": {\n \"total_reserves_usd\": \"<string>\",\n \"total_supply_susd\": \"<string>\",\n \"reserve_ratio\": 123,\n \"composition\": {}\n },\n \"metadata\": {\n \"notes\": \"<string>\",\n \"material_changes\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"attestation_date": "2025-07-31",
"report_file": "JVBERi0xLjQKJeLjz9MKNCAwIG9iago8PC9GaWx0ZXI...",
"report_hash": "3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5",
"auditor": {
"firm_name": "Ernst & Young LLP",
"license_number": "CPA-123456",
"lead_auditor_name": "Sarah Johnson",
"signature_date": "2025-08-05"
},
"officer_signatures": [
{
"name": "John Smith",
"title": "Chief Executive Officer",
"signature": "MGUCMQCrhPgP3VxqFqFwf+6n...",
"signature_date": "2025-08-05"
},
{
"name": "Jane Doe",
"title": "Chief Financial Officer",
"signature": "MGUCMQDKhPbB4WyqGqGxg+7o...",
"signature_date": "2025-08-05"
}
],
"reserve_summary": {
"total_reserves_usd": "1234567890.00",
"total_supply_susd": "1234567890.00",
"reserve_ratio": 1.0,
"composition": {
"cash": {
"amount": "123456789.00",
"percentage": 10.0
},
"treasury_bills": {
"amount": "864197523.00",
"percentage": 70.0
},
"money_market_funds": {
"amount": "185185183.50",
"percentage": 15.0
},
"repo_agreements": {
"amount": "61728394.50",
"percentage": 5.0
}
}
},
"metadata": {
"notes": "No material changes from previous month",
"material_changes": false
}
}
{
"id": "att_2025_07_abc123",
"status": "verified",
"public_url": "https://reserves.stateset.com/attestations/2025-07-31.pdf",
"verification": {
"hash_verified": true,
"signatures_verified": true,
"compliance_check": "passed"
},
"publication_date": "2025-08-06T00:00:00Z",
"created_at": "2025-08-05T14:30:00Z"
}
Upload Reserve Attestation
Upload monthly reserve attestation reports signed by CPA and officers
POST
/
v1
/
stablecoin
/
attestation
/
upload
Upload Reserve Attestation
curl --request POST \
--url https://api.stateset.com/v1/stablecoin/attestation/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"attestation_date": "<string>",
"report_file": "<string>",
"report_hash": "<string>",
"auditor": {
"firm_name": "<string>",
"license_number": "<string>",
"lead_auditor_name": "<string>",
"signature_date": "<string>"
},
"officer_signatures": [
{
"name": "<string>",
"title": "<string>",
"signature": "<string>",
"signature_date": "<string>"
}
],
"reserve_summary": {
"total_reserves_usd": "<string>",
"total_supply_susd": "<string>",
"reserve_ratio": 123,
"composition": {}
},
"metadata": {
"notes": "<string>",
"material_changes": true
}
}
'import requests
url = "https://api.stateset.com/v1/stablecoin/attestation/upload"
payload = {
"attestation_date": "<string>",
"report_file": "<string>",
"report_hash": "<string>",
"auditor": {
"firm_name": "<string>",
"license_number": "<string>",
"lead_auditor_name": "<string>",
"signature_date": "<string>"
},
"officer_signatures": [
{
"name": "<string>",
"title": "<string>",
"signature": "<string>",
"signature_date": "<string>"
}
],
"reserve_summary": {
"total_reserves_usd": "<string>",
"total_supply_susd": "<string>",
"reserve_ratio": 123,
"composition": {}
},
"metadata": {
"notes": "<string>",
"material_changes": True
}
}
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({
attestation_date: '<string>',
report_file: '<string>',
report_hash: '<string>',
auditor: {
firm_name: '<string>',
license_number: '<string>',
lead_auditor_name: '<string>',
signature_date: '<string>'
},
officer_signatures: [
{
name: '<string>',
title: '<string>',
signature: '<string>',
signature_date: '<string>'
}
],
reserve_summary: {
total_reserves_usd: '<string>',
total_supply_susd: '<string>',
reserve_ratio: 123,
composition: {}
},
metadata: {notes: '<string>', material_changes: true}
})
};
fetch('https://api.stateset.com/v1/stablecoin/attestation/upload', 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.stateset.com/v1/stablecoin/attestation/upload",
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([
'attestation_date' => '<string>',
'report_file' => '<string>',
'report_hash' => '<string>',
'auditor' => [
'firm_name' => '<string>',
'license_number' => '<string>',
'lead_auditor_name' => '<string>',
'signature_date' => '<string>'
],
'officer_signatures' => [
[
'name' => '<string>',
'title' => '<string>',
'signature' => '<string>',
'signature_date' => '<string>'
]
],
'reserve_summary' => [
'total_reserves_usd' => '<string>',
'total_supply_susd' => '<string>',
'reserve_ratio' => 123,
'composition' => [
]
],
'metadata' => [
'notes' => '<string>',
'material_changes' => true
]
]),
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.stateset.com/v1/stablecoin/attestation/upload"
payload := strings.NewReader("{\n \"attestation_date\": \"<string>\",\n \"report_file\": \"<string>\",\n \"report_hash\": \"<string>\",\n \"auditor\": {\n \"firm_name\": \"<string>\",\n \"license_number\": \"<string>\",\n \"lead_auditor_name\": \"<string>\",\n \"signature_date\": \"<string>\"\n },\n \"officer_signatures\": [\n {\n \"name\": \"<string>\",\n \"title\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_date\": \"<string>\"\n }\n ],\n \"reserve_summary\": {\n \"total_reserves_usd\": \"<string>\",\n \"total_supply_susd\": \"<string>\",\n \"reserve_ratio\": 123,\n \"composition\": {}\n },\n \"metadata\": {\n \"notes\": \"<string>\",\n \"material_changes\": true\n }\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.stateset.com/v1/stablecoin/attestation/upload")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"attestation_date\": \"<string>\",\n \"report_file\": \"<string>\",\n \"report_hash\": \"<string>\",\n \"auditor\": {\n \"firm_name\": \"<string>\",\n \"license_number\": \"<string>\",\n \"lead_auditor_name\": \"<string>\",\n \"signature_date\": \"<string>\"\n },\n \"officer_signatures\": [\n {\n \"name\": \"<string>\",\n \"title\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_date\": \"<string>\"\n }\n ],\n \"reserve_summary\": {\n \"total_reserves_usd\": \"<string>\",\n \"total_supply_susd\": \"<string>\",\n \"reserve_ratio\": 123,\n \"composition\": {}\n },\n \"metadata\": {\n \"notes\": \"<string>\",\n \"material_changes\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stateset.com/v1/stablecoin/attestation/upload")
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 \"attestation_date\": \"<string>\",\n \"report_file\": \"<string>\",\n \"report_hash\": \"<string>\",\n \"auditor\": {\n \"firm_name\": \"<string>\",\n \"license_number\": \"<string>\",\n \"lead_auditor_name\": \"<string>\",\n \"signature_date\": \"<string>\"\n },\n \"officer_signatures\": [\n {\n \"name\": \"<string>\",\n \"title\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_date\": \"<string>\"\n }\n ],\n \"reserve_summary\": {\n \"total_reserves_usd\": \"<string>\",\n \"total_supply_susd\": \"<string>\",\n \"reserve_ratio\": 123,\n \"composition\": {}\n },\n \"metadata\": {\n \"notes\": \"<string>\",\n \"material_changes\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"attestation_date": "2025-07-31",
"report_file": "JVBERi0xLjQKJeLjz9MKNCAwIG9iago8PC9GaWx0ZXI...",
"report_hash": "3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5",
"auditor": {
"firm_name": "Ernst & Young LLP",
"license_number": "CPA-123456",
"lead_auditor_name": "Sarah Johnson",
"signature_date": "2025-08-05"
},
"officer_signatures": [
{
"name": "John Smith",
"title": "Chief Executive Officer",
"signature": "MGUCMQCrhPgP3VxqFqFwf+6n...",
"signature_date": "2025-08-05"
},
{
"name": "Jane Doe",
"title": "Chief Financial Officer",
"signature": "MGUCMQDKhPbB4WyqGqGxg+7o...",
"signature_date": "2025-08-05"
}
],
"reserve_summary": {
"total_reserves_usd": "1234567890.00",
"total_supply_susd": "1234567890.00",
"reserve_ratio": 1.0,
"composition": {
"cash": {
"amount": "123456789.00",
"percentage": 10.0
},
"treasury_bills": {
"amount": "864197523.00",
"percentage": 70.0
},
"money_market_funds": {
"amount": "185185183.50",
"percentage": 15.0
},
"repo_agreements": {
"amount": "61728394.50",
"percentage": 5.0
}
}
},
"metadata": {
"notes": "No material changes from previous month",
"material_changes": false
}
}
{
"id": "att_2025_07_abc123",
"status": "verified",
"public_url": "https://reserves.stateset.com/attestations/2025-07-31.pdf",
"verification": {
"hash_verified": true,
"signatures_verified": true,
"compliance_check": "passed"
},
"publication_date": "2025-08-06T00:00:00Z",
"created_at": "2025-08-05T14:30:00Z"
}
This endpoint is restricted to authorized administrators for uploading monthly reserve attestation reports as required by the GENIUS Act of 2025.
Authentication
This endpoint requires admin-level authentication with attestation upload permissions.Authorization: Bearer YOUR_ADMIN_TOKEN
X-HMAC-Signature: YOUR_HMAC_SIGNATURE
X-Admin-Certificate: YOUR_ADMIN_CERT
Request Body
The month/year of the attestation (YYYY-MM-DD format, must be last day of month)Example:
2025-07-31Base64 encoded PDF of the signed attestation report
SHA-256 hash of the report file for integrity verification
Summary of reserve composition
Response
Unique attestation record ID
Upload status: “pending_verification”, “verified”, “published”
Public URL where the attestation will be accessible
When the attestation will be publicly available
ISO 8601 timestamp of upload
{
"attestation_date": "2025-07-31",
"report_file": "JVBERi0xLjQKJeLjz9MKNCAwIG9iago8PC9GaWx0ZXI...",
"report_hash": "3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5",
"auditor": {
"firm_name": "Ernst & Young LLP",
"license_number": "CPA-123456",
"lead_auditor_name": "Sarah Johnson",
"signature_date": "2025-08-05"
},
"officer_signatures": [
{
"name": "John Smith",
"title": "Chief Executive Officer",
"signature": "MGUCMQCrhPgP3VxqFqFwf+6n...",
"signature_date": "2025-08-05"
},
{
"name": "Jane Doe",
"title": "Chief Financial Officer",
"signature": "MGUCMQDKhPbB4WyqGqGxg+7o...",
"signature_date": "2025-08-05"
}
],
"reserve_summary": {
"total_reserves_usd": "1234567890.00",
"total_supply_susd": "1234567890.00",
"reserve_ratio": 1.0,
"composition": {
"cash": {
"amount": "123456789.00",
"percentage": 10.0
},
"treasury_bills": {
"amount": "864197523.00",
"percentage": 70.0
},
"money_market_funds": {
"amount": "185185183.50",
"percentage": 15.0
},
"repo_agreements": {
"amount": "61728394.50",
"percentage": 5.0
}
}
},
"metadata": {
"notes": "No material changes from previous month",
"material_changes": false
}
}
{
"id": "att_2025_07_abc123",
"status": "verified",
"public_url": "https://reserves.stateset.com/attestations/2025-07-31.pdf",
"verification": {
"hash_verified": true,
"signatures_verified": true,
"compliance_check": "passed"
},
"publication_date": "2025-08-06T00:00:00Z",
"created_at": "2025-08-05T14:30:00Z"
}
Error Codes
| Code | Description |
|---|---|
400 | Invalid request format or missing required fields |
401 | Unauthorized - Invalid admin credentials |
403 | Forbidden - Insufficient permissions |
409 | Conflict - Attestation for this month already exists |
422 | Validation failed - Invalid signatures or data |
500 | Internal server error |
Compliance Notes
- Attestations must be uploaded within 5 business days of month end
- All signatures must be from authorized officers on file
- Criminal penalties apply for false or misleading attestations
- Reports are immutable once published
Code Examples
const axios = require('axios');
const fs = require('fs');
const crypto = require('crypto');
async function uploadAttestation(pdfPath, attestationData) {
// Read and encode PDF
const pdfBuffer = fs.readFileSync(pdfPath);
const pdfBase64 = pdfBuffer.toString('base64');
// Calculate hash
const hash = crypto.createHash('sha256');
hash.update(pdfBuffer);
const pdfHash = hash.digest('hex');
// Prepare request
const requestData = {
attestation_date: attestationData.date,
report_file: pdfBase64,
report_hash: pdfHash,
auditor: attestationData.auditor,
officer_signatures: attestationData.signatures,
reserve_summary: attestationData.summary
};
try {
const response = await axios.post(
'https://api.stateset.com/v1/stablecoin/attestation/upload',
requestData,
{
headers: {
'Authorization': 'Bearer YOUR_ADMIN_TOKEN',
'X-HMAC-Signature': generateHMAC(requestData),
'X-Admin-Certificate': 'YOUR_ADMIN_CERT',
'Content-Type': 'application/json'
}
}
);
console.log('Attestation uploaded:', response.data);
console.log('Public URL:', response.data.public_url);
return response.data;
} catch (error) {
console.error('Upload failed:', error.response.data);
throw error;
}
}
import requests
import base64
import hashlib
import json
from datetime import datetime
class AttestationUploader:
def __init__(self, admin_token, admin_cert):
self.admin_token = admin_token
self.admin_cert = admin_cert
self.base_url = "https://api.stateset.com/v1/stablecoin"
def upload_attestation(self, pdf_path, attestation_data):
"""Upload monthly reserve attestation"""
# Read and encode PDF
with open(pdf_path, 'rb') as f:
pdf_content = f.read()
pdf_base64 = base64.b64encode(pdf_content).decode('utf-8')
# Calculate hash
pdf_hash = hashlib.sha256(pdf_content).hexdigest()
# Validate attestation date is last day of month
date = datetime.strptime(attestation_data['date'], '%Y-%m-%d')
next_month = date.replace(day=28) + datetime.timedelta(days=4)
last_day = next_month - datetime.timedelta(days=next_month.day)
if date.date() != last_day.date():
raise ValueError("Attestation date must be last day of month")
# Prepare request
request_data = {
"attestation_date": attestation_data['date'],
"report_file": pdf_base64,
"report_hash": pdf_hash,
"auditor": attestation_data['auditor'],
"officer_signatures": attestation_data['signatures'],
"reserve_summary": attestation_data['summary'],
"metadata": attestation_data.get('metadata', {})
}
# Generate HMAC signature
hmac_signature = self.generate_hmac(request_data)
headers = {
"Authorization": f"Bearer {self.admin_token}",
"X-HMAC-Signature": hmac_signature,
"X-Admin-Certificate": self.admin_cert,
"Content-Type": "application/json"
}
try:
response = requests.post(
f"{self.base_url}/attestation/upload",
json=request_data,
headers=headers
)
response.raise_for_status()
result = response.json()
print(f"Attestation uploaded successfully!")
print(f"ID: {result['id']}")
print(f"Status: {result['status']}")
print(f"Public URL: {result['public_url']}")
return result
except requests.exceptions.RequestException as e:
print(f"Upload failed: {e}")
if hasattr(e, 'response') and e.response:
print(f"Error details: {e.response.json()}")
raise
# Example usage
uploader = AttestationUploader("YOUR_ADMIN_TOKEN", "YOUR_ADMIN_CERT")
attestation_data = {
"date": "2025-07-31",
"auditor": {
"firm_name": "Ernst & Young LLP",
"license_number": "CPA-123456",
"lead_auditor_name": "Sarah Johnson",
"signature_date": "2025-08-05"
},
"signatures": [
{
"name": "John Smith",
"title": "Chief Executive Officer",
"signature": "MGUCMQCrhPgP3VxqFqFwf+6n...",
"signature_date": "2025-08-05"
},
{
"name": "Jane Doe",
"title": "Chief Financial Officer",
"signature": "MGUCMQDKhPbB4WyqGqGxg+7o...",
"signature_date": "2025-08-05"
}
],
"summary": {
"total_reserves_usd": "1234567890.00",
"total_supply_susd": "1234567890.00",
"reserve_ratio": 1.0,
"composition": {
"cash": {"amount": "123456789.00", "percentage": 10.0},
"treasury_bills": {"amount": "864197523.00", "percentage": 70.0},
"money_market_funds": {"amount": "185185183.50", "percentage": 15.0},
"repo_agreements": {"amount": "61728394.50", "percentage": 5.0}
}
}
}
uploader.upload_attestation("july_2025_attestation.pdf", attestation_data)
⌘I