Skip to content

Commit f297e12

Browse files
authored
Language updates (#18)
* updated required packages * update fund nd payment flows * updated use-cases * updated sdk pages * removed explicit gasless param * updated sdk
1 parent 6aab252 commit f297e12

22 files changed

+1730
-849
lines changed

architecture/pricing-fees.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ icon: 'diagram-project'
77

88
## Fee Model
99

10-
The protocol is free to integrate for any app.
10+
The protocol is free to integrate for any app. The fee for Trails is paid by the end-user which includes:
1111

12-
Trails has a fee model competitive with the market which consists of a percentage of the transaction volume exchanged when orchestrating a transaction paid by the user when a bridge or swap is part of the orchestration. Notably, these are not static and scale down significantly with the value transacted, therefore higher transaction volume amounts will result in less fees for the user.
12+
- Gas fees on the origin and destination chains
13+
- Included fees for liquidity providers or bridges
14+
- Trails protocol fee which scales significantly down with the amount of volume (in USD) transacted
1315

docs.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"global": {
1818
"anchors": [
1919
{
20-
"anchor": "Playground",
20+
"anchor": "Demo Playground",
2121
"icon": "square-terminal",
2222
"href": "https://demo.trails.build/widget"
2323
}
@@ -52,7 +52,6 @@
5252
"group": "Examples",
5353
"pages": [
5454
"examples/receive",
55-
"examples/gasless",
5655
"examples/alt-fee-tokens",
5756
"examples/wallet-compatibility",
5857
"examples/transaction-history",
@@ -81,13 +80,14 @@
8180
"pages": [
8281
"sdk/get-started",
8382
"sdk/configuration",
83+
"sdk/hooks",
8484
{
8585
"group": "Modes",
86-
"pages": ["sdk/modes/pay", "sdk/modes/fund", "sdk/modes/swap", "sdk/modes/receive"]
86+
"pages": ["sdk/modes/pay", "sdk/modes/fund", "sdk/modes/swap", "sdk/modes/earn"]
8787
},
8888
"sdk/theming",
89-
"sdk/gasless",
90-
"sdk/hooks"
89+
"sdk/quote-providers",
90+
"sdk/tokens-and-chains"
9191
]
9292
}
9393
]

get-started.mdx

Lines changed: 18 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,31 @@ sidebarTitle: "Getting Started"
1010
</Card>
1111

1212
<Card title="React Starter Kit" icon="code" href="https://github.com/0xsequence-demos/trails-starter">
13-
Minimal template for Trails with Earn, Swap, Pay, and Fund modes integrated.
13+
Minimal React template for Trails with Earn, Swap, Pay, and Fund modes integrated.
14+
</Card>
15+
16+
<Card title="NextJS Starter Kit" icon="code" href="https://github.com/0xsequence-demos/trails-nextjs-starter">
17+
Minimal NextJS template for Trails with Earn, Swap, Pay, and Fund modes integrated.
1418
</Card>
1519
</div>
1620

1721

1822

1923
To install on your own application:
2024
<Steps>
21-
<Step title="Install the SDK">
25+
<Step title="Install the SDK and dependencies">
2226
<CodeGroup>
2327
```shell pnpm
24-
pnpm i 0xtrails
28+
pnpm i 0xtrails wagmi viem
2529
```
2630
```shell npm
27-
npm install --save 0xtrails
31+
npm install --save 0xtrails wagmi viem
2832
```
2933
```shell yarn
30-
yarn add 0xtrails
34+
yarn add 0xtrails wagmi viem
3135
```
3236
```shell bun
33-
bun add 0xtrails
37+
bun add 0xtrails wagmi viem
3438
```
3539
</CodeGroup>
3640
</Step>
@@ -44,7 +48,8 @@ To install on your own application:
4448
export const App = () => {
4549
return (
4650
<TrailsWidget
47-
toAddress="0x97c4A952b46bEcaD0663f76357d3776ba11566E1"
51+
mode="fund"
52+
toAddress="0x97c4A952b46bEcaD0663f76357d3776ba11566E1" // contract or wallet address of recipient
4853
toAmount="1"
4954
toChainId={8453}
5055
toToken="USDC"
@@ -57,35 +62,13 @@ To install on your own application:
5762

5863

5964
## Next steps
65+
Trails is optimized for a variety of common use cases or flows for your application:
6066

61-
- [Pay](/use-cases/pay): Buy NFTs, RWAs, or any asset using any token from any chain; Trails aggregates balances and handles bridging, swapping, and execution.
62-
- [Swap](/use-cases/swap): Cross-chain token swaps in a single confirmation with unified liquidity and optimal routing—no manual bridging or DEX hopping.
63-
- [Fund](/use-cases/fund): Deposit into a chain, app, or protocol from any token on any chain in one flow; Trails optimizes routes and handles swaps/bridges.
64-
- [Earn](/use-cases/earn): Deposit into vaults/pools (e.g., Aave) with automatic swap/bridge to the required asset; confirm once and start earning.
65-
66-
- [Configuration](/sdk/configuration): Full list of variables to customize Trails including different modes, theming, enabling gasless transactions, events, and quote providers.
67-
68-
69-
## Script Import
70-
71-
While we recommend using the React component, you can also embed via a script tag in a non-React site.
72-
73-
```html
74-
<div id="trails"></div>
75-
<script src="https://cdn.jsdelivr.net/npm/0xtrails@latest/dist/umd/trails.min.js"></script>
76-
<script>
77-
TrailsWidget.render(document.getElementById('trails'), {
78-
toAddress: '0x...',
79-
toAmount: '0.1',
80-
toChainId: 8453,
81-
toToken: '0xUSDC...'
82-
})
83-
</script>
84-
```
85-
86-
### Available CDNs
67+
- **[Pay](/use-cases/pay)**: Enable cross-chain, 1-click payments with any token for ecommerce platforms, NFT marketplaces, real-world asset purchases, and minimal-slippage stablecoin transactions.
68+
- **[Swap](/use-cases/swap)**: Embed low-latency, highly liquid cross-chain token swaps for your applications.
69+
- **[Fund](/use-cases/fund)**: Maximize TVL and transaction velocity through fully brandable funding widgets for protocol deposits such as perpetual exchanges, chain deposits, and liquidity provisioning.
70+
- **[Earn](/use-cases/earn)**: Streamline DeFi yield opportunities by enabling deposits from your app into already integrated tokenized vaults, lending pools, and yield strategies from any token on any chain.
71+
- [Configuration](/sdk/configuration): Full list of variables & hooks to customize Trails including different modes, theming, enabling gasless transactions, events, and quote providers.
8772

88-
- **unpkg**: `https://unpkg.com/0xtrails@latest/dist/umd/trails.min.js`
89-
- **jsDelivr**: `https://cdn.jsdelivr.net/npm/0xtrails@latest/dist/umd/trails.min.js`
9073

9174
For production use, pin to a specific version by replacing `@latest` with `@1.0.0` or your desired version.

intro.mdx

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,49 @@
11
---
22
title: What is Trails
3-
description: Intent powered multichain transaction rails to pay, swap, fund, or earn in 1-click with any wallet, token or chain.
3+
description: Multichain transaction rails to pay, swap, fund, or earn in 1-click with any wallet, token or chain - powered by intents.
44
---
55

66

77
## Overview
88

9-
Trails is a multi-chain orchestration protocol that enables 1-click simplified and fast transactions from any wallet seamlessly with unified user liquidity across all chains.
10-
In contrast to typical cross-chain offerings, Trails sources liquidity and aggregates all user balances for every token across every chain in a user's wallet
11-
as options for any transaction (ie. payment) on a destination chain. Trails is architected as a trustless system that
9+
Trails is a chain abstraction orchestration protocol that enables 1-click transactions from any wallet seamlessly with unified user liquidity across all chains.
10+
In contrast to typical cross-chain solutions, Trails sources liquidity and aggregates all user balances for every token across every chain in a user's wallet
11+
as options for any transaction on a destination chain. Trails is architected as a trustless system that
1212
works on top of existing bridging, filler, or solver infrastructure. Trails is free to integrate and is optimized for a variety of use cases, for example:
1313

1414
- **[Pay](/use-cases/pay)**: Enable cross-chain, 1-click payments with any token for ecommerce platforms, NFT marketplaces, real-world asset purchases, and minimal-slippage stablecoin transactions.
15-
- **[Swap](/use-cases/swap)**: Embed low-latency, highly liquid cross-chain token swaps for DeFi applications, portfolio management tools, and trading platforms
16-
- **[Fund](/use-cases/fund)**: Maximize TVL and transaction velocity through fully brandable funding widgets for protocol deposits, chain onboarding, and liquidity provisioning
15+
- **[Swap](/use-cases/swap)**: Embed low-latency, highly liquid cross-chain token swaps for your applications.
16+
- **[Fund](/use-cases/fund)**: Maximize TVL and transaction velocity through fully brandable funding widgets for protocol deposits such as perpetual exchanges, chain deposits, and liquidity provisioning.
1717
- **[Earn](/use-cases/earn)**: Streamline DeFi yield opportunities by enabling deposits into tokenized vaults, lending pools, and yield strategies from any token on any chain
1818

1919
## Key Features
2020

2121
### 1-click transactions
22-
- Payments occur in a single confirmation with any wallet, regardless if it's an EOA, account abstraction wallet, or EIP-7702 enabled.
23-
- Developers simply specify payment intent (e.g., "purchase NFT #123 with 30 USDC") for a user to confirm.
24-
- Built-in multichain real-time indexing to automatically return user's wallet balances & prices. No additional vendor license required.
22+
- Transactions occur in a single confirmation with any wallet, regardless if it's an EOA, account abstraction wallet, or EIP-7702 enabled.
23+
- Developers simply specify payment intent (e.g., "purchase NFT #123 with 30 USDC") and a user can select any token across their wallet balance to pay.
2524

2625
### Universal User Liquidity
27-
- Aggregates all user balances across every token and chain as payment options.
26+
- Built-in multichain, real-time indexing to automatically return user's wallet balances & prices. No third-party dependencies necessary.
2827
- Leveraging existing liquidity infrastructure such as DEX's, bridges, or aggregators, we support a vast array of tokens and chains.
2928

3029
### Blazing Fast
3130
- Fast from anywhere, even with payments across chains using our intent-based architecture & relayer infrastructure.
32-
- Protocol intelligently detects optimal route for payment fulfillment.
31+
- Protocol intelligently detects optimal route for payment fulfillment and presents to the user in a streamlined UX.
3332

3433
### Scalable
3534
- Trails can leverage virtually any existing cross-chain or liquidity infrastructure, including bridges, aggregators, and more.
3635
- Relayer & Indexing infrastructure is lightweight and easily deployable to new chains.
3736

3837
## How Trails Works
3938

40-
1. **Define Intent (App)**: Create a payment transaction (mint, deposit, swap, etc) for any chain in any token.
41-
2. **Trails Inspects (Trails SDK)**: Can this succeed with the assets held on current chain? Yes = Pass through. No = Continue Orchestration.
42-
3. **Select Route (User)**: Trails presents an aggregated balance of the user's assets across all chains for the user to select from.
43-
4. **Orchestrate Transaction (Trails SDK)**: Intelligently combines and optimizes swap + bridge + execute for the selected route to fulfill the transaction.
44-
5. **Execute Transaction (Trails Intents)**: User confirms transaction via their wallet which executes the end to end to flow for the selected payment.
39+
1. **App Defines Intent**: Create a payment transaction (mint, deposit, swap, etc) for any chain in any token.
40+
2. **Trails SDK Inspects**: Can this succeed with the assets held on current chain? Yes = Pass through. No = Continue Orchestration.
41+
3. **User Selects Route**: Trails presents an aggregated balance of the user's assets across all chains for the user to select from.
42+
4. **Trails Orchestrates Transaction**: Intelligently combines and optimizes swap + bridge + execute for the selected route to fulfill the transaction.
43+
5. **Execute Transaction**: User confirms transaction via their wallet which executes the end to end to flow for the selected payment.
4544

4645
This architecture enables developers to build sophisticated transaction experiences while abstracting the underlying complexity of multichain operations. All you have to do is specify what transaction and any payment options to execute
47-
on a destination chain.
46+
on a destination chain. Developers can pass in calldata to execute any arbitrary smart contract functions.
4847

4948
### Working with Trails
5049

@@ -55,7 +54,7 @@ and does not require EIP-7702 enabled wallets. For more information please read
5554

5655
## Quickstart
5756

58-
Looking to integrate? [Get started](/get-started) and build natively cross-chain in minutes.
57+
Looking to integrate? [Get started](/get-started) and build your app natively cross-chain in minutes.
5958

6059
## Who Built Trails?
6160

overview/1-click-payments.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Trails enables 1-click payments through an intent-based architecture that is abl
2929
A unique intent contract address is computed based on the full transaction orchestration across multiple chains. The intent address encodes the details of both transactions on both the origin and destination
3030
chains.
3131

32-
3. **Origin Deposit**
32+
3. **Origin Transfer**
3333
The user sends a single transaction to deposit their tokens (from any chain they hold funds on) into the intent address on the origin chain. Importantly, the user's wallet has full control over this intent address.
3434

3535
4. **Origin Chain Execution**
@@ -55,7 +55,7 @@ import { TrailsWidget } from '0xtrails/widget'
5555
export const CrossChainPayment = () => {
5656
return (
5757
<TrailsWidget
58-
toAddress="0x..." // recipient wallt address
58+
toAddress="0x..." // recipient address
5959
toAmount="0.1"
6060
toChainId={8453} // Base
6161
toToken="USDC"

overview/chain-abstraction.mdx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
2-
title: 'Unified User Liquidity'
2+
title: 'Chain Abstraction'
33
description: 'Trails abstracts away complexities of interacting with multiple blockchain networks as well as aggregating balances from these chains for universal buying power.'
44
icon: 'layer-group'
55
---
66

77

8-
## Maximizing Buying Power
8+
## Universal User Liquidity
99

10-
User wallet balances are typically fragmented across multiple networks. Not only is this cumbersome from a user experience perspective to manage where funds are held, this also limits the buying power on applications for any given payment as I can only use the funds on a single source chain at any time.
10+
Current user wallet balances are fragmented across multiple chains, wallets, tokens. Not only is this cumbersome from a user experience perspective to manage where funds are held, this also limits the buying power on applications for any given payment as a user can only use the funds on a single source chain at any time.
1111

12-
In contrast, Trails is a chain-abstracted solution that hides the complexity of multiple blockchains from both developers and end users, creating a unified experience that feels like interacting with a single blockchain with a single, aggregated balance.
12+
In contrast, Trails is a chain abstraction solution that simplifies the complexity of interacting with multiple blockchains from both developers and end users. This creates a unified experience for apps that enables users to pay with any token on any chain unlocking their full purchasing power.
1313

1414
## Cross-Chain vs Chain Abstraction
1515

@@ -40,21 +40,20 @@ The standard cross-chain experience requires users to be aware of and manage mul
4040
Trails is a chain abstraction solution that eliminates these complexities by:
4141

4242
- **Universal Buying Power**: Applications can enable users to pay in every token from every chain for any arbitrary payment, i.e., an NFT costs 60 USDC on Base, a user can purchase it using 30 USDC on Optimism and 30 Arbitrum seamlessly.
43-
- **Unified User Interface**: Single point of interaction across all chains
44-
- **Gasless Transactions**: Users don't need to hold specific gas tokens to interact across chains
43+
- **Unified User Interface**: Single point of interaction across all chains. All app interactions can funnel through Trails to simplify flows.
44+
- **Pay Gas in More Tokens**: Users don't need to hold specific gas tokens to interact across chains, any permit-compatible token can be used for end to end transactions.
4545
- **Failure Recovery**: Built-in mechanisms to handle and recover from failed transactions
4646

47-
With chain abstraction, users interact with a unified layer that automatically handles all the underlying blockchain complexity with simple integration with Trails for developers - optimized for payments.
47+
With chain abstraction, users interact with a unified layer that automatically handles all the underlying blockchain complexity with simple integration with Trails in their application.
4848

4949

5050
## Unifying the Modular Ecosystem
5151

5252
Chain abstraction through Trails realizes the vision of modular blockchain networks, by unifying fragmented liquidity, enhancing buying power for users, and simplifying integration across networks.
5353

54-
By simplifying the payment process and removing the need for users to manually manage assets across different chains, Trails significantly reduces friction, which can lead to lower churn and cart abandonment rates.
54+
By simplifying the transaction process and removing the need for users to manually manage assets across different chains, Trails significantly reduces friction, which can lead to lower churn and higher transaction volume.
5555

5656
## Coming Soon
5757

5858
- **Multi-token payments**: Pay with multiple tokens in a single transaction.
59-
- **Gas abstraction**: Pay for gas in any token.
6059

0 commit comments

Comments
 (0)