Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
shunjizhan committed Sep 2, 2024
1 parent 197358b commit fd1c77f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
40 changes: 37 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ params: {
poolId: string; // euphrates pool id
recipient: string; // dest evm address
swapAmount: string; // how many token to swap before adding liquidity
minShareAmount?: string; // swap min share amount (default: 0)
minShareAmount?: string; // add liquidity min share amount (default: 0)
}
```

Expand All @@ -590,9 +590,9 @@ POST /routeSwapAndLp
data: {
poolId: string; // euphrates pool id
recipient: string; // dest evm address
token?: string; // token to route, not required for `shouldRoute`
token: string; // token to route
swapAmount: string; // how many token to swap before adding liquidity
minShareAmount?: string; // swap min share amount (default: 0)
minShareAmount?: string; // add liquidity min share amount (default: 0)
}
```

Expand All @@ -615,6 +615,40 @@ data: {
// similar to /routeXcm
```

### `/rescueSwapAndLp`
- perform gas drop
- rescue token to recipient

```
POST /rescueSwapAndLp
data: {
poolId: string; // euphrates pool id
recipient: string; // dest evm address
token: string; // token to route
swapAmount: string; // how many token to swap before adding liquidity
minShareAmount?: string; // add liquidity min share amount (default: 0)
}
```

example
```
POST /rescueSwapAndLp
data: {
"poolId": 7,
"recipient": "0x0085560b24769dAC4ed057F1B2ae40746AA9aAb6",
"token": "0xa7fb00459f5896c3bd4df97870b44e868ae663d7",
"swapAmount": 100000000
}
=> tx hash
{
data: '0xe1c82c53796d82d87d2e31e289b3cc8ff18e304b8ac95f2bd7548a1706bb8655'
}
/* ---------- when error ---------- */
// similar to /routeXcm
```

## Routing Process
A complete working flow can be found in [routing e2e tests](./src/__tests__/route.test.ts).

Expand Down
2 changes: 1 addition & 1 deletion src/utils/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export type SwapAndRouteParams = RouteParamsEuphrates;
// does not support general swap yet
export interface SwapAndLpParams extends RouteParamsEuphrates {
swapAmount: string; // how many token to swap before adding liquidity
minShareAmount?: string; // swap min share amount
minShareAmount?: string; // add liquidity min share amount
}

export interface RelayAndRouteParams extends RouteParamsXcm {
Expand Down

0 comments on commit fd1c77f

Please sign in to comment.