UploadContractFile
Uploads a contract file to the Shamwari Network as a blockchain transaction.
Request
POST /nxt?requestType=uploadContractFile
All endpoints use port 22024 by default.
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
name | string | File name | Yes |
description | string | File description | Optional |
keywords | string | Search keywords | Optional |
type | string | MIME content type | Optional |
group | string | File grouping/category | Optional |
isText | boolean | File is text | No |
filename | string | Original filename | Optional |
data | string | File data (base64 or hex) | Yes |
file | file | File upload | Yes |
secretPhrase | string | Uploader's secret passphrase | Yes |
Response
{
"transaction": "1234567890123456789",
"fullHash": "abc123def456...",
"errorCode": 0,
"errorDescription": ""
}
Example
curl -X POST "http://localhost:22024/nxt?requestType=uploadContractFile" \
-d "name=mycontract" \
-d "description=Smart contract" \
-d "type=text/plain" \
-d "file=@contract.wasm" \
-d "secretPhrase=your_secret_passphrase"