Passer au contenu principal

Démarrez en 4 étapes

Créez un compte, activez l’automatisation, créez une clé API et effectuez votre première requête.

Étape 1 : Connexion

Connectez-vous sur app.afkcrypto.com.

Étape 2 : Activer l’automatisation (Portefeuilles)

Sur la page Wallets, activez Automation pour votre adresse. Cela permet à AFK de signer des transactions pour des flux automatisés via une signature non dépositaire basée sur des sessions. Vous pouvez révoquer à tout moment.

Étape 3 : Créer une clé API (automatisation de portefeuille)

Dans le tableau de bord API Keys, créez une clé pour l’automatisation des portefeuilles.
  • En-tête : x-api-key: afk_<prefix>_<random>
  • Gardez-la secrète ; faites une rotation si compromise
Voir Authentification pour plus de détails.

Étape 4 : Effectuer des appels API

Définissez votre clé API dans une variable d’environnement pour la réutiliser :
export AFK_API_KEY="afk_abcd_xxx"
curl -s -H "x-api-key: $AFK_API_KEY" \
  "https://api.afkcrypto.com/v1/wallets?chain=ethereum"
{
  "wallets": [
    {
      "address": "0xabc...",
      "chainType": "ethereum",
      "isDefault": true,
      "automationEnabled": true,
      "providerType": "embedded",
      "clientType": "privy"
    }
  ]
}
Indiquez Idempotency-Key: <uuid> pour tous les endpoints d’écriture.
curl -s -X POST https://api.afkcrypto.com/v1/send \
  -H "x-api-key: $AFK_API_KEY" -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "chain":"base-sepolia",
    "asset":"erc20",
    "token":"0xToken",
    "to":"0xRecipient",
    "amount":"1000000000000000000"
  }'
{ "id": "tx_...", "status": "SUBMITTED", "hash": "0x...", "explorerUrl": "https://basescan.org/tx/0x...", "chainName": "Base" }
curl -s -X POST https://api.afkcrypto.com/v1/contracts/send \
  -H "x-api-key: $AFK_API_KEY" -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "chain":"base-sepolia",
    "to":"0xContract",
    "data":"0xabcdef...",
    "value":"0"
  }'
curl -s -X POST https://api.afkcrypto.com/v1/send \
  -H "x-api-key: $AFK_API_KEY" -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "chain":"solana-devnet",
    "asset":"spl",
    "token":"MintAddress",
    "to":"RecipientOwnerAddress",
    "amount":"1000000"
  }'
curl -s -H "x-api-key: $AFK_API_KEY" \
  "https://api.afkcrypto.com/v1/tx/tx_cuid_here"
{
  "id":"tx_cuid_here",
  "status":"PENDING",
  "hash": null,
  "explorerUrl": null,
  "chainName":"Base",
  "chainType":"ethereum",
  "chainId":8453,
  "to":"0xrecipient...",
  "value":"1000000000000000",
  "error": null,
  "createdAt":"2025-08-25T08:00:00.000Z",
  "updatedAt":"2025-08-25T08:00:00.000Z"
}

Prochaines étapes

Découvrez les endpoints principaux :
Besoin d’aide ? Écrivez à hello@afkcrypto.com ou contactez-nous sur Twitter.