Bind Code
curl --request POST \
--url https://backend-global.gains.trade/api/referrals/bind \
--header 'Content-Type: application/json' \
--data '
{
"message": {
"code": "<string>",
"nonce": 123,
"validUntil": 123,
"owner": "<string>",
"referee": "<string>"
},
"signature": "<string>"
}
'import requests
url = "https://backend-global.gains.trade/api/referrals/bind"
payload = {
"message": {
"code": "<string>",
"nonce": 123,
"validUntil": 123,
"owner": "<string>",
"referee": "<string>"
},
"signature": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
message: {
code: '<string>',
nonce: 123,
validUntil: 123,
owner: '<string>',
referee: '<string>'
},
signature: '<string>'
})
};
fetch('https://backend-global.gains.trade/api/referrals/bind', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://backend-global.gains.trade/api/referrals/bind",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'message' => [
'code' => '<string>',
'nonce' => 123,
'validUntil' => 123,
'owner' => '<string>',
'referee' => '<string>'
],
'signature' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://backend-global.gains.trade/api/referrals/bind"
payload := strings.NewReader("{\n \"message\": {\n \"code\": \"<string>\",\n \"nonce\": 123,\n \"validUntil\": 123,\n \"owner\": \"<string>\",\n \"referee\": \"<string>\"\n },\n \"signature\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://backend-global.gains.trade/api/referrals/bind")
.header("Content-Type", "application/json")
.body("{\n \"message\": {\n \"code\": \"<string>\",\n \"nonce\": 123,\n \"validUntil\": 123,\n \"owner\": \"<string>\",\n \"referee\": \"<string>\"\n },\n \"signature\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://backend-global.gains.trade/api/referrals/bind")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": {\n \"code\": \"<string>\",\n \"nonce\": 123,\n \"validUntil\": 123,\n \"owner\": \"<string>\",\n \"referee\": \"<string>\"\n },\n \"signature\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"result": {
"signer": "<string>"
}
}{
"error": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"message": "<string>",
"success": true
}Referrals
Bind Code
Attaches a referrer to a wallet from an EIP-712 signature.
POST
/
api
/
referrals
/
bind
Bind Code
curl --request POST \
--url https://backend-global.gains.trade/api/referrals/bind \
--header 'Content-Type: application/json' \
--data '
{
"message": {
"code": "<string>",
"nonce": 123,
"validUntil": 123,
"owner": "<string>",
"referee": "<string>"
},
"signature": "<string>"
}
'import requests
url = "https://backend-global.gains.trade/api/referrals/bind"
payload = {
"message": {
"code": "<string>",
"nonce": 123,
"validUntil": 123,
"owner": "<string>",
"referee": "<string>"
},
"signature": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
message: {
code: '<string>',
nonce: 123,
validUntil: 123,
owner: '<string>',
referee: '<string>'
},
signature: '<string>'
})
};
fetch('https://backend-global.gains.trade/api/referrals/bind', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://backend-global.gains.trade/api/referrals/bind",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'message' => [
'code' => '<string>',
'nonce' => 123,
'validUntil' => 123,
'owner' => '<string>',
'referee' => '<string>'
],
'signature' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://backend-global.gains.trade/api/referrals/bind"
payload := strings.NewReader("{\n \"message\": {\n \"code\": \"<string>\",\n \"nonce\": 123,\n \"validUntil\": 123,\n \"owner\": \"<string>\",\n \"referee\": \"<string>\"\n },\n \"signature\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://backend-global.gains.trade/api/referrals/bind")
.header("Content-Type", "application/json")
.body("{\n \"message\": {\n \"code\": \"<string>\",\n \"nonce\": 123,\n \"validUntil\": 123,\n \"owner\": \"<string>\",\n \"referee\": \"<string>\"\n },\n \"signature\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://backend-global.gains.trade/api/referrals/bind")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": {\n \"code\": \"<string>\",\n \"nonce\": 123,\n \"validUntil\": 123,\n \"owner\": \"<string>\",\n \"referee\": \"<string>\"\n },\n \"signature\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"result": {
"signer": "<string>"
}
}{
"error": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"message": "<string>",
"success": true
}Endpoint
POST /api/referrals/bind
Attaches a referrer to a wallet from an EIP-712 signature.
Only accepted while the wallet has never traded on a covered chain. Afterwards it returns 409 AlreadyTraded, permanently. Bind at onboarding, before the wallet reaches the exchange. See Referrals.
Usage Example
curl -X POST "https://backend-global.gains.trade/api/referrals/bind" \
-H "Content-Type: application/json" \
-d '{"message":{...},"signature":"0x..."}'
Response Structure
The generated API panel lists the response schema for status codes: 201, 400, 401, 403, 409, 429, 503. Error responses return anerror field.Body
application/json
Response
Applied
Show child attributes
Show child attributes
⌘I
