Skip to content

register()

Register a new wallet and receive an API key.

DarkfibreSDK.register(privateKey: string): Promise<RegisterResult>
ParameterTypeRequiredDescription
privateKeystringYesBase58-encoded Solana private key (32 or 64 bytes)

Returns a RegisterResult object:

{
apiKey: string; // Your new API key
walletAddress: string; // The registered wallet address
}

The registration process proves wallet ownership:

  1. Creates a message with the current timestamp
  2. Signs the message with your wallet’s private key
  3. Sends the signed message to the registration endpoint
  4. Returns your API key upon successful verification
import { DarkfibreSDK } from '@darkfibre/sdk';
// Register a new wallet
const result = await DarkfibreSDK.register('your-base58-private-key');
console.log('API Key:', result.apiKey);

For a simpler registration experience, use the browser interface:

https://darkfibre.dev/register

Connect your Solana wallet and follow the prompts. The browser handles all signature steps automatically.