如何修复“Buffer is not defined”错误?

如果你在使用 @skip-go/widget 时看到 Buffer is not defined 错误,通常是因为该组件依赖了浏览器环境中不可用的 Node.js 模块。要解决这个问题,你需要为这些模块添加 polyfill。 以下是常见环境可用的一些 polyfill 插件:

是否应该将组件放在一个固定尺寸的容器中?

建议使用一个具有固定尺寸的容器元素来包裹该组件。这样可以减少布局偏移,因为该组件使用了 shadow-dom(需要在客户端渲染)。我们建议高度为 640px、宽度为 500px。

我可以将 Safe Multisig 钱包与 Skip Go 组件一起使用吗?

可以。Safe 钱包(广泛使用的多签钱包,地址为 https://app.safe.global)可以通过支持导入 Safe 钱包的钱包提供方与 Skip Go 组件配合使用:
  • Rabby Wallet:支持导入并使用 Safe 钱包
  • WalletConnect:支持通过 WalletConnect 协议连接 Safe 钱包
这两种方式都允许你通过 Skip Go 组件使用 Safe 钱包进行多链兑换和转账。 重要: 当使用 Safe 钱包进行跨链交易时,请确保你的 Safe 钱包在所有相关目标链上都已完成部署后,再发起转账。Safe 钱包使用确定性地址,但你计划接收资金的每条链上都必须先部署对应的钱包合约。

为什么我会遇到 CORS 错误,或被 CORS 策略拦截?

如果你在使用 Skip Go 组件时看到 CORS 错误,说明你的域名需要加入白名单后才能访问 Skip Go 的 API 端点。 要解决这个问题,请前往我们的 Discord 服务器 提交支持工单,并申请将你的域名加入白名单。

How do I fix the “Buffer is not defined” error?

If you see a ‘Buffer is not defined’ error when using @skip-go/widget, it’s likely because the widget depends on Node.js modules that aren’t available in the browser. To fix this, you’ll need to add polyfills for those modules. Here are some polyfill plugins for common environments:

Should I put the widget inside a container with a fixed size?

It is recommended to wrap the widget with a container element that has a fixed size. This helps to prevent layout shifting as the widget uses the shadow-dom (which needs to be rendered client-side). We recommend a height of 640px and a width of 500px.

Can I use Safe Multisig wallets with the Skip Go widget?

Yes! Safe wallets (the popular multisig wallet at https://app.safe.global) can be used with the Skip Go widget through wallet providers that support importing Safe wallets:
  • Rabby Wallet: Supports importing and using Safe wallets
  • WalletConnect: Supports connecting Safe wallets through WalletConnect protocol
Both options allow you to use your Safe wallet for multi-chain swaps and transfers through the Skip Go widget. Important: When using Safe wallets for cross-chain transactions, ensure that your Safe wallet is deployed on all relevant destination chains before initiating transfers. Safe wallets use deterministic addresses, but the wallet contract must be deployed on each chain where you plan to receive funds.

Why am I getting a CORS error or blocked by CORS policy?

If you’re seeing CORS errors when using the Skip Go widget, it means your domain needs to be whitelisted to access Skip Go’s API endpoints. To resolve this issue, please get your domain whitelisted by submitting a support ticket in our Discord server.