Skip to main content
POST
/
api
/
wallets
Create Server Wallet
curl --request POST \
  --url https://api.dexaggregatorbeta.xyz/api/wallets \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "userId": "user_123"
}
'
{
  "success": true,
  "userId": "<string>",
  "address": "<string>",
  "walletId": "<string>",
  "publicKey": "<string>"
}

Server Wallet Management

Create and manage server-side wallets secured with MPC (Multi-Party Computation) key management through Dynamic Labs. These wallets are used for all trading operations across supported exchanges.

Create Wallet

Create a new server wallet for a user. The wallet is secured with a 2-of-2 MPC threshold scheme.

Endpoint

POST /api/wallets

Request Body

{
  "userId": "user_123"
}
FieldTypeRequiredDescription
userIdstringYesUnique identifier for the user

Response

{
  "success": true,
  "userId": "user_123",
  "address": "0x173404aAAa4d6539e2C7dbcC1931Cf41b3A3D5c7",
  "walletId": "29dd4dc0-1ff9-4df6-a19f-936f997cbc5a",
  "publicKey": "04090ce18936a64a24c48624d5734edf96d33a5f3d79bb014f27ebfa2197a813cfc46009ac278f4de56afc3e48733d1adf1a6cf804e6b20ddf55a9f5d4f651104a"
}

Response Fields

FieldTypeDescription
successbooleanOperation status
userIdstringUser identifier (used for wallet lookup)
addressstringWallet address (0x…) - needed for deposits & transactions
walletIdstringWallet UUID - needed for API registration & signing
publicKeystringPublic key for verification

Example Request

curl -X POST https://api.dexaggregatorbeta.xyz/api/wallets \
  -H "Content-Type: application/json" \
  -d '{"userId":"user_123"}'
const response = await axios.post('https://api.dexaggregatorbeta.xyz/api/wallets', {
  userId: 'user_123'
});

Get Wallet

Retrieve wallet information by userId, walletId, or wallet address.

Endpoint

GET /api/wallets/:walletIdOrAddress

Path Parameters

ParameterTypeDescription
walletIdOrAddressstringCan be userId, walletId (UUID), or address (0x…)

Example Requests

# By userId
curl https://api.dexaggregatorbeta.xyz/api/wallets/user_123

# By walletId
curl https://api.dexaggregatorbeta.xyz/api/wallets/29dd4dc0-1ff9-4df6-a19f-936f997cbc5a

# By address
curl https://api.dexaggregatorbeta.xyz/api/wallets/0x173404aAAa4d6539e2C7dbcC1931Cf41b3A3D5c7

Response

{
  "success": true,
  "userId": "user_123",
  "address": "0x173404aAAa4d6539e2C7dbcC1931Cf41b3A3D5c7",
  "walletId": "29dd4dc0-1ff9-4df6-a19f-936f997cbc5a",
  "publicKey": "04090ce18936a64a24c48624d5734edf96d33a5f3d79bb014f27ebfa2197a813cfc46009ac278f4de56afc3e48733d1adf1a6cf804e6b20ddf55a9f5d4f651104a"
}

Error Responses

400 Bad Request
{
  "error": "Missing wallet identifier"
}
404 Not Found
{
  "error": "Wallet not found"
}

Sign Message

Sign an arbitrary message using the server wallet’s MPC-managed key shares.

Endpoint

POST /api/wallets/:walletIdOrAddress/sign

Path Parameters

ParameterTypeDescription
walletIdOrAddressstringCan be userId, walletId (UUID), or address (0x…)

Request Body

{
  "message": "Hello, World!"
}
FieldTypeRequiredDescription
messagestringYesMessage to sign

Response

{
  "success": true,
  "signature": "0x5522633926941ce275ded2f02dec36b5c09532f0047542cbec35731338739403382ab7c700f01760238152ce9f594fe522ef79a86075a936f4e89a1f9baaa3f61c",
  "message": "Hello, World!"
}

Example Request

curl -X POST https://api.dexaggregatorbeta.xyz/api/wallets/user_123/sign \
  -H "Content-Type: application/json" \
  -d '{"message":"Hello, World!"}'
const response = await axios.post(
  'https://api.dexaggregatorbeta.xyz/api/wallets/user_123/sign',
  { message: 'Hello, World!' }
);

Error Responses

400 Bad Request
{
  "error": "Missing message"
}
404 Not Found
{
  "error": "Wallet not found"
}
500 Internal Server Error
{
  "error": "Failed to sign message"
}

Security Features

  • MPC Key Management: Wallets use 2-of-2 threshold signature scheme
  • Encrypted Storage: Private key shares are encrypted at rest
  • No Single Point of Failure: Key shares are distributed across multiple parties
  • Secure Signing: All signing operations use MPC protocol

Use Cases

  • Create wallets for new users joining the platform
  • Retrieve wallet information for trading operations
  • Sign messages for exchange API registration
  • Sign transactions for deposits and withdrawals
Server wallets are managed by the platform. Never expose wallet credentials or private key shares to clients.
Store the walletId and address returned from wallet creation. You’ll need these for all subsequent trading operations.

Environment Configuration

Required environment variables:
DYNAMIC_AUTH_TOKEN=<your_dynamic_auth_token>
DYNAMIC_ENV_ID=<your_dynamic_environment_id>
WALLET_PASSWORD=<secure_password>
Get these credentials from Dynamic Labs Dashboard.

Authorizations

X-API-KEY
string
header
required

Body

application/json
userId
string
required

Unique identifier for the user

Example:

"user_123"

Response

Wallet created successfully

success
boolean
userId
string

User identifier

address
string

Wallet address (0x...)

walletId
string

Wallet UUID

publicKey
string

Public key for verification