Create Revenue Sharing Contract
curl --request POST \
--url 'https://share-ddn.formless.xyz/v1#contracts_create' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "1",
"method": "contracts_create",
"params": {
"type": "digital_property_with_revenue_share",
"network": "base",
"title": "HYPERMAX SNEAKER RELEASE",
"description": "Community revenue sharing for HYPERMAX sneaker release",
"creator_name": "HYPERMAX Brand",
"revenue_share": {
"recipients": {},
"community_allocation_percent": 100,
"community_split_count": 100,
"distribution_unit": {
"value": 1,
"currency": "USD"
}
},
"revenue_source": {
"product": {
"type": "product"
}
}
}
}
'import requests
url = "https://share-ddn.formless.xyz/v1#contracts_create"
payload = {
"jsonrpc": "2.0",
"id": "1",
"method": "contracts_create",
"params": {
"type": "digital_property_with_revenue_share",
"network": "base",
"title": "HYPERMAX SNEAKER RELEASE",
"description": "Community revenue sharing for HYPERMAX sneaker release",
"creator_name": "HYPERMAX Brand",
"revenue_share": {
"recipients": {},
"community_allocation_percent": 100,
"community_split_count": 100,
"distribution_unit": {
"value": 1,
"currency": "USD"
}
},
"revenue_source": { "product": { "type": "product" } }
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: '1',
method: 'contracts_create',
params: {
type: 'digital_property_with_revenue_share',
network: 'base',
title: 'HYPERMAX SNEAKER RELEASE',
description: 'Community revenue sharing for HYPERMAX sneaker release',
creator_name: 'HYPERMAX Brand',
revenue_share: {
recipients: {},
community_allocation_percent: 100,
community_split_count: 100,
distribution_unit: {value: 1, currency: 'USD'}
},
revenue_source: {product: {type: 'product'}}
}
})
};
fetch('https://share-ddn.formless.xyz/v1#contracts_create', 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://share-ddn.formless.xyz/v1#contracts_create",
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([
'jsonrpc' => '2.0',
'id' => '1',
'method' => 'contracts_create',
'params' => [
'type' => 'digital_property_with_revenue_share',
'network' => 'base',
'title' => 'HYPERMAX SNEAKER RELEASE',
'description' => 'Community revenue sharing for HYPERMAX sneaker release',
'creator_name' => 'HYPERMAX Brand',
'revenue_share' => [
'recipients' => [
],
'community_allocation_percent' => 100,
'community_split_count' => 100,
'distribution_unit' => [
'value' => 1,
'currency' => 'USD'
]
],
'revenue_source' => [
'product' => [
'type' => 'product'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://share-ddn.formless.xyz/v1#contracts_create"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"contracts_create\",\n \"params\": {\n \"type\": \"digital_property_with_revenue_share\",\n \"network\": \"base\",\n \"title\": \"HYPERMAX SNEAKER RELEASE\",\n \"description\": \"Community revenue sharing for HYPERMAX sneaker release\",\n \"creator_name\": \"HYPERMAX Brand\",\n \"revenue_share\": {\n \"recipients\": {},\n \"community_allocation_percent\": 100,\n \"community_split_count\": 100,\n \"distribution_unit\": {\n \"value\": 1,\n \"currency\": \"USD\"\n }\n },\n \"revenue_source\": {\n \"product\": {\n \"type\": \"product\"\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://share-ddn.formless.xyz/v1#contracts_create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"contracts_create\",\n \"params\": {\n \"type\": \"digital_property_with_revenue_share\",\n \"network\": \"base\",\n \"title\": \"HYPERMAX SNEAKER RELEASE\",\n \"description\": \"Community revenue sharing for HYPERMAX sneaker release\",\n \"creator_name\": \"HYPERMAX Brand\",\n \"revenue_share\": {\n \"recipients\": {},\n \"community_allocation_percent\": 100,\n \"community_split_count\": 100,\n \"distribution_unit\": {\n \"value\": 1,\n \"currency\": \"USD\"\n }\n },\n \"revenue_source\": {\n \"product\": {\n \"type\": \"product\"\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://share-ddn.formless.xyz/v1#contracts_create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"contracts_create\",\n \"params\": {\n \"type\": \"digital_property_with_revenue_share\",\n \"network\": \"base\",\n \"title\": \"HYPERMAX SNEAKER RELEASE\",\n \"description\": \"Community revenue sharing for HYPERMAX sneaker release\",\n \"creator_name\": \"HYPERMAX Brand\",\n \"revenue_share\": {\n \"recipients\": {},\n \"community_allocation_percent\": 100,\n \"community_split_count\": 100,\n \"distribution_unit\": {\n \"value\": 1,\n \"currency\": \"USD\"\n }\n },\n \"revenue_source\": {\n \"product\": {\n \"type\": \"product\"\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": "<string>",
"result": {
"status": "success",
"code": 200,
"network_id": 123,
"blockchain_name": "<string>",
"revenue_share_smart_contract_address": "<string>",
"digital_property_contract_address": "<string>",
"digital_property_contract_id": "<string>",
"join_splits_url": "<string>"
}
}Revenue Sharing
Create Contract
Create a revenue sharing smart contract
POST
/
v1#contracts_create
Create Revenue Sharing Contract
curl --request POST \
--url 'https://share-ddn.formless.xyz/v1#contracts_create' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "1",
"method": "contracts_create",
"params": {
"type": "digital_property_with_revenue_share",
"network": "base",
"title": "HYPERMAX SNEAKER RELEASE",
"description": "Community revenue sharing for HYPERMAX sneaker release",
"creator_name": "HYPERMAX Brand",
"revenue_share": {
"recipients": {},
"community_allocation_percent": 100,
"community_split_count": 100,
"distribution_unit": {
"value": 1,
"currency": "USD"
}
},
"revenue_source": {
"product": {
"type": "product"
}
}
}
}
'import requests
url = "https://share-ddn.formless.xyz/v1#contracts_create"
payload = {
"jsonrpc": "2.0",
"id": "1",
"method": "contracts_create",
"params": {
"type": "digital_property_with_revenue_share",
"network": "base",
"title": "HYPERMAX SNEAKER RELEASE",
"description": "Community revenue sharing for HYPERMAX sneaker release",
"creator_name": "HYPERMAX Brand",
"revenue_share": {
"recipients": {},
"community_allocation_percent": 100,
"community_split_count": 100,
"distribution_unit": {
"value": 1,
"currency": "USD"
}
},
"revenue_source": { "product": { "type": "product" } }
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: '1',
method: 'contracts_create',
params: {
type: 'digital_property_with_revenue_share',
network: 'base',
title: 'HYPERMAX SNEAKER RELEASE',
description: 'Community revenue sharing for HYPERMAX sneaker release',
creator_name: 'HYPERMAX Brand',
revenue_share: {
recipients: {},
community_allocation_percent: 100,
community_split_count: 100,
distribution_unit: {value: 1, currency: 'USD'}
},
revenue_source: {product: {type: 'product'}}
}
})
};
fetch('https://share-ddn.formless.xyz/v1#contracts_create', 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://share-ddn.formless.xyz/v1#contracts_create",
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([
'jsonrpc' => '2.0',
'id' => '1',
'method' => 'contracts_create',
'params' => [
'type' => 'digital_property_with_revenue_share',
'network' => 'base',
'title' => 'HYPERMAX SNEAKER RELEASE',
'description' => 'Community revenue sharing for HYPERMAX sneaker release',
'creator_name' => 'HYPERMAX Brand',
'revenue_share' => [
'recipients' => [
],
'community_allocation_percent' => 100,
'community_split_count' => 100,
'distribution_unit' => [
'value' => 1,
'currency' => 'USD'
]
],
'revenue_source' => [
'product' => [
'type' => 'product'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://share-ddn.formless.xyz/v1#contracts_create"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"contracts_create\",\n \"params\": {\n \"type\": \"digital_property_with_revenue_share\",\n \"network\": \"base\",\n \"title\": \"HYPERMAX SNEAKER RELEASE\",\n \"description\": \"Community revenue sharing for HYPERMAX sneaker release\",\n \"creator_name\": \"HYPERMAX Brand\",\n \"revenue_share\": {\n \"recipients\": {},\n \"community_allocation_percent\": 100,\n \"community_split_count\": 100,\n \"distribution_unit\": {\n \"value\": 1,\n \"currency\": \"USD\"\n }\n },\n \"revenue_source\": {\n \"product\": {\n \"type\": \"product\"\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://share-ddn.formless.xyz/v1#contracts_create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"contracts_create\",\n \"params\": {\n \"type\": \"digital_property_with_revenue_share\",\n \"network\": \"base\",\n \"title\": \"HYPERMAX SNEAKER RELEASE\",\n \"description\": \"Community revenue sharing for HYPERMAX sneaker release\",\n \"creator_name\": \"HYPERMAX Brand\",\n \"revenue_share\": {\n \"recipients\": {},\n \"community_allocation_percent\": 100,\n \"community_split_count\": 100,\n \"distribution_unit\": {\n \"value\": 1,\n \"currency\": \"USD\"\n }\n },\n \"revenue_source\": {\n \"product\": {\n \"type\": \"product\"\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://share-ddn.formless.xyz/v1#contracts_create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"contracts_create\",\n \"params\": {\n \"type\": \"digital_property_with_revenue_share\",\n \"network\": \"base\",\n \"title\": \"HYPERMAX SNEAKER RELEASE\",\n \"description\": \"Community revenue sharing for HYPERMAX sneaker release\",\n \"creator_name\": \"HYPERMAX Brand\",\n \"revenue_share\": {\n \"recipients\": {},\n \"community_allocation_percent\": 100,\n \"community_split_count\": 100,\n \"distribution_unit\": {\n \"value\": 1,\n \"currency\": \"USD\"\n }\n },\n \"revenue_source\": {\n \"product\": {\n \"type\": \"product\"\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": "<string>",
"result": {
"status": "success",
"code": 200,
"network_id": 123,
"blockchain_name": "<string>",
"revenue_share_smart_contract_address": "<string>",
"digital_property_contract_address": "<string>",
"digital_property_contract_id": "<string>",
"join_splits_url": "<string>"
}
}Create a revenue sharing smart contract on the blockchain to automatically split payments among recipients and community members.
Authorizations
JWT token with Unique ID identification
Body
application/json
⌘I
