{"id":19303806,"url":"https://github.com/web3w/nftrade-js","last_synced_at":"2025-08-25T08:23:38.394Z","repository":{"id":111890438,"uuid":"513896531","full_name":"web3w/nftrade-js","owner":"web3w","description":"SDK for the Nftrader protocol and ZeroEx v3 protocol","archived":false,"fork":false,"pushed_at":"2022-07-15T09:35:59.000Z","size":97,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T03:50:08.981Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/web3w.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-14T12:40:27.000Z","updated_at":"2022-07-15T10:47:24.000Z","dependencies_parsed_at":"2023-07-06T22:16:31.480Z","dependency_job_id":null,"html_url":"https://github.com/web3w/nftrade-js","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/web3w/nftrade-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3w%2Fnftrade-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3w%2Fnftrade-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3w%2Fnftrade-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3w%2Fnftrade-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/web3w","download_url":"https://codeload.github.com/web3w/nftrade-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3w%2Fnftrade-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272031557,"owners_count":24861688,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T23:27:37.284Z","updated_at":"2025-08-25T08:23:38.366Z","avatar_url":"https://github.com/web3w.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nftrade-js\n\nSDK for the Nftrader protocol and ZeroEx v3 protocol\n\nhttps://nftrade.com/\n## Installation\n\nIn your project, run:\n\n```bash\nnpm i nftrade-js\n```\n\n## Getting Started\n\nTo get started, create a new NFTrade JS client, called an NFTrade, using your chainId and address:\n\n```JavaScript\nimport {NFTradeSDK} from 'nftrade-js'\n\nconst nftrade = new NFTradeSDK({\n    chainId: 4,\n    address: \"0x9F7A946d935c8Efc7A8329C0d894A69bA241345A\"\n})\n```\n\nIn the browser environment, only the chainId and address need to be configured，If you want to use the bash environment,\nconfigure the private key and RPC\n\nIn the browser environment, only the chainId and address need to be configured，If you want to use the bash environment,\nconfigure the private key and RPC\n\n```ts\ntype WalletInfo = {\n    chainId: number;\n    address: string;\n    privateKeys?: string[];\n    rpcUrl?: RpcInfo; // User-defined RPC information of the provider\n}\n``` \n### Making Offers\n\nOnce you have your asset, you can do this to make an offer on it:\n\n```JavaScript\n// Token ID and smart contract address for a non-fungible token:\nconst {tokenId, tokenAddress} = YOUR_ASSET\n\nconst offer = await nftrade.createBuyOrder({\n    asset: {\n        tokenId,\n        tokenAddress,\n        schemaName // WyvernSchemaName. If omitted, defaults to 'ERC721'. Other options include 'ERC20' and 'ERC1155'\n    },\n    // Value of the offer, in units of the payment token (or wrapped ETH if none is specified):\n    startAmount: 1.2,\n})\n```\n\n### Making Listings / Selling Items\n\nTo sell an asset, call `createSellOrder`. You can do a fixed-price listing, where `startAmount` is equal to `endAmount`,\nor a declining [Dutch auction](https://en.wikipedia.org/wiki/Dutch_auction), where `endAmount` is lower and the price\ndeclines until `expirationTime` is hit:\n\n```JavaScript\n// Expire this auction one day from now.\n// Note that we convert from the JavaScript timestamp (milliseconds):\nconst expirationTime = Math.round(Date.now() / 1000 + 60 * 60 * 24)\n\nconst listing = await nftrade.createSellOrder({\n    asset: {\n        tokenId,\n        tokenAddress,\n        schemaName,\n        \"collection\": {\n            royaltyFeeAddress,\n            royaltyFeePoints\n        }\n    },\n    startAmount: 3,\n    // If `endAmount` is specified, the order will decline in value to that amount until `expirationTime`. Otherwise, it's a fixed-price order:\n    endAmount: 0.1,\n    expirationTime\n})\n```\n\n##\n\nhttps://etherscan.io/address/0x13d8faf4a690f5ae52e2d2c52938d1167057b9af#code\n \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb3w%2Fnftrade-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweb3w%2Fnftrade-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb3w%2Fnftrade-js/lists"}