{"id":13408916,"url":"https://github.com/project-serum/swap-ui","last_synced_at":"2025-04-05T15:07:31.283Z","repository":{"id":46305715,"uuid":"366925857","full_name":"project-serum/swap-ui","owner":"project-serum","description":"React Component for Swapping on the Serum DEX","archived":false,"fork":false,"pushed_at":"2021-11-23T16:45:49.000Z","size":2414,"stargazers_count":112,"open_issues_count":40,"forks_count":117,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-29T22:47:43.875Z","etag":null,"topics":["react","serum","solana"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/project-serum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-13T03:43:36.000Z","updated_at":"2024-10-21T04:20:08.000Z","dependencies_parsed_at":"2022-08-12T12:50:35.279Z","dependency_job_id":null,"html_url":"https://github.com/project-serum/swap-ui","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/project-serum%2Fswap-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/project-serum%2Fswap-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/project-serum%2Fswap-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/project-serum%2Fswap-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/project-serum","download_url":"https://codeload.github.com/project-serum/swap-ui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247353745,"owners_count":20925329,"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":["react","serum","solana"],"created_at":"2024-07-30T20:00:56.527Z","updated_at":"2025-04-05T15:07:31.256Z","avatar_url":"https://github.com/project-serum.png","language":"TypeScript","funding_links":[],"categories":["DEX Integration","👩‍🚀 Product Examples"],"sub_categories":["RPC servers","`Serum`"],"readme":"# `@project-serum/swap-ui`\n\n[![Build Status](https://travis-ci.com/project-serum/swap-ui.svg?branch=master)](https://travis-ci.com/project-serum/swap-ui)\n[![npm](https://img.shields.io/npm/v/@project-serum/swap-ui.svg)](https://www.npmjs.com/package/@project-serum/swap-ui)\n\nA reusable React component for swapping on the Serum DEX. The Solana program can be\nfound [here](https://github.com/project-serum/swap).\n\n## Usage\n\n#### Install\n\nFirst install the required peer dependencies into your React project.\n\n```\nyarn add @material-ui/core @material-ui/icons @material-ui/lab @project-serum/anchor @solana/spl-token-registry @solana/web3.js material-ui-popup-state react-async-hook\n```\n\nThen install the package.\n\n```\nyarn add @project-serum/swap-ui\n```\n\n#### Add the Swap Component\n\nTo embed the `Swap` component into your application,\none can minimally provide an [Anchor](https://github.com/project-serum/anchor)\n[Provider](https://project-serum.github.io/anchor/ts/classes/provider.html)\nand [TokenListContainer](https://github.com/solana-labs/token-list).\nFor example,\n\n ```javascript\n\u003cSwap provider={provider} tokenList={tokenList} /\u003e\n```\n\nAll of the complexity of communicating with the Serum DEX and managing\nits data is handled internally by the component.\n\n#### Referral Fees\n\nTo earn referral fees, one can also pass in a `referral` property,\nwhich is the `PublicKey` of the Solana wallet that *owns* the associated\ntoken accounts in which referral fees are paid (i.e., USDC and USDT).\n\n## Developing\n\n#### Install dependencies\n\n```\nyarn\n```\n\n#### Build\n\n```\nyarn build\n```\n\n## Run the example app\n\nFor local development and educational purposes, a minimal React app is provided\nin the `example/` subdirectory.\n\nTo run, change directories via `cd example/` and start the app.\n\n### Start the app\n\n```\nyarn start\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproject-serum%2Fswap-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fproject-serum%2Fswap-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproject-serum%2Fswap-ui/lists"}