Skip to main content
This guide walks you through integrating the Devdraft SDK into your application. You’ll learn how to configure the SDK, initiate transfers (both bank and wallet), and set up webhooks to receive real-time transaction updates.

Overview

The Devdraft SDK provides a unified interface to:

Bank Transfers

Initiate fiat-to-crypto transfers from external bank accounts

Wallet Transfers

Create blockchain-to-blockchain transfers from external wallets

Webhooks

Receive real-time notifications for transfer status updates

Multi-Language Support

Available in TypeScript, Python, Go, Java, PHP, Ruby, and C#

Installation

Configuration

Before making API calls, configure the SDK with your API credentials. You can obtain your x-client-key and x-client-secret from the Devdraft Console.
Never hardcode your API credentials in production code. Always use environment variables or a secure secrets manager.

Direct Bank Transfer

Create a bank-to-wallet transfer where funds come from an external bank account and are deposited into your Devdraft wallet. This is useful for accepting traditional fiat payments.

Parameters

Direct Wallet Transfer

Create a blockchain-to-blockchain transfer where funds come from an external wallet and are deposited into your Devdraft wallet. This is ideal for accepting cryptocurrency payments.

Parameters

Supported Networks

  • Solana (solana)
  • Ethereum (ethereum)
  • Base (base)
  • Polygon (polygon)
  • Arbitrum (arbitrum)
  • Optimism (optimism)
  • Avalanche C-Chain (avalanche_c_chain)

Webhook Integration

Webhooks allow you to receive real-time notifications when transfer statuses change. This is the recommended approach for tracking transaction progress.

Transfer Events

Create a Webhook

List Webhooks

Retrieve all webhooks registered for your application:

Handling Webhook Events

When your webhook endpoint receives an event, verify the signature and process the event:

Complete Integration Example

Here’s a real-world example that demonstrates the complete flow:
  1. Configure the SDK with your API URL and credentials
  2. Retrieve your wallets from the API
  3. Use a wallet ID from the response to initiate a transfer
  4. Set up a webhook to receive real-time transfer status updates
This example shows how to use actual data from API responses in subsequent calls:

Error Handling

All SDK methods may throw exceptions. Here are common error scenarios and how to handle them:

Best Practices

1

Secure Your Credentials

Always use environment variables or a secrets manager for API credentials. Never commit credentials to version control.
2

Implement Webhook Signature Verification

Always verify webhook signatures to ensure events are legitimately from Devdraft and haven’t been tampered with.
3

Handle Errors Gracefully

Implement proper error handling with retry logic for transient failures (5xx errors, rate limits).
4

Use Idempotency

For critical operations, implement idempotency to prevent duplicate transfers in case of network issues.
5

Process Webhooks Asynchronously

Return HTTP 200 quickly from your webhook endpoint and process events asynchronously to avoid timeouts.

Next Steps

Direct Bank Transfer

Learn more about bank transfer options and configurations

Direct Wallet Transfer

Explore wallet transfer networks and currencies

Webhooks Overview

Deep dive into webhook events and security

API Reference

Complete API documentation for all endpoints