Raw Transactions (Advanced)
Endpoint:
Main Net Base URL: https://api.danlabs.xyz
Test Net Base URL: https://api-staging.danlabs.xyz
1. Create a Bid Pool
This operation creates a bid pool for a specific collection.
Inialize bid pool
1
10
1
10
10
true
Successful response
Server error
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 all bid pool
Successful response
Server error
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.
Initialize a bid manager
1
100
10
abcd
false
Successful response
Server error
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 All bid managers
Successful response
Server error
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.
Retrieves the assets owned by a specific user.
7YeSmq9njjsyr4Axb1LDzdooUaVJThXdgHE4Z6Gpaa3h
Successful response
Server error
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.
Loan on list bid manager
1
1
1
abcd
false
Successful response
Server error
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.
Repay an Loan
7YeSmq9njjsyr4Axb1LDzdooUaVJThXdgHE4Z6Gpaa3h
1
1
abcd
false
Successful response
Server error
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.
Cancel a bidding manager
7YeSmq9njjsyr4Axb1LDzdooUaVJThXdgHE4Z6Gpaa3h
1
abcd
false
Successful response
Server error
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