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 of at least 9,900,000 (the lowest the relay accepts by default; the app signs 12,000,000) and 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. Sign it with your account’s current nonce: FoxLeague relays it only when nothing else of your wallet waits in the network’s pool, so it is the next transaction your account runs.

Unlike most routes, this one answers its refusals with an HTTP error status (400, 403, 409, 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 counts, even one refused by a later check, except a call refused because relaying is off or a relayed registration of your wallet is not final yet. 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.
  • Your last relayed registration failed on chain, so FoxLeague does not pay the network fee for this wallet for now. Nothing was sent. You can pay the fee yourself. (403): a relayed registration of your wallet failed on chain within relayer_v3.failed_wallet_block_ms (24 hours by default).
  • Your registration payment is already on its way. Nothing new was sent. Wait until it is final before you try again. (409): a relayed registration of your wallet is not final yet.
  • Your wallet has another transaction still being processed. Nothing was sent. Wait until it is final, then sign the registration again. (409): a transaction of your wallet waits in the network’s pool.
  • The transaction does not carry your wallet's next transaction number. Nothing was sent. Sign the registration again. (403): the transaction’s nonce is not your account’s current nonce.
  • Could not check your wallet on chain. Nothing was sent. Please try again in a moment. (500): your account or its waiting transactions could not be read.
  • wallet holds <balance> FOXSY but the registration fee is <fee> FOXSY (403): the wallet does not hold enough FOXSY.
  • Could not check your FOXSY balance on chain. Nothing was sent. Please try again in a moment. (500): your FOXSY balance could not be read.
  • 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 (by an operator or by itself after relayed transactions of several wallets failed on chain), 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 or writes the amount in another way than the shortest even-length hex.
  • 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's gas limit is too low. Sign the registration again. (403): the gas limit is under the relay’s floor (9,900,000 by default): the registration would run out of gas.
  • 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": "erd1dykjj7pvq8206tnaacakuk0fqz22qlczyqrxmjdpmqlf0egg8wysm2cyun",
"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 or does not carry the account’s current nonce. 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
}

Another transaction of this wallet is still being processed or a relayed registration of this wallet is not final yet; nothing new was sent. Wait until it is final, then try again. 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, the chain could not be read 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
}