Raw Transactions (Advanced)

1. Lend NFT for rental

This operation will list the NFT on DApp for rentals.

post

List NFT for rent

Body
nftmintstringOptionalExample: 1
ratestringOptionalExample: 10
offerdurationstringOptionalExample: 1
isfixedbooleanOptionalExample: true
fixedminutesstringOptionalExample: 10
ownersharestringOptionalExample: 10
whiteliststringOptionalExample: 0x1234abcd5678efgh9012ijkl3456mnop
secretstringOptionalExample: abcd
rawbooleanOptionalExample: true
Responses
200

Successful response

application/json; charset=utf-8
post
POST /lendToken HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 176

{
  "nftmint": "1",
  "rate": "10",
  "offerduration": "1",
  "isfixed": true,
  "fixedminutes": "10",
  "ownershare": "10",
  "whitelist": "0x1234abcd5678efgh9012ijkl3456mnop",
  "secret": "abcd",
  "raw": true
}
{
  "msg": "successful"
}
StartCoroutine(SendRequest("http://api.streamnft.tech/lendToken", "POST", new
{
  nftmint = "1YeSmq9njjsyr4AYb1LDzdooUaVJThXdgH34Z6Gpaa3h", 
  rate = "10", // rate per minute
  offerduration = "1",
  isfixed = true,
  fixedminutes = "10",
  ownershare = "10",
  whitelist = "1YeSmq9njjsyr4AYb1LDzdooUaVJThXdgH34Z6Gpaa3h", // whitelist for private rental (undefined for public)
  secret = "4uzLYRhX2dnsgUZVNNY82TNFCZbDFt5D9KLJuTFM8X2mc83ACEybEAi8aurEEZJTkSBwp8xg65KKP2ot1cj5Cz56", //Optional (providing secret send on-chain transaction)
  raw = false //Optional (return raw transaction)
}));

2. Take Rent for any NFT

User can take any NFT on rent for provided time duration.

post

Rent a listed nft

Body
durationminutesstringOptionalExample: 60
nftmintstringOptionalExample: 1
secretstringOptionalExample: abcd
rawbooleanOptionalExample: false
Responses
200

Successful response

application/json; charset=utf-8
post
POST /processRent HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 68

{
  "durationminutes": "60",
  "nftmint": "1",
  "secret": "abcd",
  "raw": "false"
}
{
  "msg": "successful"
}
StartCoroutine(SendRequest("http://api.streamnft.tech/processRent", "POST", new
{
  durationminutes = "60",
  nftmint = "1YeSmq9njjsyr4AYb1LDzdooUaVJThXdgH34Z6Gpaa3h",
  secret = "4uzLYRhX2dnsgUZVNNY82TNFCZbDFt5D9KLJuTFM8X2mc83ACEybEAi8aurEEZJTkSBwp8xg65KKP2ot1cj5Cz56", //Optional (providing secret send on-chain transaction)
  raw = false //Optional (return raw transaction)
}));

3. Cancel Rent

Cancel the rental offer and retrieve back the NFT.

post

Cancel a listed rent nft

Body
nftmintstringOptionalExample: 1
secretstringOptionalExample: abcd
rawbooleanOptionalExample: false
Responses
200

Successful response

application/json; charset=utf-8
post
POST /removeLendToken HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 43

{
  "nftmint": "1",
  "secret": "abcd",
  "raw": false
}
{
  "msg": "successful"
}
StartCoroutine(SendRequest("http://api.streamnft.tech/cancelRent", "POST", new
{
  nftmint = "1YeSmq9njjsyr4AYb1LDzdooUaVJThXdgH34Z6Gpaa3h",
  secret = "4uzLYRhX2dnsgUZVNNY82TNFCZbDFt5D9KLJuTFM8X2mc83ACEybEAi8aurEEZJTkSBwp8xg65KKP2ot2cj5Cz56", //Optional (providing secret send on-chain transaction)
  raw = false //Optional (return raw transaction)
}));

4. Get User Assets

This operation retrieves the assets of a specific user.

string userAddress = "userAddressHere"; // Replace with the actual user address
StartCoroutine(SendRequest($"http://api.streamnft.tech/getUserAssets/{userAddress}", "GET", null));// Some code

5. Get Asset Manager

This operation retrieves the asset manager.

get

Retrieves the assets owned by a specific user.

Path parameters
mintstringOptionalExample: 7YeSmq9njjsyr4Axb1LDzdooUaVJThXdgHE4Z6Gpaa3h
Responses
200

Successful response

application/json; charset=utf-8
get
GET /getAssetInfo/{mint} HTTP/1.1
Host: 
Accept: */*
[
  {
    "publicKey": "text",
    "account": {
      "initializerKey": "text",
      "initializerTokenAccount": "text",
      "mint": "text",
      "holder": "text",
      "collection": "text",
      "rate": "text",
      "offerExpiry": "text",
      "rentExpiry": "text",
      "state": {
        "stale": {}
      },
      "minDuration": "text",
      "fixedDuration": "text",
      "ownerRevenue": "text",
      "holderTokenAccount": "text",
      "whitelist": "text",
      "loanExpiry": "text",
      "bidManagerKey": "text",
      "rentIsFixed": true,
      "lockedInVault": true,
      "vaultAccount": "text"
    }
  }
]

string mint = "NFTmint"; // Replace with the NFT mint
StartCoroutine(SendRequest($"http://api.streamnft.tech/getAssetInfo/{mint}", "GET", null));

Last updated