Api Reference

Get turret information

get

Returns basic information about the turret

Responses
200
Success
application/json
get
GET / HTTP/1.1
Host: valid-turret-address
Accept: */*
200

Success

{
  "turret": "GB4OYM7TQTJSROWXHOJLKAX2IJ2QN4I6S6GCJH4MGWVTAO5Q5DPNADXX",
  "network": "TESTNET",
  "horizon": "https://horizon-testnet.stellar.org",
  "version": "v0.0.0-ff9e9750369cc8aed29af9f08ae34634594cbe41",
  "fee": {
    "min": 1,
    "max": 10,
    "days": 180
  },
  "divisor": {
    "upload": 1000,
    "run": 100000
  }
}

Upload a txFunction

post

Uploads a txFunction to the turret.

Body
txFunctionstringOptional

The source code to be uploaded

Example: /some/path/txFunction.js
txFunctionFieldsstringOptional

A Base64 encoded array of json object of the input fields for the contract in this format: [ { "name": "paramName", "type": "string", "description": "This is a param", "rule": "Required" } ] Valid rules are Required and Optional

Example: W3sibmFtZSI6ImRlc3RpbmF0aW9uIiwidHlwZSI6InN0cmluZyIsImRlc2NyaXB0aW9uIjoiU3RlbGxhciBwdWJsaWMga2V5IHlvdSdkIGxpa2UgdG8gcGF5IiwicnVsZSI6Ik11c3QgYmUgYSB2YWxpZCBhbmQgZnVuZGVkIFN0ZWxsYXIgcHVibGljIGtleSJ9XQ
txFunctionFeestringOptional

A signed, non-submitted transaction envelope XDR for a fee payment to the TURRET_ADDRESS that is greater than or equal to the byte length of the contract divided by the UPLOAD_DIVISOR set by the turret

Example: AAAAAgAAAABTqjFHz0quLSka8SOrkw7R07aqDNUHAe+Qm5PX0jMiGwAAAGQAHfBZAAAADgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAB47DPzhNMoutc7krUC+kJ1BvEel4wkn4w1qzA7sOje0AAAAAAAAAAAAJiWgAAAAAAAAAAB0jMiGwAAAEAZjWTnxXY2lxVt0VSos6/Uvpoo3pXo6l+0Xk/P+sE5KDPwhAYkVQyXEBb8prEYprzp3aSlLF4TKcw3m/RM5IMK
Responses
200
txFunction uploaded
application/json
post
POST /tx-functions HTTP/1.1
Host: valid-turret-address
Content-Type: multipart/form-data
Accept: */*
Content-Length: 568

{
  "txFunction": "/some/path/txFunction.js",
  "txFunctionFields": "W3sibmFtZSI6ImRlc3RpbmF0aW9uIiwidHlwZSI6InN0cmluZyIsImRlc2NyaXB0aW9uIjoiU3RlbGxhciBwdWJsaWMga2V5IHlvdSdkIGxpa2UgdG8gcGF5IiwicnVsZSI6Ik11c3QgYmUgYSB2YWxpZCBhbmQgZnVuZGVkIFN0ZWxsYXIgcHVibGljIGtleSJ9XQ",
  "txFunctionFee": "AAAAAgAAAABTqjFHz0quLSka8SOrkw7R07aqDNUHAe+Qm5PX0jMiGwAAAGQAHfBZAAAADgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAB47DPzhNMoutc7krUC+kJ1BvEel4wkn4w1qzA7sOje0AAAAAAAAAAAAJiWgAAAAAAAAAAB0jMiGwAAAEAZjWTnxXY2lxVt0VSos6/Uvpoo3pXo6l+0Xk/P+sE5KDPwhAYkVQyXEBb8prEYprzp3aSlLF4TKcw3m/RM5IMK"
}
{
  "hash": "78565516a844fd4dfc5a7fc7da822028b04ee0aeaf981a4a914d4510906a7a32",
  "signer": "GB6VNMGXKHS4UTIXW7U23ZQFWD7UJIWCJNQZR7ISNKBTYNULCFQKKPIK"
}

Send a fee payment to the turret

post

Sends a fee payment to the turret

Path parameters
publicKeystringRequired

The Stellar public address of the account to apply the fee payment to

Body
txFunctionFeestringOptional

A signed, non-submitted transaction envelope XDR for a fee payment to the TURRET_ADDRESS that is greater than or equal to the byte length of the contract divided by the UPLOAD_DIVISOR set by the turret

Example: AAAAAgAAAABTqjFHz0quLSka8SOrkw7R07aqDNUHAe+Qm5PX0jMiGwAAAGQAHfBZAAAADgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAB47DPzhNMoutc7krUC+kJ1BvEel4wkn4w1qzA7sOje0AAAAAAAAAAAAJiWgAAAAAAAAAAB0jMiGwAAAEAZjWTnxXY2lxVt0VSos6/Uvpoo3pXo6l+0Xk/P+sE5KDPwhAYkVQyXEBb8prEYprzp3aSlLF4TKcw3m/RM5IMK
Responses
200
Fee payment applied
application/json
post
POST /tx-fees/{publicKey} HTTP/1.1
Host: valid-turret-address
Content-Type: application/json
Accept: */*
Content-Length: 308

{
  "txFunctionFee": "AAAAAgAAAABTqjFHz0quLSka8SOrkw7R07aqDNUHAe+Qm5PX0jMiGwAAAGQAHfBZAAAADgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAB47DPzhNMoutc7krUC+kJ1BvEel4wkn4w1qzA7sOje0AAAAAAAAAAAAJiWgAAAAAAAAAAB0jMiGwAAAEAZjWTnxXY2lxVt0VSos6/Uvpoo3pXo6l+0Xk/P+sE5KDPwhAYkVQyXEBb8prEYprzp3aSlLF4TKcw3m/RM5IMK"
}
{
  "publicKey": "GB6VNMGXKHS4UTIXW7U23ZQFWD7UJIWCJNQZR7ISNKBTYNULCFQKKPIK",
  "lastModifiedTime": 1631468533000,
  "balance": 1.4234001
}

Last updated

Was this helpful?