Raw Transactions (Advanced)

1. Create a Bid Pool

This operation creates a bid pool for a specific collection.

post

Inialize bid pool

Body
interestratestringoptionalExample: 1
graceperiodstringoptionalExample: 10
collectionstringoptionalExample: 1
loandurationstringoptionalExample: 10
secretstringoptionalExample: 10
rawbooleanoptionalExample: true
Responses
application/json; charset=utf-8
objectoptional
post
POST /createLoanPool HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 101

{
  "interestrate": "1",
  "graceperiod": "10",
  "collection": "1",
  "loanduration": "10",
  "secret": "10",
  "raw": true
}
{
  "msg": "successful"
}
StartCoroutine(SendRequest("http://api.streamnft.tech/initPool", "POST", new
{
  interestrate = "1",
  graceperiod = "10",
  collection = "1YeSmq9njjsyr4AYb1LDzdooUaVJThXdgH34Z6Gpaa3h",
  loanduration = "10",
  secret = "4uzLYRhX2dnsgUZVNNY82TNFCZbDFt5D9KLJuTFM8X2mc83ACEybEAi8aurEEZJTkSBwp8xg65KKP2ot1cj5Cz56", //Optional (providing secret send on-chain transaction)
  raw = false //Optional (return raw transaction)
}));

2. Get Bid Pool

This operation retrieves the bid pool.

get

Get all bid pool

Responses
application/json; charset=utf-8
object[]optional
get
GET /getLoanPool HTTP/1.1
Host: 
Accept: */*
[
  {
    "status": true,
    "data": [
      {
        "publicKey": "text",
        "account": {
          "initializerKey": "text",
          "collectionAddress": "text",
          "loanDurationInMinutes": "text",
          "gracePeriodInMinutes": "text",
          "apy": 1,
          "interestRateLender": 1,
          "interestRateProtocol": 1,
          "totalBidManager": "text",
          "lastBidLamports": "text"
        }
      }
    ]
  }
]
StartCoroutine(SendRequest("http://api.streamnft.tech/getBidPool", "GET", null));// Some code

3. Add Liquidity

This operation adds liquidity to a created Bid Pool.

post

Initialize a bid manager

Body
biddingoolstringoptionalExample: 1
bidamountstringoptionalExample: 100
totalbidsstringoptionalExample: 10
secretstringoptionalExample: abcd
rawbooleanoptionalExample: false
Responses
application/json; charset=utf-8
objectoptional
post
POST /addLoanOffer HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 83

{
  "biddingool": "1",
  "bidamount": "100",
  "totalbids": "10",
  "secret": "abcd",
  "raw": "false"
}
{
  "msg": "successful"
}
StartCoroutine(SendRequest("http://api.streamnft.tech/initManager", "POST", new
{
  biddingool = "1YeSmq9njjsyr4AYb1LDzdooUaVJThXdgH34Z6Gpaa3h",
  bidamount = "100", // amount in lamports,
  totalbids = "10", // total bids
  secret = "4uzLYRhX2dnsgUZVNNY82TNFCZbDFt5D9KLJuTFM8X2mc83ACEybEAi8aurEEZJTkSBwp8xg65KKP2ot1cj5Cz56", //Optional (providing secret send on-chain transaction)
  raw = false //Optional (return raw transaction)
}));

4. Get Bid Manager

This operation retrieves the bid manager.

get

get All bid managers

Responses
application/json; charset=utf-8
object[]optional
get
GET /getLoanOffers HTTP/1.1
Host: 
Accept: */*
[
  {
    "status": true,
    "data": [
      {
        "publicKey": "text",
        "account": {
          "bidderPubkey": "text",
          "biddingAmountInLamports": "text",
          "biddingNftFloorPrice": 1,
          "biddingPoolAddress": "text",
          "borrowersNftTokenAccountAddress": "text",
          "borrowersAddress": "text",
          "biddingManagerBump": 1,
          "totalBids": "text",
          "pendingLoans": "text"
        }
      }
    ]
  }
]
StartCoroutine(SendRequest("http://api.streamnft.tech/getBidManager", "GET", null));// Some code

5. 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));

6. Get Asset Manager

This operation retrieves the asset manager.

get

Retrieves the assets owned by a specific user.

Path parameters
mintstringoptionalExample: 7YeSmq9njjsyr4Axb1LDzdooUaVJThXdgHE4Z6Gpaa3h
Responses
application/json; charset=utf-8
object[]optional
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));

7. Take Loan

Collection holders can claim loan on their NFTs.

post

Loan on list bid manager

Body
biddingpoolstringoptionalExample: 1
biddingmanagerstringoptionalExample: 1
nftmintstringoptionalExample: 1
secretstringoptionalExample: abcd
rawbooleanoptionalExample: false
Responses
application/json; charset=utf-8
objectoptional
post
POST /processLoan HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 82

{
  "biddingpool": "1",
  "biddingmanager": "1",
  "nftmint": "1",
  "secret": "abcd",
  "raw": false
}
{
  "msg": "successful"
}
StartCoroutine(SendRequest("http://api.streamnft.tech/processLoan", "POST", new
{
  biddingpool = "1YeSmq9njjsyr4AYb1LDzdooUaVJThXdgH34Z6Gpaa3h",
  biddingmanager = "2YeSmq9njjsyr4AYb1LDzdooUaVJThXdgH34Z6Gpaa3h",
  secret = "4uzLYRhX2dnsgUZVNNY82TNFCZbDFt5D9KLJuTFM8X2mc83ACEybEAi8aurEEZJTkSBwp8xg65KKP2ot1cj5Cz56",
  raw = false 
}));

8. Repay Loan

Repay loan already taken by the user.

post

Repay an Loan

Body
biddingpoolaccountstringoptionalExample: 7YeSmq9njjsyr4Axb1LDzdooUaVJThXdgHE4Z6Gpaa3h
biddingmanagerstringoptionalExample: 1
nftmintstringoptionalExample: 1
secretstringoptionalExample: abcd
rawbooleanoptionalExample: false
Responses
application/json; charset=utf-8
objectoptional
post
POST /repayLoan HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 132

{
  "biddingpoolaccount": "7YeSmq9njjsyr4Axb1LDzdooUaVJThXdgHE4Z6Gpaa3h",
  "biddingmanager": "1",
  "nftmint": "1",
  "secret": "abcd",
  "raw": false
}
{
  "msg": "successful"
}
StartCoroutine(SendRequest("http://api.streamnft.tech/repayLoan", "POST", new
{
  biddingpoolaccount = "1YeSmq9njjsyr4AYb1LDzdooUaVJThXdgH34Z6Gpaa3h",
  biddingmanager = "2YeSmq9njjsyr4AYb1LDzdooUaVJThXdgH34Z6Gpaa3h",
  nftmint = "3YeSmq9njjsyr4AYb1LDzdooUaVJThXdgH34Z6Gpaa33",
  secret = "4uzLYRhX2dnsgUZVNNY82TNFCZbDFt5D9KLJuTFM8X2mc83ACEybEAi8aurEEZJTkSBwp8xg65KKP2ot1cj5Cz56", //Optional (providing secret send on-chain transaction)
  raw = false //Optional (return raw transaction)
}));

9. Remove Liquidity

Liquidity providers can remove provided liquidity.

post

Cancel a bidding manager

Body
biddingpoolstringoptionalExample: 7YeSmq9njjsyr4Axb1LDzdooUaVJThXdgHE4Z6Gpaa3h
biddingmanagerstringoptionalExample: 1
secretstringoptionalExample: abcd
rawbooleanoptionalExample: false
Responses
application/json; charset=utf-8
objectoptional
post
POST /removeLoanOffer HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 111

{
  "biddingpool": "7YeSmq9njjsyr4Axb1LDzdooUaVJThXdgHE4Z6Gpaa3h",
  "biddingmanager": "1",
  "secret": "abcd",
  "raw": false
}
{
  "msg": "successful"
}
StartCoroutine(SendRequest("http://api.streamnft.tech/cancelmanager", "POST", new
{
  biddingpool = "1YeSmq9njjsyr4AYb1LDzdooUaVJThXdgH34Z6Gpaa3h",
  biddingmanager = "2YeSmq9njjsyr4AYb1LDzdooUaVJThXdgH34Z6Gpaa3h",
    secret = "4uzLYRhX2dnsgUZVNNY82TNFCZbDFt5D9KLJuTFM8X2mc83ACEybEAi8aurEEZJTkSBwp8xg65KKP2ot1cj5Cz56", //Optional (providing secret send on-chain transaction)
  raw = false //Optional (return raw transaction)
}));

Last updated

Was this helpful?