---
title: "Binance REST Private Ed25519 JavaScript SDK Example | Siebly"
description: "Binance Auth REST private ed25519 JavaScript example. Read the source code, review its SDK calls, and browse related exchange integration examples."
canonical: "https://siebly.io/examples/Binance/Auth/rest-private-ed25519"
robots: "index,follow"
---

# Binance REST Private Ed25519 JavaScript SDK Example

Binance Auth REST private ed25519 JavaScript example. Read the source code, review its SDK calls, and browse related exchange integration examples.

**Path:** [Home](/) / [Examples](/examples) / [Binance](/examples/Binance) / [auth](/examples/Binance/Auth) / [rest-private-ed25519.ts](/examples/Binance/Auth/rest-private-ed25519)

[View source on GitHub](https://github.com/sieblyio/crypto-api-examples/blob/master/examples/Binance/auth/rest-private-ed25519.ts)

[Open the Binance JavaScript SDK guide](/sdk/binance/javascript)

## rest-private-ed25519.ts

```typescript
import { MainClient } from 'binance';

// Received after creating a new API key with a self-generated RSA public key on binance

// The self-generated RSA private key, this is never directly given to binance, but used to generate a signature
// Note: this MUST include the "BEGIN PRIVATE KEY" header so the SDK understands this is RSA auth
const ed25519PrivateKey = `
-----BEGIN PRIVATE KEY-----
lkmlkm123lkms1s12s+lkmlkm123lkms1s12s
-----END PRIVATE KEY-----
`;

const ed25519APIKey = 'lkmlkm123lkms1s12slkmlkm123lkms1s12slkmlkm123lkms1s12s';

const client = new MainClient({
  api_key: ed25519APIKey,
  api_secret: ed25519PrivateKey,
  beautifyResponses: true,
});

(async () => {
  try {
    console.log('private api call result: ', await client.getAccountInfo());
  } catch (e) {
    console.error('request failed: ', e);
  }
})();
```
