Auction Houses
Create Shop
Section titled “Create Shop”API Endpoint:
Section titled “API Endpoint:”POST http://localhost:7292/dstapi/DSTV1/SaveDecShopRequest Params:
{ "Name": "Shop Name", "DecShopURL": "tutorial-shop", "Description": "My shop's description...", "OwnerAddress": "Rabc123...", "HostingType": 0, "AutoUpdateNetworkDNS": true}DecShopURL is the bare name: the node adds vfx:// and refuses a URL that already contains it. HostingType is 0 (Network), 1 (SelfHosted, also send IP and Port) or 2 (ThirdParty). The description is limited to 200 words and 1,200 characters. This call saves the shop on the node only; publish it with the next call.
Response:
Section titled “Response:”{ "Success": true, "Message": "Decentralized Auction Shop has been created with name Shop Name"}Code Example
Section titled “Code Example”const createShop = async () => { const payload = { Name: "Shop Name", DecShopURL: "tutorial-shop", Description: "My shop's description...", OwnerAddress: "xDnL4MCGtgHu85JJHdN1fkXinHzKaqVQ59", HostingType: 0, AutoUpdateNetworkDNS: true, };
const url = `${CLI_BASE_URL}/dstapi/DSTV1/SaveDecShop`; const request = await fetch(url, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(payload), });
const data = await request.json();
return data["Success"];};def create_shop(): payload = { "Name": "Shop Name", "DecShopURL": "tutorial-shop", "Description": "My shop's description...", "OwnerAddress": "xDnL4MCGtgHu85JJHdN1fkXinHzKaqVQ59", "HostingType": 0, "AutoUpdateNetworkDNS": True }
url = f"{CLI_BASE_URL}/dstapi/DSTV1/SaveDecShop" headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers) data = response.json()
return data["Success"]Publish Shop to Network
Section titled “Publish Shop to Network”API Endpoint:
Section titled “API Endpoint:”GET http://localhost:7292/dstapi/DSTV1/GetPublishDecShopPublishing sends a shop registration transaction from the owner address. It costs 10 VFX plus the normal network fee.
Response:
Section titled “Response:”{ "Success": true, "Message": "Success! TX ID: abcdfg...", "Hash": "abcdfg..."}Code Example
Section titled “Code Example”const publishShop = async () => { const url = `${CLI_BASE_URL}/dstapi/DSTV1/GetPublishDecShop`; const request = await fetch(url);
const data = await request.json();
console.log(data);
return data["Success"];};def publish_shop(): url = f"{CLI_BASE_URL}/dstapi/DSTV1/GetPublishDecShop" response = requests.get(url) data = response.json()
print(data)
return data["Success"]Get My Shop
Section titled “Get My Shop”API Endpoint:
Section titled “API Endpoint:”GET http://localhost:7292/dstapi/DSTV1/GetDecShopResponse:
Section titled “Response:”{ "Success": true, "Message": "DecShop Found", "DecShop": { ... }}Code Example
Section titled “Code Example”const retrieveShop = async () => { const url = `${CLI_BASE_URL}/dstapi/DSTV1/GetDecShop`; const request = await fetch(url);
const data = await request.json();
if (data["Success"] == true) { return data["DecShop"]; }
return null;};def retrieve_shop(): url = f"{CLI_BASE_URL}/dstapi/DSTV1/GetDecShop" response = requests.get(url) data = response.json()
if data["Success"] == True: return data["DecShop"]
return NoneUpdate Shop
Section titled “Update Shop”API Endpoint:
Section titled “API Endpoint:”POST http://localhost:7292/dstapi/DSTV1/SaveDecShopRequest Params:
{ "Name": "Updated Shop Name", "DecShopURL": "tutorial-shop", "Description": "My updated shop's description...", "OwnerAddress": "xDnL4MCGtgHu85JJHdN1fkXinHzKaqVQ59", "HostingType": 0, "AutoUpdateNetworkDNS": true}Response:
Section titled “Response:”{ "Success": true, "Message": "Decentralized Auction Shop has been updated with name Updated Shop Name"}SaveDecShop changes the local copy only. Publish the change to the network with GetUpdateDecShop, which sends an update transaction costing 1 VFX plus the normal network fee:
GET http://localhost:7292/dstapi/DSTV1/GetUpdateDecShop{ "Success": true, "Message": "Success! TX ID: abcdfg..."}When nothing changed since the last publish, it answers {"Success": false, "Message": "No update is pending."}.
Toggle Offline/Online
Section titled “Toggle Offline/Online”API Endpoint:
Section titled “API Endpoint:”GET http://localhost:7292/dstapi/DSTV1/GetSetShopStatusCode Example
Section titled “Code Example”const toggleShopOnline = async () => { const url = `${CLI_BASE_URL}/dstapi/DSTV1/GetSetShopStatus`; const request = await fetch(url);
const data = await request.json();
console.log(data);
if (data["Success"] == true) { return data["Message"].replace("Is Offline? ", "") == "True"; }
return null;};def toggle_shop_online(): url = f"{CLI_BASE_URL}/dstapi/DSTV1/GetSetShopStatus" response = requests.get(url) data = response.json()
print(data)
if data["Success"] == True: return data["Message"].replace("Is Offline? ", "") == "True"
return NoneDelete Shop from Network
Section titled “Delete Shop from Network”API Endpoint:
Section titled “API Endpoint:”GET http://localhost:7292/dstapi/DSTV1/GetDeleteDecShopDeleting sends a shop delete transaction costing 1 VFX plus the normal network fee.
Code Example
Section titled “Code Example”const deleteNetworkShop = async () => { const url = `${CLI_BASE_URL}/dstapi/DSTV1/GetDeleteDecShop`; const request = await fetch(url);
const data = await request.json();
return data["Success"] == true;};def delete_network_shop(): url = f"{CLI_BASE_URL}/dstapi/DSTV1/GetDeleteDecShop" response = requests.get(url) data = response.json()
return data["Success"] == TrueDelete Shop Locally
Section titled “Delete Shop Locally”API Endpoint:
Section titled “API Endpoint:”GET http://localhost:7292/dstapi/DSTV1/GetDeleteLocalDecShopCode Example
Section titled “Code Example”const deleteShop = async () => { const url = `${CLI_BASE_URL}/dstapi/DSTV1/GetDeleteLocalDecShop`; const request = await fetch(url);
const data = await request.json();
return data["Success"] == true;};def delete_shop(): url = f"{CLI_BASE_URL}/dstapi/DSTV1/GetDeleteLocalDecShop" response = requests.get(url) data = response.json()
return data["Success"] == TrueRetrieve Network Shop
Section titled “Retrieve Network Shop”API Endpoint:
Section titled “API Endpoint:”GET http://localhost:7292/dstapi/DSTV1/GetNetworkDecShopInfo/{url}Code Example
Section titled “Code Example”const retrieveNetworkShop = async (shopUrl) => { const url = `${CLI_BASE_URL}/dstapi/DSTV1/GetNetworkDecShopInfo/${shopUrl}`; const request = await fetch(url);
const data = await request.json();
if (data["Success"] == true) { return data["DecShop"]; }
return null;};def retrieve_network_shop(shop_url): url = f"{CLI_BASE_URL}/dstapi/DSTV1/GetNetworkDecShopInfo/{shop_url}" response = requests.get(url) data = response.json()
if data["Success"] == True: return data["DecShop"]
return NoneURL Params:
Section titled “URL Params:”url: URL of the shop (for example, vfx://tutorial-shop)
Response:
Section titled “Response:”{ "Success": true, "Message": "Shop Found", "DecShop": { ... }}