{"id":25395141,"url":"https://github.com/fadeev/swap","last_synced_at":"2025-04-10T13:20:44.771Z","repository":{"id":248167025,"uuid":"826858719","full_name":"fadeev/swap","owner":"fadeev","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-16T08:58:58.000Z","size":454,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T19:54:27.987Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/fadeev.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":"2024-07-10T14:16:36.000Z","updated_at":"2024-07-16T08:59:01.000Z","dependencies_parsed_at":"2025-02-15T19:54:15.606Z","dependency_job_id":"4a380bd2-56c0-4283-b514-550606462cc3","html_url":"https://github.com/fadeev/swap","commit_stats":null,"previous_names":["fadeev/swap-component"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadeev%2Fswap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadeev%2Fswap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadeev%2Fswap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadeev%2Fswap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fadeev","download_url":"https://codeload.github.com/fadeev/swap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248225659,"owners_count":21068078,"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":"2025-02-15T19:54:08.473Z","updated_at":"2025-04-10T13:20:44.728Z","avatar_url":"https://github.com/fadeev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Components\n\n```\nyarn add @fadeev/swap\n```\n\nShould be compatible with a RainbowKit enabled Next.js app, for example:\n\nhttps://github.com/fadeev/template\n\nAdding a swap component to a app-router Next.js app:\n\n```ts\n\"use client\";\n\nimport { ConnectButton } from \"@rainbow-me/rainbowkit\";\nimport {\n  Balances,\n  useEthersSigner,\n  useZetaChainClient,\n} from \"@fadeev/swap/dist\";\nimport { useAccount, useSwitchChain, useChainId, useWalletClient } from \"wagmi\";\n\n// universal swap app contract on ZetaChain\n// https://github.com/zeta-chain/example-contracts/tree/main/omnichain/swap\nconst contract = \"0xb459F14260D1dc6484CE56EB0826be317171e91F\";\n\nconst url = \"ZETACHAIN_EVM_ENDPOINT\";\n\nfunction Page() {\n  const { address } = useAccount();\n  const { switchChain } = useSwitchChain();\n  const chainId = useChainId();\n  const { data: walletClient } = useWalletClient({ chainId });\n  const signer = useEthersSigner({ walletClient });\n  const client = useZetaChainClient({ signer, url });\n\n  return (\n    \u003cdiv\u003e\n      \u003cConnectButton /\u003e\n      \u003cdiv className=\"flex justify-center\"\u003e\n        \u003cdiv className=\"w-[400px]\"\u003e\n          {client \u0026\u0026 (\n            \u003cSwap\n              contract={contract}\n              client={client}\n              switchChain={switchChain}\n              address={address}\n              chain={chainId}\n            /\u003e\n          )}\n        \u003c/div\u003e\n      \u003c/div\u003e\n    \u003c/div\u003e\n  );\n}\n\nexport default Page;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffadeev%2Fswap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffadeev%2Fswap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffadeev%2Fswap/lists"}