Eggs & Spawning

Purchase dragon eggs and gateway keys

Eggs & Spawning API

Purchase dragon eggs, gateway keys, and gateway key vouchers during active spawn cycles.


Get Available Eggs {#get-available}

Retrieve current availability and pricing for eggs and keys.

Endpoint

GET /api/v1/eggs/available

Authentication

Required

Response

{
  "gatewayKeyVouchers": 5,
  "keys": {
    "count": 100,
    "fee": "50.00"
  },
  "eggs": {
    "count": 250,
    "fee": "100.00"
  },
  "gatewayKeyIds": [],
  "eggTransactionLimit": 10,
  "keyTransactionLimit": 5,
  "cryptoSource": "ETH",
  "conversion": {
    "ETH": "0.000025",
    "BTC": "0.0000015"
  },
  "cryptoPaymentAddress": "0x...",
  "isSpawnCycleActive": true
}

Response Fields

FieldTypeDescription
gatewayKeyVouchersintegerAvailable gateway key vouchers
keys.countintegerAvailable keys
keys.feestringPrice per key
eggs.countintegerAvailable eggs
eggs.feestringPrice per egg
eggTransactionLimitintegerMax eggs per transaction
keyTransactionLimitintegerMax keys per transaction
isSpawnCycleActivebooleanWhether spawn cycle is active

Lock Eggs for Purchase {#lock-eggs}

Create a time-limited purchase request for eggs and keys.

Endpoint

POST /api/v1/eggs/spawn/lock

Authentication

Required

Request Body

{
  "eggs": {
    "count": 2,
    "fee": "100.00"
  },
  "keys": {
    "count": 1,
    "fee": "50.00"
  },
  "gatewayKeyVouchers": 2,
  "gatewayKeyIds": [
    101,
    102
  ],
  "cryptoSource": "ETH"
}

Request Fields

FieldTypeRequiredDescription
eggsobjectNoEggs to purchase
eggs.countintegerIf eggsNumber of eggs
eggs.feestringIf eggsPrice per egg (must match current)
keysobjectNoKeys to purchase
keys.countintegerIf keysNumber of keys
keys.feestringIf keysPrice per key (must match current)
gatewayKeyVouchersintegerNoGateway key vouchers (must equal egg count)
gatewayKeyIdsinteger[]If vouchersGateway key IDs (no duplicates)
cryptoSourcestringNoCrypto to use (ETH, BTC, etc.)

Response

{
  "id": 12345,
  "accId": "user-account-id",
  "timestamp": 1700000000,
  "expires": 1700003600,
  "totalFee": "250.00",
  "web3TotalFee": "0.00625",
  "items": {
    "eggs": {
      "count": 2,
      "fee": "100.00"
    },
    "keys": {
      "count": 1,
      "fee": "50.00"
    },
    "gatewayKeyVouchers": 2,
    "gatewayKeyIds": [
      101,
      102
    ],
    "cryptoSource": "ETH"
  }
}

Purchase Limits

Day 1 of season:

  • Maximum 1 egg per transaction
  • Maximum 1 key per transaction

After Day 1:

  • Configurable maximum (varies by season)

Validation Rules

  • Maximum 5 pending purchases per user
  • Requested quantities must not exceed available
  • Requested fees must match current pricing exactly
  • Gateway key vouchers require:
    • gatewayKeyIds array must be provided
    • Array length must equal gatewayKeyVouchers count
    • No duplicate IDs allowed
    • Voucher count must equal egg count

Error Responses

StatusMessageReason
400Duplicate gateway key IDsgatewayKeyIds contains duplicates
400Already have 5 pending purchasesToo many pending requests
400Requested count exceeds availableNot enough eggs/keys available
400Requested fee doesn't matchPricing has changed

Get Hatch Estimate {#hatch-estimate}

Calculate estimated time until a dragon egg hatches.

Endpoint

GET /api/v1/eggs/hatch/estimate/{id}

Authentication

Not required (public endpoint)

Path Parameters

ParameterTypeDescription
idintegerAsset ID of the egg

Response

When egg is hatching:

{
  "minutes": 120,
  "estimatedHatchTime": 1700007200,
  "humanReadable": "approximately 2 hours and 0 minutes"
}

When egg exists but is not hatching:

{
  "minutes": -1,
  "estimatedHatchTime": -1,
  "humanReadable": "This Egg is not hatching."
}

When asset is not an egg:

{
  "minutes": -1,
  "estimatedHatchTime": -1,
  "humanReadable": "This is not an Egg."
}

Calculation Method

  • Uses Bitcoin block confirmations
  • Each block represents approximately 10 minutes
  • Formula: minutes = (targetBlock - currentBlock) * 10

Notes

  • Only works for DRAGON asset type
  • Only provides estimate when hatchState is HATCHING
  • Returns -1 values for non-hatching eggs