Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 44 additions & 22 deletions mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
"light": "/logo/light.svg"
},
"feedback": {
"thumbsRating" : true
"thumbsRating": true
},
"favicon": "/favicon.svg",
"background": {
},
"background": {},
"colors": {
"primary": "#FF0093",
"light": "#FF0093",
Expand All @@ -20,10 +19,10 @@
"to": "#FF0093"
}
},
"sidebar" : {
"sidebar": {
"items": "border"
},
"modeToggle" : {
"modeToggle": {
"default": "dark",
"isHidden": true
},
Expand Down Expand Up @@ -60,14 +59,14 @@
"url": "changelog"
}
],
"anchors": [
],
"anchors": [],
"navigation": [
{
"group": "Layerswap V0 Bridge",
"pages": [
"introduction",
"security"
"security",
"protocol-overview"
]
},
{
Expand All @@ -79,7 +78,7 @@
"integration/mixed",
{
"group": "Cookbooks",
"icon" : "book",
"icon": "book",
"pages": [
"integration/cookbooks/wallet",
"integration/cookbooks/website"
Expand All @@ -101,7 +100,9 @@
},
{
"group": "Changelog",
"pages": ["changelog/api"]
"pages": [
"changelog/api"
]
}
],
"footer": {
Expand All @@ -116,33 +117,54 @@
{
"title": "Resources",
"links": [
{ "label": "Brand Assets", "url": "https://layerswap.notion.site/Layerswap-brand-guide-0822bc4f1a2d4af7bc2f1acbb05119e2?pvs=74" },
{ "label": "Public Roadmap", "url": "https://layerswap.ducalis.io/layerswap-roadmap" }
{
"label": "Brand Assets",
"url": "https://layerswap.notion.site/Layerswap-brand-guide-0822bc4f1a2d4af7bc2f1acbb05119e2?pvs=74"
},
{
"label": "Public Roadmap",
"url": "https://layerswap.ducalis.io/layerswap-roadmap"
}
]
},
},
{
"title": "Layerswap V0",
"links": [
{ "label": "App", "url": "https://layerswap.io/app" },
{ "label": "Docs", "url": "https://docs.layerswap.io" },
{ "label": "Explorer", "url": "https://layerswap.io/explorer" }
{
"label": "App",
"url": "https://layerswap.io/app"
},
{
"label": "Docs",
"url": "https://docs.layerswap.io"
},
{
"label": "Explorer",
"url": "https://layerswap.io/explorer"
}
]
},
{
"title": "Layerswap V8",
"links": [
{ "label": "App", "url": "https://layerswap.io/v8" },
{ "label": "Docs", "url": "https://v8-docs.layerswap.io" }
{
"label": "App",
"url": "https://layerswap.io/v8"
},
{
"label": "Docs",
"url": "https://v8-docs.layerswap.io"
}
]
}
]
},
"api" : {
"baseUrl" : "https://api.layerswap.io/"
"api": {
"baseUrl": "https://api.layerswap.io/"
},
"metadata": {
"og:title": "Layerswap V0 | Cross-Chain Bridge",
"og:description" : "Layerswap V0 is a cross-chain bridge that enables users to swap assets across different blockchains.",
"og:logo" : "/logo/dark.svg"
"og:description": "Layerswap V0 is a cross-chain bridge that enables users to swap assets across different blockchains.",
"og:logo": "/logo/dark.svg"
}
}
96 changes: 96 additions & 0 deletions protocol-overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
title: 'Protocol Overview'
description: 'End-to-end explanation of Layerswap protocol operations'
icon: diagram-project
---

Layerswap enables seamless crypto transfers across different networks and exchanges through a robust protocol that handles millions of dollars in daily transactions. Here's how it works from end to end:

<Steps>
<Step title="Initial Setup">
Partners must first:
1. Register at layerswap.io/dashboard
2. Create an organization and app
3. Obtain API keys for either mainnet or testnet environments
</Step>

<Step title="Transfer Initiation">
Transfers can be initiated in two ways:

<CardGroup cols={2}>
<Card title="API Integration" icon="server">
Create programmatic swaps using the API:
```bash
curl --location 'https://api.layerswap.io/api/swap' \
--header 'X-LS-APIKEY: {YOUR_APP_APIKEY}' \
--header 'Content-Type: application/json' \
--data '{
"source": "ETHEREUM_MAINNET",
"destination": "IMX_MAINNET",
"amount": 0.001,
"asset": "ETH",
"source_address": "0x...",
"destination_address": "0x...",
"refuel": false
}'
```
</Card>
<Card title="UI Integration" icon="browser">
Embed Layerswap directly or redirect to hosted page:
```javascript
<iframe src="https://layerswap.io/app/?
clientId=YOUR_CLIENT_ID
&to=STARKNET_MAINNET
&from=ETHEREUM_MAINNET
&destAddress=0x...">
</iframe>
```
</Card>
</CardGroup>
</Step>

<Step title="Transfer Methods">
Layerswap supports two transfer methods:

<Accordion title="Wallet Transfers">
Direct wallet connections where the dApp composes and sends transactions for signing and execution. Used when wallet connection is available.
</Accordion>

<Accordion title="Manual Transfers">
Layerswap generates a unique deposit address for each swap. Any transaction sent to this address completes the swap - ideal when direct wallet connection isn't possible.
</Accordion>
</Step>

<Step title="Swap Lifecycle">
<Frame>
<img src="/images/swap-life.png" />
</Frame>

1. **User Transfer Pending**: Initial state after swap creation
2. **LS Transfer Pending**: After user transaction is received and matched
3. **Completed**: After successful destination network transaction
4. **Failed**: If destination transaction cannot be processed
5. **Cancelled/Expired**: If user cancels or 4-day window expires
</Step>

<Step title="Status Tracking">
Partners can track swap status through:

<CardGroup cols={2}>
<Card title="API Polling" icon="rotate">
Query swap status endpoints periodically
</Card>
<Card title="Webhooks" icon="webhook">
Receive real-time notifications for status changes
</Card>
</CardGroup>
</Step>
</Steps>

<Note>
For production deployments, always use mainnet API keys. Testnet keys should only be used for development and testing purposes.
</Note>

<Warning>
API keys should be stored securely and never exposed in client-side code. Always make API calls from your backend services.
</Warning>