From f8bceea67b33614848338d53a44948dee528c757 Mon Sep 17 00:00:00 2001 From: Favor Date: Wed, 2 Oct 2024 17:01:28 +0000 Subject: [PATCH] add tron example (#74) # Changelog - Example: EVM <> TRON (API): FIXES DX-103 - Guide: EVM <> TRON (API): FIXES DX-102 --- apps/directory/src/app/layout.tsx | 4 +- apps/directory/src/app/page.tsx | 2 +- apps/directory/src/components/filters.tsx | 10 +- apps/directory/src/components/footer.tsx | 4 +- apps/directory/src/components/header.tsx | 6 +- apps/directory/src/components/hero.tsx | 8 +- .../src/components/template-grid.tsx | 8 +- .../directory/src/components/ui/accordion.tsx | 4 +- apps/directory/src/components/ui/avatar.tsx | 2 +- apps/directory/src/components/ui/card.tsx | 4 +- apps/directory/src/components/ui/checkbox.tsx | 2 +- apps/directory/src/components/ui/dialog.tsx | 8 +- apps/directory/src/components/ui/drawer.tsx | 6 +- examples/gas-widget-nextjs/src/app/layout.tsx | 4 +- examples/gas-widget-nextjs/src/app/page.tsx | 2 +- .../src/components/Sidebar.tsx | 38 +- .../staking-sdk-nextjs/src/app/layout.tsx | 4 +- .../src/components/Sidebar.tsx | 38 +- .../src/components/Stake.tsx | 10 +- .../src/components/ui/avatar.tsx | 2 +- .../src/components/ui/dialog.tsx | 8 +- .../staking-widget-nextjs/src/app/layout.tsx | 2 +- .../staking-widget-nextjs/src/app/page.tsx | 6 +- .../src/components/Sidebar.tsx | 38 +- .../src/components/ui/avatar.tsx | 2 +- .../src/components/ui/dialog.tsx | 8 +- .../src/components/Swap.tsx | 104 +- .../src/components/ui/Footer.tsx | 2 +- .../src/components/ui/Header.tsx | 10 +- .../src/components/ui/Hero.tsx | 18 +- .../src/components/ui/NavLinks.tsx | 4 +- .../src/components/ui/popover.tsx | 2 +- examples/swaps-api-nextjs-solana/package.json | 2 +- .../src/components/Swap.tsx | 130 +- .../src/components/ui/Backdrop.tsx | 4 +- .../src/components/ui/ChainTokenItem.tsx | 4 +- .../src/components/ui/Header.tsx | 12 +- .../src/components/ui/Hero.tsx | 18 +- .../src/components/ui/NavLinks.tsx | 4 +- .../src/components/ui/SelectChainPanel.tsx | 4 +- .../src/components/ui/SelectTokenPanel.tsx | 6 +- .../components/ui/TransferHistoryPanel.tsx | 14 +- .../src/components/ui/popover.tsx | 2 +- .../src/interfaces/chain.interface.ts | 2 +- .../src/interfaces/status.interface.ts | 9 +- examples/swaps-api-nextjs-tron/.eslintrc.js | 8 + examples/swaps-api-nextjs-tron/.gitignore | 32 + examples/swaps-api-nextjs-tron/README.md | 644 +++++++ .../swaps-api-nextjs-tron/components.json | 17 + examples/swaps-api-nextjs-tron/next-env.d.ts | 5 + .../swaps-api-nextjs-tron/next.config.mjs | 6 + examples/swaps-api-nextjs-tron/package.json | 61 + .../swaps-api-nextjs-tron/postcss.config.js | 6 + .../swaps-api-nextjs-tron/public/favicon.ico | Bin 0 -> 15406 bytes .../public/fonts/Inter-italic.var.woff2 | Bin 0 -> 245036 bytes .../public/fonts/Inter-roman.var.woff2 | Bin 0 -> 227180 bytes .../swaps-api-nextjs-tron/src/app/layout.tsx | 21 + .../swaps-api-nextjs-tron/src/app/page.tsx | 12 + .../src/components/Swap.tsx | 882 +++++++++ .../src/components/ThirdwebProvider.tsx | 3 + .../src/components/ui/Backdrop.tsx | 7 + .../src/components/ui/Button.tsx | 56 + .../src/components/ui/ChainTokenItem.tsx | 17 + .../src/components/ui/Container.tsx | 17 + .../src/components/ui/Header.tsx | 159 ++ .../src/components/ui/Hero.tsx | 24 + .../src/components/ui/NavLinks.tsx | 40 + .../src/components/ui/SelectChainPanel.tsx | 48 + .../src/components/ui/SelectTokenPanel.tsx | 77 + .../components/ui/TransferHistoryPanel.tsx | 112 ++ .../src/components/ui/input.tsx | 25 + .../src/components/ui/label.tsx | 26 + .../src/components/ui/popover.tsx | 31 + .../src/components/ui/toast.tsx | 130 ++ .../src/components/ui/toaster.tsx | 35 + .../src/components/ui/use-toast.ts | 191 ++ .../src/images/logos/cnn.svg | 11 + .../src/images/logos/forbes.svg | 5 + .../src/images/logos/sols.png | Bin 0 -> 707610 bytes .../src/images/logos/techcrunch.svg | 5 + .../src/images/logos/wired.svg | 5 + .../src/interfaces/allowance.interface.ts | 15 + .../src/interfaces/approval.interface.ts | 58 + .../src/interfaces/chain.interface.ts | 24 + .../src/interfaces/history.interface.ts | 61 + .../src/interfaces/quote.interface.ts | 104 ++ .../src/interfaces/send.interface.ts | 77 + .../src/interfaces/status.interface.ts | 41 + .../src/interfaces/swing-service.interface.ts | 48 + .../src/interfaces/token.interface.ts | 11 + examples/swaps-api-nextjs-tron/src/lib.ts | 6 + .../src/services/requests.ts | 205 +++ .../src/styles/globals.css | 16 + .../src/types/global.d.ts | 46 + .../src/types/transfer.types.ts | 29 + .../src/utils/ethToWei.ts | 19 + .../swaps-api-nextjs-tron/styles/globals.css | 4 + .../swaps-api-nextjs-tron/tailwind.config.js | 127 ++ examples/swaps-api-nextjs-tron/tsconfig.json | 15 + examples/swaps-api-nextjs-tron/turbo.json | 11 + .../src/app/layout.tsx | 2 +- .../src/components/Swap.tsx | 118 +- .../src/components/ui/AppScreen.tsx | 4 +- .../src/components/ui/Backdrop.tsx | 4 +- .../src/components/ui/Chain.tsx | 6 +- .../src/components/ui/Footer.tsx | 30 +- .../src/components/ui/Header.tsx | 16 +- .../src/components/ui/Hero.tsx | 4 +- .../src/components/ui/Modal.tsx | 8 +- .../src/components/ui/NavLinks.tsx | 4 +- .../src/components/ui/Route.tsx | 28 +- .../src/components/ui/SelectChain.tsx | 10 +- .../src/components/ui/SelectRoute.tsx | 2 +- .../src/components/ui/Token.tsx | 8 +- .../src/components/ui/toast.tsx | 4 +- .../src/components/Swap.tsx | 44 +- .../src/components/ui/Footer.tsx | 26 +- .../src/components/ui/Header.tsx | 8 +- .../src/components/ui/Hero.tsx | 14 +- .../src/components/ui/NavLinks.tsx | 4 +- .../src/components/ui/StatusSheet.tsx | 14 +- .../src/components/ui/select.tsx | 4 +- .../swaps-sdk-nextjs/src/components/Swap.tsx | 14 +- .../src/components/ui/AppScreen.tsx | 4 +- .../src/components/ui/CallToAction.tsx | 8 +- .../src/components/ui/Footer.tsx | 14 +- .../src/components/ui/Header.tsx | 10 +- .../src/components/ui/Hero.tsx | 10 +- .../src/components/ui/NavLinks.tsx | 4 +- .../src/components/ui/PhoneFrame.tsx | 4 +- .../src/components/ui/PrimaryFeatures.tsx | 36 +- .../src/components/ui/Reviews.tsx | 12 +- .../src/components/ui/SecondaryFeatures.tsx | 8 +- .../swaps-widget-nextjs/src/app/layout.tsx | 4 +- examples/swaps-widget-nextjs/src/app/page.tsx | 2 +- .../src/components/Sidebar.tsx | 38 +- .../withdraw-widget-nextjs/src/app/layout.tsx | 4 +- .../withdraw-widget-nextjs/src/app/page.tsx | 2 +- .../src/components/Sidebar.tsx | 38 +- package.json | 1 + prettier.config.mjs | 8 + yarn.lock | 1620 ++++++++++++++++- 142 files changed, 5789 insertions(+), 630 deletions(-) create mode 100644 examples/swaps-api-nextjs-tron/.eslintrc.js create mode 100644 examples/swaps-api-nextjs-tron/.gitignore create mode 100644 examples/swaps-api-nextjs-tron/README.md create mode 100644 examples/swaps-api-nextjs-tron/components.json create mode 100644 examples/swaps-api-nextjs-tron/next-env.d.ts create mode 100644 examples/swaps-api-nextjs-tron/next.config.mjs create mode 100644 examples/swaps-api-nextjs-tron/package.json create mode 100644 examples/swaps-api-nextjs-tron/postcss.config.js create mode 100644 examples/swaps-api-nextjs-tron/public/favicon.ico create mode 100644 examples/swaps-api-nextjs-tron/public/fonts/Inter-italic.var.woff2 create mode 100644 examples/swaps-api-nextjs-tron/public/fonts/Inter-roman.var.woff2 create mode 100644 examples/swaps-api-nextjs-tron/src/app/layout.tsx create mode 100644 examples/swaps-api-nextjs-tron/src/app/page.tsx create mode 100644 examples/swaps-api-nextjs-tron/src/components/Swap.tsx create mode 100644 examples/swaps-api-nextjs-tron/src/components/ThirdwebProvider.tsx create mode 100644 examples/swaps-api-nextjs-tron/src/components/ui/Backdrop.tsx create mode 100644 examples/swaps-api-nextjs-tron/src/components/ui/Button.tsx create mode 100644 examples/swaps-api-nextjs-tron/src/components/ui/ChainTokenItem.tsx create mode 100644 examples/swaps-api-nextjs-tron/src/components/ui/Container.tsx create mode 100644 examples/swaps-api-nextjs-tron/src/components/ui/Header.tsx create mode 100644 examples/swaps-api-nextjs-tron/src/components/ui/Hero.tsx create mode 100644 examples/swaps-api-nextjs-tron/src/components/ui/NavLinks.tsx create mode 100644 examples/swaps-api-nextjs-tron/src/components/ui/SelectChainPanel.tsx create mode 100644 examples/swaps-api-nextjs-tron/src/components/ui/SelectTokenPanel.tsx create mode 100644 examples/swaps-api-nextjs-tron/src/components/ui/TransferHistoryPanel.tsx create mode 100644 examples/swaps-api-nextjs-tron/src/components/ui/input.tsx create mode 100644 examples/swaps-api-nextjs-tron/src/components/ui/label.tsx create mode 100644 examples/swaps-api-nextjs-tron/src/components/ui/popover.tsx create mode 100644 examples/swaps-api-nextjs-tron/src/components/ui/toast.tsx create mode 100644 examples/swaps-api-nextjs-tron/src/components/ui/toaster.tsx create mode 100644 examples/swaps-api-nextjs-tron/src/components/ui/use-toast.ts create mode 100644 examples/swaps-api-nextjs-tron/src/images/logos/cnn.svg create mode 100644 examples/swaps-api-nextjs-tron/src/images/logos/forbes.svg create mode 100644 examples/swaps-api-nextjs-tron/src/images/logos/sols.png create mode 100644 examples/swaps-api-nextjs-tron/src/images/logos/techcrunch.svg create mode 100644 examples/swaps-api-nextjs-tron/src/images/logos/wired.svg create mode 100644 examples/swaps-api-nextjs-tron/src/interfaces/allowance.interface.ts create mode 100644 examples/swaps-api-nextjs-tron/src/interfaces/approval.interface.ts create mode 100644 examples/swaps-api-nextjs-tron/src/interfaces/chain.interface.ts create mode 100644 examples/swaps-api-nextjs-tron/src/interfaces/history.interface.ts create mode 100644 examples/swaps-api-nextjs-tron/src/interfaces/quote.interface.ts create mode 100644 examples/swaps-api-nextjs-tron/src/interfaces/send.interface.ts create mode 100644 examples/swaps-api-nextjs-tron/src/interfaces/status.interface.ts create mode 100644 examples/swaps-api-nextjs-tron/src/interfaces/swing-service.interface.ts create mode 100644 examples/swaps-api-nextjs-tron/src/interfaces/token.interface.ts create mode 100644 examples/swaps-api-nextjs-tron/src/lib.ts create mode 100644 examples/swaps-api-nextjs-tron/src/services/requests.ts create mode 100644 examples/swaps-api-nextjs-tron/src/styles/globals.css create mode 100644 examples/swaps-api-nextjs-tron/src/types/global.d.ts create mode 100644 examples/swaps-api-nextjs-tron/src/types/transfer.types.ts create mode 100644 examples/swaps-api-nextjs-tron/src/utils/ethToWei.ts create mode 100644 examples/swaps-api-nextjs-tron/styles/globals.css create mode 100644 examples/swaps-api-nextjs-tron/tailwind.config.js create mode 100644 examples/swaps-api-nextjs-tron/tsconfig.json create mode 100644 examples/swaps-api-nextjs-tron/turbo.json create mode 100644 prettier.config.mjs diff --git a/apps/directory/src/app/layout.tsx b/apps/directory/src/app/layout.tsx index 3617563..a6c303d 100644 --- a/apps/directory/src/app/layout.tsx +++ b/apps/directory/src/app/layout.tsx @@ -12,12 +12,12 @@ export default function Layout({ children }: { children: React.ReactNode }) {
-
{children}
+
{children}