Skip to content
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

chore: merge main into docs #243

Closed
wants to merge 44 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
b00d5b9
Fix apiURL prop for web-component (#195)
toddkao Aug 30, 2024
9372c70
chore(widget): bump latest client (#203)
codingki Aug 30, 2024
882a36e
Version Packages (#204)
github-actions[bot] Aug 30, 2024
b120caf
Add publish script to release workflow (#205)
toddkao Aug 30, 2024
a81fb70
[FRE-960] feat(widget-v2): swap page route logic (#206)
codingki Aug 30, 2024
b048995
Fix filter + defaultRoute bug (#208)
toddkao Sep 3, 2024
3cf586c
Version Packages (#209)
github-actions[bot] Sep 3, 2024
4a3357c
Update publish.yml (#211)
toddkao Sep 3, 2024
0519e17
Remove scrollStore and scrollTop behavior in disclosures (#210)
toddkao Sep 3, 2024
5881863
Version Packages (#212)
github-actions[bot] Sep 3, 2024
c1d219d
Update publish.yml (#213)
toddkao Sep 3, 2024
4a93b59
widget v2: invert swap logic (#207)
codingki Sep 3, 2024
673efb1
Widget v2/wallet provider (#215)
codingki Sep 3, 2024
e96fadb
Fix price calculation to include bridging fees (#214)
toddkao Sep 3, 2024
b8fff56
Version Packages (#216)
github-actions[bot] Sep 3, 2024
bd3582a
Add ErrorPage variants (#217)
toddkao Sep 5, 2024
27b2f23
[FRE-966] Refactor/finality time using route repsonse (#219)
codingki Sep 5, 2024
218728e
add estimated amount out to swap operations (#189)
thal0x Sep 6, 2024
6ed5f55
Version Packages (#220)
github-actions[bot] Sep 9, 2024
6c6211c
Version Packages (#222)
github-actions[bot] Sep 9, 2024
1bf1f33
Create wallets hook (#218)
codingki Sep 9, 2024
3b78936
Add wallet address validation (#221)
toddkao Sep 9, 2024
7529026
Fix/transfers status schema (#227)
ericHgorski Sep 11, 2024
c5a2a3b
Use penumbra ephemeral address (#228)
grod220 Sep 12, 2024
6c45502
Pass props from swap widget to skip client (#224)
toddkao Sep 12, 2024
e1681f0
chore: release penumbra changes (#230)
codingki Sep 12, 2024
dabcc5c
Version Packages (#231)
github-actions[bot] Sep 12, 2024
30ecd34
Add debouncing route request (#232)
toddkao Sep 12, 2024
f8ebffe
[FRE-967] Fix validate gas balance checking (#233)
codingki Sep 12, 2024
cc11ec6
Version Packages (#235)
github-actions[bot] Sep 12, 2024
226db04
feat: adjust estimated time text (#234)
codingki Sep 12, 2024
a2aa38c
Version Packages (#236)
github-actions[bot] Sep 12, 2024
fc28e75
Add keyboard navigation to VirtualList (#237)
toddkao Sep 13, 2024
75fd329
fix: api reference example names for consistency (#229)
ericHgorski Sep 13, 2024
c5750f3
fix: swagger linebreak formatting (#226)
ericHgorski Sep 13, 2024
56b7814
Remove useTheme in useModal (#240)
toddkao Sep 13, 2024
0caa740
token use useGetAssetDetails hook (#241)
codingki Sep 13, 2024
9030799
Fix debouncedRouteRequestEffect (#239)
toddkao Sep 13, 2024
6b3f7dd
wallet selector (#223)
codingki Sep 16, 2024
8498a06
[FRE-982] fix: zero appeared in tx preview (#245)
codingki Sep 16, 2024
39e6b0a
Version Packages (#247)
github-actions[bot] Sep 16, 2024
4bc1c31
Add isWaitingToUpdateInputValue + animation to AssetChainInput, Add p…
toddkao Sep 16, 2024
0071b78
fix: closing tag so mdx in docs renders properly (#244)
ericHgorski Sep 16, 2024
594f513
fix: links, typos, improve language clarity (#225)
ericHgorski Sep 16, 2024
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
10 changes: 10 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,13 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish web component
if: steps.changesets.outputs.published == 'true'
continue-on-error: true
working-directory: ./packages/widget
run: |
git pull origin main
yarn publish:web-component
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
},
"eslint.format.enable": true,
"[typescript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[typescriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
}
}
2 changes: 1 addition & 1 deletion docs/advanced-transfer/evm-transactions.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 'EVM Transactions Intro'
title: 'EVM Transactions'
description: 'This doc covers how to interact with the EvmTx type returned by the Skip Go API'
---

Expand Down
2 changes: 1 addition & 1 deletion docs/advanced-transfer/svm-transaction-details.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 'SVM Transactions Intro'
title: 'SVM Transactions'
description: 'This document explains how to use Skip Go API and Client TypeScript Package to construct SVM transactions.'
---

Expand Down
4 changes: 2 additions & 2 deletions docs/client/gas-and-fee-tooling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ This field in `ExecuteRouteOptions` allows you to override our default gas price

`getGasPrice?: (chainID: string) => Promise<GasPrice | undefined>;`

The argument is a function that takes in a chain id and returns a gas price for that chain as a `GasPrice` object from CosmJS
The argument is a function that takes in a chain ID and returns a gas price for that chain as a `GasPrice` object from CosmJS

```text JavaScript
type GasPrice = {
Expand All @@ -100,7 +100,7 @@ If you provide a function that only returns a price for a subset of chains, the

### `ExecuteRouteOptions.gasAmountMultiplier`

This field in `ExecuteRouteOptions` allows you to override the default gas multiplier used in the SDK by default. (The default value is 1.5). Increases this value gives you higher confidence that your transaction will not run out of gas while executing, but increases the fee for the end user.
This field in `ExecuteRouteOptions` allows you to override the default gas multiplier used by default in the SDK. The default value is 1.5. Increasing this value provides higher confidence that transactions will not run out of gas while executing, but increases the fee for the end user.

The gas multiplier increases a transaction's `gasAmount` multiplicatively. To get a final gas amount, the router:

Expand Down
4 changes: 2 additions & 2 deletions docs/client/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const chains = await client.chains({
});
```

#### Get a map of assets by chain id
#### Get a map of assets by chain ID

Return type will be `Record<string, Asset[]>`

Expand All @@ -121,7 +121,7 @@ const assets = await client.assets({
includeSvmAssets: true,
});

// get assets filtered by chain id
// get assets filtered by chain ID
const assets = await client.assets({
chainID: 'cosmoshub-4'
includeEvmAssets: true,
Expand Down
24 changes: 12 additions & 12 deletions docs/general/affiliate-fees.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ description: "This page covers how integrators can earn affiliate fees on swaps.

### Overview

Many teams use Skip Go API as a source of a revenue for their project by charging fees on swaps. (Charging fees on transfers will be possible in the future!). We refer to these fees throughout the product and documentation as "affiliate fees"
Many teams use Skip Go as a source of a revenue for their project by charging fees on swaps. (Charging fees on transfers will be possible in the future!). We refer to these fees throughout the product and documentation as "affiliate fees"

Skip Go API's affiliate fee functionality is simple but flexible -- supporting a large variety of bespoke fee collection scenarios:
Skip Go's affiliate fee functionality is simple but flexible -- supporting a large variety of bespoke fee collection scenarios:

* Set your desired fee level on each swap (so you can offer lower fees to your most loyal users)
* Set the account that receives the fee on each swap (so you can account for funds easily & separate revenue into different tranches)
Expand All @@ -16,16 +16,16 @@ Skip Go API's affiliate fee functionality is simple but flexible -- supporting a
### Affiliate Fees Work

1. **At this time, affiliate fees can only be collected on swaps**. We do not support collecting affiliate fees on routes that only consist of transfers (e.g. CCTP transfers, IBC transfers, etc...) even when there are multi-hop transfers. Please contact us if charging fees on transfers is important to you
2. **Affiliate fees are collected on the chain where the last swap takes place**: Skip Go API aggregates over swap venues (DEXes, orderbooks, liquid staking protocols, etc...) on many different chains. Some routes even contain multiple swaps. For each individual cross-chain or single chain swap where you collect a fee, the fee is applied on the last swap and sent to an address you specify on the chain where the last swap takes place.
3. **Affiliate fees are collected/denominated in the output token of each swap**: For example, if a user swaps OSMO to ATOM, your fee collection address will earn a fee in ATOM.
4. **Affiliate fees are calculated using the minimum output amount, which is set based on our estimated execution price after accounting for the user's slippage tolerance** : For example, consider an ATOM to OSMO swap where min amount out is 10 uosmo and the cumulative fees are 1000 bps or 10%. If the swap successfully executes, the affiliate fee will be 1 uosmo. It will be 1 uosmo regardless of whether the user actually gets 10, 11, or 12 uosmo out of the swap.
2. **Affiliate fees are collected on the chain where the last swap takes place**: Skip Go aggregates over swap venues (DEXes, orderbooks, liquid staking protocols, etc...) on many different chains. Some routes even contain multiple swaps. For each individual cross-chain or single chain swap where you collect a fee, the fee is applied on the last swap and sent to an address you specify on the chain where the last swap takes place
3. **Affiliate fees are collected/denominated in the output token of each swap**: For example, if a user swaps OSMO to ATOM, your fee collection address will earn a fee in ATOM
4. **Affiliate fees are calculated using the minimum output amount, which is set based on our estimated execution price after accounting for the user's slippage tolerance** : For example, consider an ATOM to OSMO swap where min amount out is 10 uosmo and the cumulative fees are 1000 bps or 10%. If the swap successfully executes, the affiliate fee will be 1 uosmo. It will be 1 uosmo regardless of whether the user actually gets 10, 11, or 12 uosmo out of the swap

### How to Use Affiliate Fees

There are two simple steps involved in using affiliate fees:

1. **Incorporate the fee into the quote** : You need to request the route & quote with the total fee amount (in basis points) you will collect, so Skip Go API can deduct this automatically from the estimated `amount_out` it returns to the user. This ensures the quote you show the user already accounts for your fee, and they won't receive any unexpectedly low amount.
2. **Set the address(es) to receive the fee**: You also need to tell Skip Go API the exact address(es) to send the fee revenue to. You need to pass a list of addresses and specify a fee amount (in basis points) for each to collect.
1. **Incorporate the fee into the quote** : You need to request the route & quote with the total fee amount (in basis points) you will collect, so Skip Go can deduct this automatically from the estimated `amount_out` it returns to the user. This ensures the quote you show the user already accounts for the fee, and they won't receive any unexpectedly low amount.
2. **Set the address(es) to receive the fee**: You also need to tell Skip Go the exact address(es) to send the fee revenue to. You need to pass a list of addresses and specify a fee amount (in basis points) for each to collect.

#### Fees with /route and /msgs

Expand All @@ -38,18 +38,18 @@ When using `/route` and `/msgs`, you incorporate the fee into the quote when you
1. The sum of `basis_points_fee` values across all affiliates should equal `cumulative_affiliate_fee_bps`
2. If you pass any addresses that are not valid on the chain where the swap will take place, the request will return a `400` error

#### Fees with /msgs\_direct
#### Fees with `/msgs_direct`


<Info>
**/route and /msgs recommended over /msgs\_direct**
**`/route` and `/msgs` recommended over `/msgs_direct`**

We generally recommend integrators use `/route` and `/msgs` rather than `/msgs_direct`. The complexity you must manage below is part of the reason for this recommendation.
</Info>

1. Set `affiliates`to a list of\` `Affiliate` objects, where each corresponds to an address that will receive a portion of the fees if the swap takes place on the chain where that address is located. ( Within an `Affiliate` object, `address` gives the address, and `basis_points_fee` gives the fee amount).
1. You should pass a set of affiliate addresses for every chain where the swap _might_ take place. (You can get this list by querying the `/v2/fungible/swap_venues` endpoint for the list of all `swap_venues` and grabbing the `chain_id` for each). This is required because `/msgs_direct` is determining the route, so we don't know which chain the swap will take place on when calling it.
2. You should ensure that the sums of `basis_points_fee` for the sets of addresses you pass for each chain are equivalent. (For example, if you pass osmo1... addresses and neutron1... addresses, the sum of the `basis_points_fee` values for the osmo1... addresses must be the same as the sum for the neutron1... addresses.) You will receive an error if your fee sums are non-equivalent. (The error is necessary because we don't know which fee amount to simulate with.)
1. Set `affiliates`to a list of\` `Affiliate` objects, where each corresponds to an address that will receive a portion of the fees if the swap takes place on the chain where that address is located. (Within an `Affiliate` object, `address` gives the address, and `basis_points_fee` gives the fee amount).
1. You should pass a set of affiliate addresses for every chain where the swap _might_ take place. (You can get this list by querying the `/v2/fungible/swap_venues` endpoint for the list of all `swap_venues` and grabbing the `chain_id` for each). This is required because `/msgs_direct` determines the route, so we don't know which chain the swap will take place on when calling it.
2. You should ensure that the sums of `basis_points_fee` for the sets of addresses you pass for each chain are equivalent. (For example, if you pass osmo1... addresses and neutron1... addresses, the sum of the `basis_points_fee` values for the osmo1... addresses must be the same as the sum for the neutron1... addresses.) You will receive an error if your fee sums aren't equivalent. (The error is necessary because we don't know which fee amount to simulate with.)

<Check>
**Want to help us get better? Have questions or feedback?**
Expand Down
10 changes: 5 additions & 5 deletions docs/general/api-keys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ Technically, you can access most of the basic functionality of the Skip Go API w
- **No rate limit**: Integrators that do not pass a valid API key in their requests will be subject to a restrictive global rate limit, shared with all other unauthenticated users.
- **Improved fee revenue share pricing**: Unauthenticated integrators will be subject to a 25% revenue share on their fee revenue by default. Authenticated integrators who use API keys will be subject to a cheaper 20% revenue share by default.
- **Access to privileged features:** Integrators who authenticate with an API key will receive access to premium features that we cannot offer to the general public (e.g. Gas estimation APIs, universal balance query APIs, etc...)
- **Metrics on your volume and revenue:** Authenticated integrators will receive access to monthly statistics regarding their total swap and transfer volume and the amount of fee revenue they've earned. They will also receive transaction data for taxes annually.
- **Metrics on your volume and revenue:** Authenticated integrators will receive access to monthly statistics regarding their total swap and transfer volume and the amount of fee revenue they've earned. They will also receive annual transaction data for taxes.

## How to get an API Key

### 1\. Request an API Key

Open a support ticket on our [Discord](https://skip.build/discord) and tell our customer support that you'd like an API key. \*\*
Open a support ticket on our [Discord](https://skip.build/discord) and tell our customer support that you'd like an API key.

Please provide the following information in your request to help us get to know your project:

Expand All @@ -47,7 +47,7 @@ The customer support team member at Skip will establish an official channel of c

**You should store the API key immediately when you create it. We do not store your raw API key in our server for security reasons, so we will not be able to access it for you if you lose it.**

It is important to keep your API key private: Anyone with your API key can make requests to the Skip Go API as you, getting access to your rate limit, privileged features, and affecting your revenue and volume statistics.
It is important to keep your API key private. Anyone with your API key can make requests to the Skip Go API as you, getting access to your rate limit, privileged features, and affecting your revenue and volume statistics.

## How to use an API key

Expand Down Expand Up @@ -92,7 +92,7 @@ const client = new SkipClient({

### Setup a Proxy to Receive Skip Go API Requests and Add the API Key

To keep your API key secure and private, we recommend that you proxy the API requests from the frontend to your own backend--where you can add your API key in the header before forwarding the request to Skip Go API.
To keep your API key secure and private, we recommend that you proxy the API requests from the frontend to your own backend--where you can add your API key in the header before forwarding the request to the Skip Go API.

The snippets below show you how to use Next.js/Vercel for this kind of proxying. It only takes a moment to set up.

Expand Down Expand Up @@ -175,7 +175,7 @@ SKIP_API_KEY=<YOUR API KEY>

## How to Request Volume & Revenue Statistics

Just return to your official communication channel with Skip (probably a Telegram channel) and request the data. We will be able to share monthly reports. Eventually, we will create a customer portal and dashboards, so you'll have access to all the data you need continuously in a self-service manner.
Just return to your official communication channel with Skip (probably a Telegram channel) and request the data. We can share monthly reports. Eventually, we will create a customer portal with dashboards, so you'll have access to all the data you need in a self-service manner.

<Check>
**Want to help us get better? Have questions or feedback?**
Expand Down
Loading
Loading