1.1.3 • Published 1 year ago

streamnfttechtest v1.1.3

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

STREAM NFT

This SDK provides an extension to integrate the STREAM NFT (https://www.streamnft.tech) smart contract to your application. STREAM NFT is an cross-chain scalability layer for NFT liquidity. This can be used to unlock features like rental, loan, buy now pay later for your utilitarian NFT.

import {
initManager, initPool, initRent, processLoan, processRent, repayLoan, expireLoan, cancelManager, cancelPool, cancelRent, getAssetManager, getBidManager, getBidManagerByUser, getBidPool, 
initRent, processRent, expireRent, cancelRent
} from "testsdkforstreammoney";

Documentation on functions:

Initialize

Initializes bid manager:

InitManagerArgs {
  biddingAmountInLamports: BN,
  totalBids: BN,
  biddingPoolPda: PublicKey,
}
 initManager(
  biddingAmountInLamports: BN,
  totalBids: BN,
  biddingPoolPda: PublicKey,
)

Initializes bidding pool:

InitPoolArgs {
  loanDurationInMinutes: number
  gracePeriodInMinutes: number
  interestRateLender: number
  interestRateProtocol: number
  collection: PublicKey
}
 initPool(
  loanDurationInMinutes: number,
  gracePeriodInMinutes: number,
  interestRateLender: number,
  interestRateProtocol: number,
  collection: PublicKey,
) 

Initializes rent:

InitRentArgs {
  rate: BN
  offerDurationInMinutes: BN
  fixedDurationInMinutes: BN
  rentIsFixed: boolean
  ownerRevenue: BN
}
 initRent(
  rate: BN,
  offerDurationInMinutes: BN,
  fixedDurationInMinutes: BN,
  rentIsFixed: boolean,
  ownerRevenue: BN,
  mint: PublicKey,
  ) 

Process

Processes loan:

ProcessLoanAccounts {
  biddingManager: PublicKey,
  nftMint: PublicKey,
  biddingPool: PublicKey,
  protocolTreasury: PublicKey,
}
processLoan(
  biddingManager: PublicKey,
  nftMint: PublicKey,
  biddingPool: PublicKey,
  protocolTreasury: PublicKey,
)

Processes rent:

ProcessRentArgs {
  amount: BN
  timeInMinutes: BN
  nftMint: PublicKey
}
processRent(
  amount: BN,
  timeInMinutes: BN,
  nftMint: PublicKey,
) 

Repays loan:

RepayLoanAccounts {
  biddingManager: PublicKey
  nftMint: PublicKey
  biddingPoolAccount: PublicKey
}
repayLoan(
  biddingManager: PublicKey,
  nftMint: PublicKey,
  biddingPoolAccount: PublicKey,
) 

Cancel

Cancels the bid manager created:

CancelManagerAccounts {
  biddingManager: PublicKey
  biddingPool: PublicKey
}
cancelManager(
  biddingManager: PublicKey,
  biddingPool: PublicKey,
)

Cancels the bid pool created:

CancelPoolAccounts {
  biddingPool: PublicKey
}
cancelPool(
  biddingPool: PublicKey,
)

Cancels the rent:

CancelRentArgs {
  nftMint: PublicKey
}
cancelRent(
  nftMint: PublicKey,
)

Expire

Expire loan:

ExpireLoanArgs {
  biddingManager: PublicKey
  nftMint: PublicKey
  biddingPoolAccount: PublicKey
}
expireLoan(
  biddingManager: PublicKey,
  nftMint: PublicKey,
  biddingPoolAccount: PublicKey,
)

Expire Rent:

ExpireRentArgs {
  nftMint: PublicKey
}
expireRent(
  nftMint: PublicKey,
)

Get

Get the list of the asset managers

getAssetManager()

Get the list of the bid managers

getBidManager()

Get the list of the bid managers by user

interface BidManagerByUserArgs {
  address: PublicKey,
}
  
getBidManagerByUser(
  address: PublicKey,
)

Get the list of the bid pool

getBidPool()

Stream NFT currently supports Solana, also expanding to other chains as well soon.. stay tuned :)