-
Notifications
You must be signed in to change notification settings - Fork 3
chore: switched theme to mint #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,167 +1,48 @@ | ||||||||||||||||||||||
| --- | ||||||||||||||||||||||
| hidden: true | ||||||||||||||||||||||
| mode: "wide" | ||||||||||||||||||||||
| mode: "custom" | ||||||||||||||||||||||
| --- | ||||||||||||||||||||||
|
Comment on lines
1
to
3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add required This page currently has only Suggested fix ---
mode: "custom"
+title: "NEAR Intents"
+description: "Learn how you can integrate NEAR Intents across API, SDK, and contract workflows."
---As per coding guidelines, "Every MDX file must include frontmatter with 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| <div class="landing-page"> | ||||||||||||||||||||||
| <div class="my-auto w-full"> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| <h1 class="text-center mt-0 mb-1"> NEAR Intents </h1> | ||||||||||||||||||||||
| <div class="mb-8 text-lg text-center prose prose-gray dark:prose-invert"><p>Welcome to the NEAR Intents Docs</p></div> | ||||||||||||||||||||||
| <h1 className="text-center text-4xl font-semibold tracking-tight text-gray-800 dark:text-white"> | ||||||||||||||||||||||
| NEAR Intents | ||||||||||||||||||||||
| </h1> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| <div class="landing pt-8 max-w-6xl mx-auto space-y-8"> | ||||||||||||||||||||||
| <Columns cols={2}> | ||||||||||||||||||||||
| <div class="mr-4"> | ||||||||||||||||||||||
| <h2 class="mb-2"> 1-Click Swap API </h2> | ||||||||||||||||||||||
| <p >Request quotes, execute cross-chain swaps, and track their status. </p> | ||||||||||||||||||||||
| <p><a href="/integration/distribution-channels/1click-api/quickstart"> Quickstart -> </a></p> | ||||||||||||||||||||||
| <p><a href="/integration/distribution-channels/1click-api/about-1click-api"> Learn More -> </a></p> | ||||||||||||||||||||||
| </div> | ||||||||||||||||||||||
| <CodeGroup> | ||||||||||||||||||||||
| ```bash cURL | ||||||||||||||||||||||
| # Query supported tokens | ||||||||||||||||||||||
| curl https://1click.chaindefuser.com/v0/tokens | ||||||||||||||||||||||
| <div class="text-lg text-center"><p>Welcome to the NEAR Intents Docs</p></div> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Request a quote | ||||||||||||||||||||||
| curl -X POST https://1click.chaindefuser.com/v0/quote \ | ||||||||||||||||||||||
| -H "Content-Type: application/json" \ | ||||||||||||||||||||||
| -H "Authorization: Bearer YOUR_JWT_TOKEN" \ | ||||||||||||||||||||||
| -d '{ | ||||||||||||||||||||||
| "swapType": "EXACT_INPUT", | ||||||||||||||||||||||
| "originAsset": "nep141:wrap.near", | ||||||||||||||||||||||
| "depositType": "ORIGIN_CHAIN", | ||||||||||||||||||||||
| "destinationAsset": "nep141:arb-0x912ce59144191c1204e64559fe8253a0e49e6548.omft.near", | ||||||||||||||||||||||
| "amount": "100000000000000000000000", | ||||||||||||||||||||||
| ... | ||||||||||||||||||||||
| }' | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
| <div class="landing pt-5 max-w-6xl mx-auto space-y-2"> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ```typescript TypeScript | ||||||||||||||||||||||
| // Query supported tokens | ||||||||||||||||||||||
| const tokensResponse = await fetch('https://1click.chaindefuser.com/v0/tokens'); | ||||||||||||||||||||||
| const tokens = await tokensResponse.json(); | ||||||||||||||||||||||
| <Columns cols={4}> | ||||||||||||||||||||||
| <Card title="API Quickstart" icon="rocket" href="/integration/distribution-channels/1click-api/quickstart" cta="Integrate" arrow> | ||||||||||||||||||||||
| Execute your first cross-chain swap in minutes. | ||||||||||||||||||||||
| </Card> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| // Request a quote | ||||||||||||||||||||||
| const quote = await fetch('https://1click.chaindefuser.com/v0/quote', { | ||||||||||||||||||||||
| method: 'POST', | ||||||||||||||||||||||
| headers: { | ||||||||||||||||||||||
| 'Content-Type': 'application/json', | ||||||||||||||||||||||
| 'Authorization': 'Bearer YOUR_JWT_TOKEN' | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| body: JSON.stringify({ | ||||||||||||||||||||||
| swapType: 'EXACT_INPUT', | ||||||||||||||||||||||
| originAsset: 'nep141:wrap.near', | ||||||||||||||||||||||
| depositType: 'ORIGIN_CHAIN', | ||||||||||||||||||||||
| destinationAsset: 'nep141:arb-0x912ce59144191c1204e64559fe8253a0e49e6548.omft.near', | ||||||||||||||||||||||
| amount: '100000000000000000000000', | ||||||||||||||||||||||
| // ... | ||||||||||||||||||||||
| }) | ||||||||||||||||||||||
| }); | ||||||||||||||||||||||
| const result = await quote.json(); | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
| <Card title="React Widget" icon="palette" href="/integration/devkit/react-widget" cta="Integrate" arrow> | ||||||||||||||||||||||
| Embed a customizable swap UI with a ready-to-use React component. | ||||||||||||||||||||||
| </Card> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ```python Python | ||||||||||||||||||||||
| import requests | ||||||||||||||||||||||
| <Card title="SDK Libraries" icon="window-restore" href="/integration/devkit/sdk" cta="Explore" arrow> | ||||||||||||||||||||||
| Build with TypeScript, Go, and Rust SDKs for typed API integration. | ||||||||||||||||||||||
| </Card> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Query supported tokens | ||||||||||||||||||||||
| tokens_response = requests.get('https://1click.chaindefuser.com/v0/tokens') | ||||||||||||||||||||||
| tokens = tokens_response.json() | ||||||||||||||||||||||
| <Card title="What are intents?" icon="lightbulb" href="/getting-started/what-are-intents" cta="Read docs" arrow> | ||||||||||||||||||||||
| Learn how the protocol works and core concepts. | ||||||||||||||||||||||
| </Card> | ||||||||||||||||||||||
| </Columns> | ||||||||||||||||||||||
| <Columns cols={2}> | ||||||||||||||||||||||
| <Card title="Market Makers" icon="users" href="/integration/market-makers/introduction" cta="Learn how" arrow> | ||||||||||||||||||||||
| Provide liquidity by fulfilling cross-chain swap intents. | ||||||||||||||||||||||
| </Card> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Request a quote | ||||||||||||||||||||||
| quote = requests.post( | ||||||||||||||||||||||
| 'https://1click.chaindefuser.com/v0/quote', | ||||||||||||||||||||||
| headers={ | ||||||||||||||||||||||
| 'Content-Type': 'application/json', | ||||||||||||||||||||||
| 'Authorization': 'Bearer YOUR_JWT_TOKEN' | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| json={ | ||||||||||||||||||||||
| 'swapType': 'EXACT_INPUT', | ||||||||||||||||||||||
| 'originAsset': 'nep141:wrap.near', | ||||||||||||||||||||||
| 'depositType': 'ORIGIN_CHAIN', | ||||||||||||||||||||||
| 'destinationAsset': 'nep141:arb-0x912ce59144191c1204e64559fe8253a0e49e6548.omft.near', | ||||||||||||||||||||||
| 'amount': '100000000000000000000000', | ||||||||||||||||||||||
| # ... | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
| result = quote.json() | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
| </CodeGroup> | ||||||||||||||||||||||
| </Columns> | ||||||||||||||||||||||
| <Card title="Verifier Contract" icon="credit-card" href="/integration/verifier-contract/introduction" cta="Read docs" arrow> | ||||||||||||||||||||||
| Interact with the smart contract for custom integrations. | ||||||||||||||||||||||
|
Comment on lines
+17
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Switch internal card links to relative paths. These links are root-absolute ( As per coding guidelines, "Use relative paths for all internal links in MDX documentation files." 🤖 Prompt for AI Agents |
||||||||||||||||||||||
| </Card> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| <Columns cols={2}> | ||||||||||||||||||||||
| <img src="/images/widget/swap-widget.png" alt="Swap Widget UI" class="rounded-lg border border-gray-950/10 dark:border-white/10 swap-widget-preview" /> | ||||||||||||||||||||||
| <div> | ||||||||||||||||||||||
| <h2 class="mb-2"> React Widget </h2> | ||||||||||||||||||||||
| <p>Integrate a customizable, cross-chain swap interface into your app with just a few lines of code.</p> | ||||||||||||||||||||||
| <p><a href="/integration/devkit/react-widget"> Learn More -> </a></p> | ||||||||||||||||||||||
| </div> | ||||||||||||||||||||||
| </Columns> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
Comment on lines
+16
to
43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use The current As per coding guidelines, "Introduction pages should use 🤖 Prompt for AI Agents |
||||||||||||||||||||||
| </Columns> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| <Columns cols={2}> | ||||||||||||||||||||||
| <div class="mr-4"> | ||||||||||||||||||||||
| <h2 class="mb-2"> SDK Libraries </h2> | ||||||||||||||||||||||
| <p>Use SDKs for TypeScript, Go, and Rust to request quotes, submit deposits, and monitor execution status.</p> | ||||||||||||||||||||||
| <p><a href="/integration/devkit/sdk"> Learn More -> </a></p> | ||||||||||||||||||||||
| </div> | ||||||||||||||||||||||
| <CodeGroup> | ||||||||||||||||||||||
| ```typescript TypeScript | ||||||||||||||||||||||
| import { OpenAPI, OneClickService } from '@defuse-protocol/one-click-sdk-typescript'; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| OpenAPI.TOKEN = 'YOUR_JWT_TOKEN'; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| const tokens = await OneClickService.getTokens(); | ||||||||||||||||||||||
| console.log(tokens.length); | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ```go Go | ||||||||||||||||||||||
| configuration := openapiclient.NewConfiguration() | ||||||||||||||||||||||
| apiClient := openapiclient.NewAPIClient(configuration) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| tokens, _, err := apiClient.OneClickAPI.GetTokens(context.Background()).Execute() | ||||||||||||||||||||||
| if err != nil { | ||||||||||||||||||||||
| panic(err) | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ```rust Rust | ||||||||||||||||||||||
| use one_click_sdk_rs::apis::one_click_api; | ||||||||||||||||||||||
| use one_click_sdk_rs::apis::configuration::Configuration; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| let config = Configuration::default(); | ||||||||||||||||||||||
| let tokens = one_click_api::get_tokens(&config).await?; | ||||||||||||||||||||||
| println!("{}", tokens.len()); | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
| </CodeGroup> | ||||||||||||||||||||||
| </Columns> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| <h2 class="ps-0"> Browse By Topic </h2> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| <Columns cols={4}> | ||||||||||||||||||||||
| <Card title="API Quickstart" icon="rocket" href="/integration/distribution-channels/1click-api/quickstart" cta="Integrate" arrow> | ||||||||||||||||||||||
| Execute your first cross-chain swap in minutes. | ||||||||||||||||||||||
| </Card> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| <Card title="React Widget" icon="palette" href="/integration/devkit/react-widget" cta="Integrate" arrow> | ||||||||||||||||||||||
| Embed a customizable swap UI with a ready-to-use React component. | ||||||||||||||||||||||
| </Card> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| <Card title="SDK Libraries" icon="window-restore" href="/integration/devkit/sdk" cta="Explore" arrow> | ||||||||||||||||||||||
| Build with TypeScript, Go, and Rust SDKs for typed API integration. | ||||||||||||||||||||||
| </Card> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| <Card title="What are intents?" icon="lightbulb" href="/getting-started/what-are-intents" cta="Read docs" arrow> | ||||||||||||||||||||||
| Learn how the protocol works and core concepts. | ||||||||||||||||||||||
| </Card> | ||||||||||||||||||||||
| </Columns> | ||||||||||||||||||||||
| <Columns cols={2}> | ||||||||||||||||||||||
| <Card title="Market Makers" icon="users" href="/integration/market-makers/introduction" cta="Learn how" arrow> | ||||||||||||||||||||||
| Provide liquidity by fulfilling cross-chain swap intents. | ||||||||||||||||||||||
| </Card> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| <Card title="Verifier Contract" icon="credit-card" href="/integration/verifier-contract/introduction" cta="Read docs" arrow> | ||||||||||||||||||||||
| Interact with the smart contract for custom integrations. | ||||||||||||||||||||||
| </Card> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| </Columns> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| </div> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| </div> | ||||||||||||||||||||||
| </div> | ||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use named nested groups with icons instead of blank group placeholders.
Using
"group": " "and icon-less groups in new sections diverges from the navigation standard and makes sidebar structure less clear.As per coding guidelines, "Use nested groups with Font Awesome icons for navigation in
docs.json."Also applies to: 79-87
🤖 Prompt for AI Agents