{"id":13393078,"url":"https://github.com/ProjectOpenSea/seaport-js","last_synced_at":"2025-03-13T19:31:22.764Z","repository":{"id":37030124,"uuid":"469518968","full_name":"ProjectOpenSea/seaport-js","owner":"ProjectOpenSea","description":"A TypeScript library to interface with the Seaport marketplace.","archived":false,"fork":false,"pushed_at":"2025-03-03T13:27:52.000Z","size":5856,"stargazers_count":259,"open_issues_count":8,"forks_count":180,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-03-07T14:03:10.347Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ProjectOpenSea.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","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-03-13T23:15:26.000Z","updated_at":"2025-03-06T16:53:18.000Z","dependencies_parsed_at":"2024-01-15T02:36:48.222Z","dependency_job_id":"bd5c6ea1-792b-479a-bc5d-d5e01945d025","html_url":"https://github.com/ProjectOpenSea/seaport-js","commit_stats":{"total_commits":506,"total_committers":27,"mean_commits":18.74074074074074,"dds":0.3616600790513834,"last_synced_commit":"3becbf51bd9be966b970f9d7f5b4747e4364ea4a"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProjectOpenSea%2Fseaport-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProjectOpenSea%2Fseaport-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProjectOpenSea%2Fseaport-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProjectOpenSea%2Fseaport-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ProjectOpenSea","download_url":"https://codeload.github.com/ProjectOpenSea/seaport-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242461394,"owners_count":20131982,"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","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-07-30T17:00:42.455Z","updated_at":"2025-03-13T19:31:22.750Z","avatar_url":"https://github.com/ProjectOpenSea.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./img/banner.png\" /\u003e\n\u003c/p\u003e\n\n[![Version][version-badge]][version-link]\n[![npm][npm-badge]][npm-link]\n[![Test CI][ci-badge]][ci-link]\n[![Code Coverage][coverage-badge]][coverage-link]\n[![License][license-badge]][license-link]\n[![Docs][docs-badge]][docs-link]\n[![Discussions][discussions-badge]][discussions-link]\n\n# Seaport.js\n\n[Seaport][seaport-link] is a new marketplace protocol for safely and efficiently buying and selling NFTs. This is a TypeScript library intended to make interfacing with the contract reasonable and easy.\n\n- [Synopsis](#synopsis)\n- [Installation](#installation)\n- [Getting Started](#getting-started)\n  - [Use Cases](#use-cases)\n- [Contributing](#contributing)\n\n## Synopsis\n\nThis is a TypeScript library to help interface with Seaport. It includes various helper methods and constants that makes interfacing with Seaport easier. These include creating orders, fulfilling orders, doing the necessary balance and approval checks, and more. We recommend taking a look at the [Seaport][seaport-link] docs to get a better understanding of how the Seaport marketplace works.\n\n## Installation\n\nWe recommend using [nvm](https://github.com/nvm-sh/nvm) to manage Node.js versions. Execute `nvm use`, if you have `nvm` installed.\n\nThen, in your project, run:\n\n```console\nnpm install --save @opensea/seaport-js\n```\n\n## Getting Started\n\nInstantiate your instance of seaport using your ethers provider:\n\n### Examples\n\n#### Through a browser provider (i.e. Metamask)\n\n```js\nimport { Seaport } from \"@opensea/seaport-js\";\nimport { ethers } from \"ethers\";\n\nconst provider = new ethers.BrowserProvider(window.ethereum);\n\nconst seaport = new Seaport(provider);\n```\n\n#### Through a RPC Provider (i.e. Alchemy)\n\n```js\nimport { Seaport } from \"@opensea/seaport-js\";\nimport { ethers } from \"ethers\";\n\nconst provider = new ethers.JsonRpcProvider(\n  \"https://\u003cnetwork\u003e.alchemyapi.io/v2/YOUR-API-KEY\",\n);\n\nconst seaport = new Seaport(provider);\n```\n\n#### With custom signer\n\n```js\nimport { Seaport } from \"@opensea/seaport-js\";\nimport { ethers } from \"ethers\";\n\n// Provider must be provided to the signer when supplying a custom signer\nconst provider = new ethers.JsonRpcProvider(\n  \"https://\u003cnetwork\u003e.alchemyapi.io/v2/YOUR-API-KEY\",\n);\n\nconst signer = new ethers.Wallet(\"YOUR_PK\", provider);\n\nconst seaport = new Seaport(signer);\n```\n\nLook at the relevant definitions in `seaport.ts` in order to see the different functionality this library offers.\n\n### Use Cases\n\nMany of the main core flows return _use cases_. What this means is that if you were to create an order (a la `createOrder`), the library helps perform the necessary balance and approval checks based on the `offer` of the order being created. If the `offerer` requires approvals on one asset contract, the `actions` field of the use case would contain an approval action that the user should execute first in order for the trade to succeed in the future.\n\n### Examples\n\n#### Listing an ERC-721 for 10 ETH and fulfilling it\n\n```js\nconst offerer = \"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\";\nconst fulfiller = \"0x70997970c51812dc3a010c7d01b50e0d17dc79c8\";\nconst { executeAllActions } = await seaport.createOrder(\n  {\n    offer: [\n      {\n        itemType: ItemType.ERC721,\n        token: \"0x8a90cab2b38dba80c64b7734e58ee1db38b8992e\",\n        identifier: \"1\",\n      },\n    ],\n    consideration: [\n      {\n        amount: ethers.parseEther(\"10\").toString(),\n        recipient: offerer,\n      },\n    ],\n  },\n  offerer,\n);\n\nconst order = await executeAllActions();\n\nconst { executeAllActions: executeAllFulfillActions } =\n  await seaport.fulfillOrder({\n    order,\n    accountAddress: fulfiller,\n  });\n\nconst transaction = executeAllFulfillActions();\n```\n\n#### Making an offer for an ERC-721 for 10 WETH and fulfilling it\n\n```js\nconst offerer = \"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\";\nconst fulfiller = \"0x70997970c51812dc3a010c7d01b50e0d17dc79c8\";\nconst { executeAllActions } = await seaport.createOrder(\n  {\n    offer: [\n      {\n        amount: parseEther(\"10\").toString(),\n        // WETH\n        token: \"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\",\n      },\n    ],\n    consideration: [\n      {\n        itemType: ItemType.ERC721,\n        token: \"0x8a90cab2b38dba80c64b7734e58ee1db38b8992e\",\n        identifier: \"1\",\n        recipient: offerer,\n      },\n    ],\n  },\n  offerer,\n);\n\nconst order = await executeAllActions();\n\nconst { executeAllActions: executeAllFulfillActions } =\n  await seaport.fulfillOrder({\n    order,\n    accountAddress: fulfiller,\n  });\n\nconst transaction = executeAllFulfillActions();\n```\n\n## Contributing\n\nSee [the contributing guide](./.github/CONTRIBUTING.md) for detailed instructions on how to get started with this project.\n\n## License\n\n[MIT](LICENSE) Copyright 2022 Ozone Networks, Inc.\n\n[seaport-link]: https://github.com/ProjectOpenSea/seaport\n[version-badge]: https://img.shields.io/github/package-json/v/ProjectOpenSea/seaport-js\n[version-link]: https://github.com/ProjectOpenSea/seaport-js/releases\n[npm-badge]: https://img.shields.io/npm/v/@opensea/seaport-js?color=red\n[npm-link]: https://www.npmjs.com/package/@opensea/seaport-js\n[ci-badge]: https://github.com/ProjectOpenSea/seaport-js/actions/workflows/main.yaml/badge.svg\n[ci-link]: https://github.com/ProjectOpenSea/seaport-js/actions/workflows/main.yaml\n[coverage-badge]: https://codecov.io/gh/ProjectOpenSea/seaport-js/branch/main/graph/badge.svg\n[coverage-link]: https://codecov.io/gh/ProjectOpenSea/seaport-js\n[license-badge]: https://img.shields.io/github/license/ProjectOpenSea/seaport-js\n[license-link]: https://github.com/ProjectOpenSea/seaport-js/blob/main/LICENSE\n[docs-badge]: https://img.shields.io/badge/Seaport.js-documentation-informational\n[docs-link]: https://github.com/ProjectOpenSea/seaport-js/blob/main/README.md#getting-started\n[discussions-badge]: https://img.shields.io/badge/Seaport.js-discussions-blueviolet\n[discussions-link]: https://github.com/ProjectOpenSea/seaport-js/discussions\n","funding_links":[],"categories":["Other Relevant Repositories:","Software Development"],"sub_categories":["Architecture:","JavaScript"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FProjectOpenSea%2Fseaport-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FProjectOpenSea%2Fseaport-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FProjectOpenSea%2Fseaport-js/lists"}