Skip to content

Relay your signed registration fee payment

POST
/api/onboarding/relay
curl --request POST \
--url https://foxleague.ai/api/onboarding/relay \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "signed_tx": "example" }'

Sends the registration fee payment your wallet signed and answers the transaction hash. FoxLeague pays the network fee as the relayer. Wait until that transaction is final, then call POST /api/register to receive your team.

Build the transaction from your wallet to the players contract with value "0", gas price 1,000,000,000, a gas limit at most relayer_max_gas_limit from /api/config, the chain id 1 and, as relayer, the address in relayer_addresses for your wallet’s shard. Its data transfers exactly the registration fee (registration_fee_foxsy_wei) in FOXSY to the contract’s registration call. Sign it and send the SDK’s plain object as signed_tx.

Unlike most routes, this one answers its refusals with an HTTP error status (403, 400, 429, 500 or 503) and the usual JSON body.

Who: a signed-in player whose wallet has not paid the registration fee yet.

Rate limit: 3 calls per 10 minutes per wallet by default. Every call that reaches this check counts, even one refused by a later check. A platform-wide cap also limits relayed registrations.

Refusals:

  • Registration is currently disabled (503): registration is closed.
  • No starter squads in stock right now: your fee was not taken. Please try again later. (503): there are not enough starter cards to build a squad.
  • The chain cannot be read right now. Please try again in a moment. (500): the chain cannot be read right now.
  • Could not check your registration on chain. Please try again in a moment. (500): the fee state could not be read.
  • This wallet has already paid the registration fee. (403): call POST /api/register to receive your team.
  • This wallet does not have access yet. (403): the wallet has not been given access to the game yet.
  • Could not check your access right now. Nothing was sent. Please try again in a moment. (500): the wallet’s access could not be checked.
  • wallet holds <balance> FOXSY but the registration fee is <fee> FOXSY (403): the wallet does not hold enough FOXSY.
  • Too many registration attempts: at most <n> per wallet every <m> minutes. Please wait and try again. (429): the rate limit above is reached.
  • Relayed registration is not available right now. Please try again later. (503): relaying is switched off, the platform-wide limit is reached or no relayer serves your wallet’s shard right now. You can pay the fee yourself.
  • Invalid wallet address. (400): the wallet’s shard cannot be worked out.
  • The transaction is not signed by your wallet. Sign the registration again. (403): the sender is not the session’s wallet.
  • The transaction does not go to the FoxLeague players contract. Sign the registration again. (403): the receiver is not the players contract.
  • The transaction is not the registration payment. Sign the registration again. (403): the data is not a FOXSY transfer to the registration call.
  • The transaction does not pay the registration fee. Sign the registration again. (403): the amount is not the registration fee.
  • The transaction names another relayer than the one for your wallet. Sign the registration again. (403): relayer is not the relayer of your wallet’s shard.
  • The transaction is for another network. Sign the registration again. (403): the chain id is not 1.
  • The transaction's gas price is not the relayed one. Sign the registration again. (403): the gas price is not 1,000,000,000.
  • The transaction's gas limit is too high. Sign the registration again. (403): the gas limit is missing or above relayer_max_gas_limit.
  • The transaction must not send EGLD. Sign the registration again. (403): value is not "0".
  • The registration could not be sent to the network. Please try again in a moment. (500): the network did not take the transaction.
  • The network refused this transaction: your wallet signed it with an out-of-date transaction number. Nothing was sent. Please sign again. (500): sign a new transaction with your wallet’s current nonce.
Media type application/json

The registration fee transaction your wallet signed.

object
signed_tx
required

The signed transaction as the MultiversX SDK’s plain object, with relayer set to the relayer of your wallet’s shard.

Example generated
{
"signed_tx": "example"
}

Success or a refusal: read success (the refusals are in the description).

Media type application/json
object
code

A machine-readable reason next to error, set only where the caller must act differently. tx_pending: the payment was not refused but could not be verified yet; keep the transaction hash and confirm again with the same hash, never pay twice.

string | null
data

The answer. Present when success is true.

object
relayer_address
required

The relayer that carried the transaction.

string
relayer_shard
required

The shard of that relayer, which is your wallet’s shard.

integer format: int32
tx_hash
required

The transaction hash. Wait until it is final, then call POST /api/register.

string
error

Why the request was refused, in plain words. Present when success is false.

string | null
success
required

true when the request did what it asked. false is a refusal: read error.

boolean
Example
{
"data": {
"relayer_address": "erd1f7kfgpqxgmvdpsdj05s6grka6gfputqftf78r57xr0v3zxupyu5v3u70sv",
"relayer_shard": 1,
"tx_hash": "30803889fa6197748d118e3781728a07bbab27f604b8157d03edb92009758340"
},
"success": true
}

The wallet’s shard cannot be worked out. The body is the usual JSON refusal.

Media type application/json
object
code

A machine-readable reason next to error, set only where the caller must act differently. tx_pending: the payment was not refused but could not be verified yet; keep the transaction hash and confirm again with the same hash, never pay twice.

string | null
data

The answer. Present when success is true.

object
relayer_address
required

The relayer that carried the transaction.

string
relayer_shard
required

The shard of that relayer, which is your wallet’s shard.

integer format: int32
tx_hash
required

The transaction hash. Wait until it is final, then call POST /api/register.

string
error

Why the request was refused, in plain words. Present when success is false.

string | null
success
required

true when the request did what it asked. false is a refusal: read error.

boolean
Example generated
{
"code": "example",
"data": {
"relayer_address": "example",
"relayer_shard": 1,
"tx_hash": "example"
},
"error": "example",
"success": true
}

No valid session. The body is plain text: Missing Authorization header, Invalid Authorization format, Invalid session token or Session expired or invalid. Sign in again.

Media type text/plain
string
Example
Session expired or invalid

A check refused the request or the signed transaction: the wallet has paid already or does not hold the fee; the transaction is not the one described above. The body is the usual JSON refusal.

Media type application/json
object
code

A machine-readable reason next to error, set only where the caller must act differently. tx_pending: the payment was not refused but could not be verified yet; keep the transaction hash and confirm again with the same hash, never pay twice.

string | null
data

The answer. Present when success is true.

object
relayer_address
required

The relayer that carried the transaction.

string
relayer_shard
required

The shard of that relayer, which is your wallet’s shard.

integer format: int32
tx_hash
required

The transaction hash. Wait until it is final, then call POST /api/register.

string
error

Why the request was refused, in plain words. Present when success is false.

string | null
success
required

true when the request did what it asked. false is a refusal: read error.

boolean
Example generated
{
"code": "example",
"data": {
"relayer_address": "example",
"relayer_shard": 1,
"tx_hash": "example"
},
"error": "example",
"success": true
}

Too many relay calls from this wallet. The body is the usual JSON refusal.

Media type application/json
object
code

A machine-readable reason next to error, set only where the caller must act differently. tx_pending: the payment was not refused but could not be verified yet; keep the transaction hash and confirm again with the same hash, never pay twice.

string | null
data

The answer. Present when success is true.

object
relayer_address
required

The relayer that carried the transaction.

string
relayer_shard
required

The shard of that relayer, which is your wallet’s shard.

integer format: int32
tx_hash
required

The transaction hash. Wait until it is final, then call POST /api/register.

string
error

Why the request was refused, in plain words. Present when success is false.

string | null
success
required

true when the request did what it asked. false is a refusal: read error.

boolean
Example generated
{
"code": "example",
"data": {
"relayer_address": "example",
"relayer_shard": 1,
"tx_hash": "example"
},
"error": "example",
"success": true
}

The relay failed on our side or the network did not take the transaction; nothing was sent. The body is the usual JSON refusal.

Media type application/json
object
code

A machine-readable reason next to error, set only where the caller must act differently. tx_pending: the payment was not refused but could not be verified yet; keep the transaction hash and confirm again with the same hash, never pay twice.

string | null
data

The answer. Present when success is true.

object
relayer_address
required

The relayer that carried the transaction.

string
relayer_shard
required

The shard of that relayer, which is your wallet’s shard.

integer format: int32
tx_hash
required

The transaction hash. Wait until it is final, then call POST /api/register.

string
error

Why the request was refused, in plain words. Present when success is false.

string | null
success
required

true when the request did what it asked. false is a refusal: read error.

boolean
Example generated
{
"code": "example",
"data": {
"relayer_address": "example",
"relayer_shard": 1,
"tx_hash": "example"
},
"error": "example",
"success": true
}

Relayed registration is not available right now. The body is the usual JSON refusal.

Media type application/json
object
code

A machine-readable reason next to error, set only where the caller must act differently. tx_pending: the payment was not refused but could not be verified yet; keep the transaction hash and confirm again with the same hash, never pay twice.

string | null
data

The answer. Present when success is true.

object
relayer_address
required

The relayer that carried the transaction.

string
relayer_shard
required

The shard of that relayer, which is your wallet’s shard.

integer format: int32
tx_hash
required

The transaction hash. Wait until it is final, then call POST /api/register.

string
error

Why the request was refused, in plain words. Present when success is false.

string | null
success
required

true when the request did what it asked. false is a refusal: read error.

boolean
Example generated
{
"code": "example",
"data": {
"relayer_address": "example",
"relayer_shard": 1,
"tx_hash": "example"
},
"error": "example",
"success": true
}