Squid 백서

Squid

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 27쪽 중 21쪽

unavailability, disruption or malfunction of the Internet, the World Wide Web or any other electronic network, the Network or any aspect thereof, or any consensus attack, or hack, or denial-of-service or other attack or on the Network or any aspect thereof). It being understood that Epiphyte shall use commercially reasonable efforts, consistent with accepted practices in the industries in which Epiphyte operates, as applicable, to resume performance as soon as reasonably practicable under the circumstances. **Section 7.8 No Waiver.** No failure on the part of any Person to exercise any power, right, privilege or remedy under these Terms, and no delay on the part of any Person in exercising any power, right, privilege or remedy under these Terms, shall operate as a waiver of such power, right, privilege or remedy; and no single or partial exercise of any such power, right, privilege or remedy shall preclude any other or further exercise thereof or of any other power, right, privilege or remedy. No Person shall be deemed to have waived any claim arising out of these Terms, or any power, right, privilege or remedy under these Terms, unless the waiver of such claim, power, right, privilege or remedy is expressly set forth in a written instrument duly executed and delivered on behalf of such Person; and any such waiver shall not be applicable or have any effect except in the specific instance in which it is given. # SDK All notable changes to the SDK NPM package will be documented in this page. # v1.3 #### 1.3.9 (2023-02-01) #### Bug Fixes * Fix issue where gas underestimation issue on source and destination chain #### 1.3.7 (2023-01-30) #### Features * Add support for receiving gas on destination chain * Add option to ignore gas price in executeRoute #### 1.3.5 (2023-01-12) #### Features * Add new parameter to override approval action * Add an option to set prefer dex in getRoute method * Support for EIP1559 type transactions #### Bug Fixes * Handle infinite approval setting in executeRoute method parameter instead of global config #### 1.3.1 (2022-12-13) #### Features * Return time spent related parameter in transaction status response * Add new supported chains #### 1.3.0 (2022-12-08) #### Features * Add new parameter to return USD value in getRoute endpoint response # v1.2 v1.2 Release Notes ### 1.2.0 (2022-11-21) #### Features * Add support for custom contract calls type # API All notable changes to the REST API will be documented in this page. # v1.9 API v1.9 Release Notes #### 1.9.1 (2023-02-12) #### Features * Update axelarjs-sdk to v0.12.4 (Improved gas price estimations) #### 1.9.0 (2023-02-09) #### Features * add Platypus dex support * add Wombat dex support * add Sushiswap router * Increased number of supported tokens on all chains #### Bug Fixes * improved gas calculation logic * slightly increased slippage for stable swaps # v1.8 API v1.8 Release Notes #### 1.8.7 (2023-02-07) #### Features * Increase cache timeout for `/token-price` API endpoint to 180 seconds #### Bug Fixes * Reduce response time for `/route` API endpoint by up to 60% #### 1.8.6 (2023-02-04) #### Bug Fixes * Add support for Curve registry and Ellipsis dex #### 1.8.4 (2023-02-01) #### Features * Enable cache-control on some of endpoints to improve response time #### 1.8.3 (2023-01-30) #### Features * Refactor error messages to make them more human readable #### Bug Fixes * Fix for some scenarios where gas limit calculation is underestimated on source and destination chain #### 1.8.2 (2023-01-28) #### Bug Fixes * Refactor status endpoint to support new Axelarscan API endpoint #### 1.8.1 (2023-01-28) #### Bug Fixes * Add more buffer to gas amount when Polygon is set as destination chain # v1.7 API v1.7 Release Notes #### 1.7.0 (2023-01-27) #### Features * Add support for TraderJoe on Avalanche chain * Support new option to receive gas on destination chain #### Bug Fixes * Fix a bug when sending axlUSDC on cosmos from any EVM chain # v1.6 API v1.6 Release Notes Features * Add new *timeSpent* param to status API response * Support for Binance and Arbitrum Chain support Improvements * update Moonbeam RPC server to improve performance Bug Fixes * corrected token config issues with missing URL * fixed issue with custom contract calls for single call use case # Old v2 Documentation (Deprecated) ## Squid issues Integrator IDs on a limited basis and upon review. Please [submit a partnership request](https://squidrouter.typeform.com/partnerships) to request an integrator ID before building with Squid. ## Squid Functionality The functionality of the Squid boils down to **3 main functionalities**: 1. **Route Requests(Fetching a Route):** Calculating the most optimized path from one asset to another. 2. **Route Execution:** The submission and execution of that path on chain. 3. **Transaction Status:** The validation that the transaction has been completed. There are **3 advanced functionalities** enhance Squid's API capabilities: 1. [**Transaction Hooks**](https://docs.squidrouter.com/) **(Pre/Post):** Allow transactions to be prepended(prehook) or appended(posthook) to asset transfers for a user. Think unstaking then transferring an asset or transferring an asset across chain then staking. 2. [**Boost:** ](/old-v2-documentation-deprecated/key-concepts/boost)Squids novel boost functionality allows cross-chain transactions to be settled in less than 20seconds by using an intent-model, a smart contract overlay which allows a provider to optimistically fulfill a transaction. 3. [**Collecting Fees**](/old-v2-documentation-deprecated/key-concepts/collect-fees-1)**:** Always integrators to collect fees associated with transactions. Note, this function is currently not available for v2 yet. All of the functionalities above are covered in-depth in the [**Key Concepts section.**](/old-v2-documentation-deprecated/key-concepts) ## Quickstart: Ways To Build With Squid {% content-ref url="/pages/k9eMY1byD0x9GcnmlbQ9" %} [API](/old-v2-documentation-deprecated/api) {% endcontent-ref %} {% content-ref url="/pages/P0SxuUfM0kxPWXLgECMw" %} [SDK](/old-v2-documentation-deprecated/sdk) {% endcontent-ref %} {% content-ref url="/pages/thn9ki2hdBw58BlRVxFw" %} [Add A Widget](/old-v2-documentation-deprecated/add-a-widget) {% endcontent-ref %} <figure><img src="https://4247625265-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtXbXyuWIO2PwzNc5Dets%2Fuploads%2FGtxnyxuU8wMVusoqOCZO%2Fimage.png?alt=media&amp;token=6144ad88-c2cb-4109-92cd-be7a874c1d74" alt=""><figcaption></figcaption></figure> # Interchain Token(ITS) Listings ## **What are Interchain Tokens?** Interchain Tokens are ERC-20 tokens that can be made available on multiple blockchains while preserving their native qualities. This allows for seamless management of token features and supply across different chains. These tokens operate on open-source code through smart contracts on public blockchains, secured by a dynamic validator set. ### **Key Features of the Interchain Token Service:** 1. **Preserves Native Token Qualities:** * Interchain Tokens maintain their native characteristics and features across all supported blockchains. 2. **Unified EVM Address:** * Interchain Tokens can have canonical versions on multiple blockchains, all sharing a single EVM address. 3. **Flexible Token Creation:** * Create new Interchain Tokens or upgrade existing ERC-20 tokens to become Interchain Tokens. 4. **Ease of Management:** * Manage token features and supply efficiently across different chains using familiar ERC-20 methods like `send`, `transfer`, and `approve`. ## **Creating and Managing Interchain Tokens:** * **Creating New Interchain Tokens:** * Use the [Interchain Token Portal ](https://interchain.axelar.dev/)to register and create new tokens. * **Upgrading Existing Tokens:** * Upgrade existing ERC-20 tokens to canonical Interchain Tokens, or link tokens deployed on multiple chains. For more detailed guidance on creating and managing Interchain Tokens, visit the [Axelar Documentation](https://docs.axelar.dev/dev/send-tokens/interchain-tokens/intro). # How To List ## **Introduction** This guide will walk you through the process using the Axelar Configs CLI Wizard and allow you to list ## **Summary to List a Token and Interchain Token on Squid** 1. **Access the Interactive Form:** * Run the wizard command to access the interactive form. 2. **Follow the** [**Command Flow**](https://github.com/axelarnetwork/axelar-configs/blob/main/cli/wizard/commands/list-squid-token/README.md)**:** * Follow the prompts and steps as outlined in the command flow to list your token on Squid. ## **Getting Started** Before listing a token, ensure your system meets the minimum runtime requirements: * **git** * **bun >= 1.0** OR **npm** To install bun, run the following command: ```bash bashCopy codecurl -fsSL https://bun.sh/install | bash ``` Once you have bun or nodejs installed, clone the Axelar Configs repository: ```bash bashCopy codegit clone git@github.com:axelarnetwork/axelar-configs.git ``` Navigate into the cloned repository: ```bash bashCopy codecd axelar-configs ``` Install the necessary dependencies: ```bash bashCopy codebun i ``` **Running the Wizard** You can start the wizard using one of the following commands: ```bash bashCopy codebun wizard ``` or ```bash bashCopy codepnpm wizard ``` or ```bash bashCopy codenpm run wizard ``` The wizard currently allows you to: * List an interchain token on Squid * Add a Cosmos/EVM chain config * Add a Cosmos/EVM asset list config ## **List Squid Token Command Flow** The command flow for listing a new interchain token on Squid is as follows: 1. **Prompt for Information:** * The command starts by prompting the user for various details: * It asks if the token has been registered via the ITS portal. * It requests the URL of the token details, including the token address and environment. 2. **Construct API URLs:** * The wizard constructs API URLs to search for the token and fetch its details. 3. **Perform API Requests:** * It performs API requests to search for the token and fetch its details. If the API requests fail, it proceeds with empty data. 4. **Parse Token Details:** * The fetched token details are parsed into an interchain token configuration. 5. **Save Configuration:** * The command asks the user if they want to save the configuration to a local file. * If the user chooses to save, the local token list configuration is updated with the new token. 6. **Check for Existing Token:** * It checks if the token already exists in the token list. If it does, the command exits with an error. 7. **Create a Pull Request:** * If the user opts to create a PR, the wizard performs the following actions: * Creates a new Git branch. * Adds the updated token list configuration to the branch. * Commits the changes. * Pushes the branch to the remote repository. For a detailed command flow and further instructions, refer to the [Axelar Configs CLI Wizard README](https://github.com/axelarnetwork/axelar-configs/blob/main/cli/wizard/commands/list-squid-token/README.md). *** By following these steps and command flow, you can successfully list a new Interchain Token on Squid, ensuring it is integrated and available across multiple blockchains using the Interchain Token Service. For more detailed information and examples, visit the [Axelar Documentation.](https://docs.axelar.dev/dev/send-tokens/interchain-tokens/intro) # Add A Widget Squid's widgets are the easiest way to integrate Squid functionality into the frontend of your app. They are extremely customizable from a theming and functionality point of view. Currently Squid has two widgets that can be integrated into your application via iFrame or React. ## [Explore the Swap Widget Integration](/old-v2-documentation-deprecated/add-a-widget/widget) ## [Explore the Stake Widget Integration](/old-v2-documentation-deprecated/add-a-widget/stake-widget) # Swap widget ### Introduction Squid has a widget for cross-chain swaps and deposits, which can be customised and installed by partners with ease. The widget is a UI component that leverages Squid’s API and SDK, making it easy to implement cross-chain functionality into any front end with minimal dev effort. It’s perfect for projects who are looking to go cross-chain and want to expand to new users across different crypto ecosystems. {% hint style="info" %} 💡 Check out [Squid's Widget Studio](https://widget.squidrouter.com/) to customize and use the widget, live on mainnet. {% endhint %} ### Widget features * Maximum chain and token coverage on all Axelar-supported chains * Speed and security powered by Axelar’s cross-chain architecture * Customize themes to suit any brand * One-click onboarding from EVM chains to the Cosmos * Allow or deny certain exchanges * Pinned tokens that appear at the top of token lists * Custom destination addresses * View a quote without connecting a wallet * Set custom slippage options * Transaction history to view recent sessions <figure><img src="https://4247625265-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtXbXyuWIO2PwzNc5Dets%2Fuploads%2FHGG6kQgMhM6s6x8aR52m%2FScreenshot%202023-05-10%20at%2014.34.09.png?alt=media&amp;token=e9a5eda0-e82e-4f41-9f55-b96e0909b159" alt=""><figcaption></figcaption></figure> ### It comes with complete user docs Squid’s user [documentation](/old-v2-documentation-deprecated/add-a-widget/widget/getting-started) details how to use the widget and details all supported swap and transfer types. If you want to start integrating right away, head to [Getting Started](/old-v2-documentation-deprecated/add-a-widget/widget/getting-started) # Getting Started Supported environments, chains, tokens and wallets ### Environments The widget itself is made with [React](https://reactjs.org/). Which means you can import it as a component on [NextJS](https://nextjs.org/) and other classic react apps (for example create-react-apps). We will roll out support to other frameworks in the future based on their demand. You can also use it as an Iframe. Check out [Iframe Installation](/old-v2-documentation-deprecated/add-a-widget/widget/iframe-installation) for more information. **Currently supported environments:** * React * Next.js ### Examples Example repos for all our supported integrations can be found on [GitHub](https://github.com/0xsquid/widget-integrations). ### Supported chains and tokens For all supported chains and tokens, check out [Broken mention](broken://pages/28KiTP7gRUG2YwHycgQG) ### Supported wallets **EVM:** [MetaMask](https://metamask.io/), [Coinbase Wallet](https://www.coinbase.com/wallet) and [WalletConnect](https://walletconnect.com/). **Cosmos:** [Keplr Wallet](https://www.keplr.app/) and [Leap Wallet](https://www.leapwallet.io/) # Installing the Widget Preparing to integrate the widget into your app If you have any questions along the way, please contact us on our [Discord](https://discord.com/invite/squidrouter) in the ***⛓│developers*****&#x20;channel**. ### Installation {% hint style="info" %} To install the widget you need to register a partner ID with the Squid Team. Squid issues Integrator IDs on a limited basis upon review; please [submit a partnership request](https://squidrouter.typeform.com/partnerships) to acquire one. {% endhint %} Install the Squid Widget npm package: ``` npm i @0xsquid/widget ``` or ``` yarn add @0xsquid/widget ``` > Note: to install the V2 widget, you can install the latest [version](https://www.npmjs.com/package/@0xsquid/widget?activeTab=versions) > > ``` > yarn add @0xsquid/widget@2.0.0-beta.7 > ``` #### Add the widget to a page ```javascript <SquidWidget config={{ integratorId: "<partner-id>", // ... Other config options, such as theme, titles, etc. }} /> ``` ### Further installation guides * If you're not using React, please follow the [Iframe installation guide](/old-v2-documentation-deprecated/add-a-widget/widget/iframe-installation) * If you’re using React, please follow the [React installation guide](/old-v2-documentation-deprecated/add-a-widget/widget/react-installation) * If you're using NextJS, start with the [NextJS installation guide](/old-v2-documentation-deprecated/add-a-widget/widget/nextjs-installation) # React Installation Installing the React component Our full React example can be found [here](https://github.com/0xsquid/widget-integrations/tree/main/packages/cra-app). ### Basic example After installing the npm package as outlined in [Installing the Widget](/old-v2-documentation-deprecated/add-a-widget/widget/installing-the-widget), add the widget into your React app: ```jsx import { SquidWidget } from "@0xsquid/widget"; // ... <SquidWidget config={ companyName:"Squid", slippage:3, // customization config } /> ``` ### Customization If you want to customize the widget, you can use the [Squid Widget Studi](https://widget.squidrouter.com/)[o](https://beta.widget.0xsquid.com/) and copy-paste the config code snippet into your code. Follow the [Customization Guide](/old-v2-documentation-deprecated/add-a-widget/widget/customization-guide) to configure your widget, or check out the[Customization Guide](/old-v2-documentation-deprecated/add-a-widget/widget/customization-guide#full-configuration-example) for an implementation reference. # NextJS Installation Integrating the widget into a NextJS app Our full NextJS example can be found [here](https://github.com/0xsquid/widget-integrations/tree/main/packages/next-app). First, get everything set up as outlined in [Installing the Widget](/old-v2-documentation-deprecated/add-a-widget/widget/installing-the-widget). ### Transpile module Adding the widget in NextJS requires adding the transpile module package. This plugin aims to solve the following challenges: * code transpilation from local packages (think: a monorepo with a `styleguide` package) * code transpilation from NPM modules using ES6 imports (e.g `lodash-es`) #### NextJS >=13.1 If you are using NextJS 13.1 or newer, the `next-transpile-modules` package comes built-in in NextJS, so you just need to add the following in your `next.config.js`: ```javascript const nextConfig = { transpilePackages: ["@0xsquid/widget"] } module.exports = nextConfig ``` #### NextJS <13.1 If you are using a NextJS version older than 13.1, then you need to install the `next-transpile-modules` package. Transpile module installation: ```bash npm i next-transpile-modules ``` or ``` yarn add next-transpile-modules ``` \ Following this, on the `next.config.js` file, add the following to import the widget as a transpiled module: ```javascript const withTM = require("next-transpile-modules")(["@0xsquid/widget"]); const nextConfig = { // Your nextjs config }; module.exports = withTM(nextConfig); ``` Finally, install and configure the widget, as specified in [React Installation](/old-v2-documentation-deprecated/add-a-widget/widget/react-installation) # Iframe Installation Integrating the widget as an Iframe The widget is made as a React component. For now, if you're using another frontend framework (Vue, Angular, etc), you will need to integrate the widget as an iframe. We will roll out support to other frameworks in the future based on their demand. ### **Iframe link** The iframe points to this link: ``` v2.api.squidrouter.com/iframe?config=..... ``` ### Customization You can customize the iframe and grab the link at the [Squid Widget Studio](https://widget.squidrouter.com/). When you're happy with the customization, simply click the "Get iframe" button that will redirect you to a standalone widget page: <img src="https://4247625265-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtXbXyuWIO2PwzNc5Dets%2Fuploads%2F2KRnISdNnGArjhL5FgX8%2Fiframe%20button.png?alt=media&
프로젝트로 돌아가기