1.0.8 • Published 3 years ago

lux-nft-sdk v1.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

refinable-sdk

refinable-sdk is a NPM package that can be added to the project to work with Refinable contracts.

Get started

To get started, create an instance of the refinable sdk.

const refinable = Refinable.create(wallet, address, "API_KEY");

Where there are some arguments |Argument|Description|Values| |---|---|---| |wallet | The Provider that is allowed to call functions. | Ethers Signer | |address|The Wallet address|string| |Api Key|The API key, obtained from Refinable|string|

For creating the wallet you can rely on the added helper factories

const wallet = createWallet(PRIVATE_KEY, REFINABLE_NETWORK.BSC);
const address = await wallet.getAddress();

where REFINABLE_NETWORK can be any value of the enum and represents the supported network

Methods

Listing for sale

await refinable.putForSale({
  type: TOKEN_TYPE.ERC721,
  contractAddress: erc721TokenAddress,
  tokenId: tokenId,
  amount: amount,
  supply: 1,
  currency: REFINABLE_CURRENCY.BNB,
});
ArgumentDescriptionValues
TypeWhether it's an 721 or 1155 standard NFTTOKEN_TYPE.ERC721, TOKEN_TYPE.ERC1155
Contract AddressWhich Contract address the item is located underthe type is a contract address string, You can use erc721TokenAddress or erc1155TokenAddress. ex. import { erc721TokenAddress } from "@refinableco/refinable-sdk"
tokenIdThe token ID of the NFTthe type is a number
amountThe price that you want to list the NFT for sale fornumber
supplyFor ERC721 this is 1, for ERC1155 NFTs this is the amount of items you want to put for sale of that nftnumber
currencyThe currency you want to useUSDT, BNB

Cancelling sale

Want to unlist an item from sale?

await refinable.cancelSale({
  type: TOKEN_TYPE.ERC721,
  contractAddress: erc721TokenAddress,
  tokenId: tokenId,
});

Supported Networks

Refinable currently supports the following networks:

  • Binance Smart Chain (BSC)
  • Polygon

Requesting an API Key

In order to obtain an API key, please email us at sdk@refinable.com and use the following template:

Project NameThe name of your project
User addressThe public wallet address that the API key will be attached to, This user should have connected to the Refinable site at least once
Est. Calls per monthThe amount of estimated calls per month
DescriptionTell us a bit more about your project, why do you have to use an SDK?

Jobs

Interested in joining us? We're always on the lookout for good talent. Feel free to send us your most up-to-date resume at careers@refinable.com