Skip Router SDK(@skip-router/core)和 Skip Go Core(@skip-go/core) 均已弃用。请迁移到 Skip Go Client(@skip-go/client),这是我们当前积极维护的客户端包。
@skip-go/client v1.0.0

重大变更

本节介绍如何从旧版本迁移到最新的 @skip-go/client。

不再提供 SkipClient 类

SkipClient 类已被移除。请改为直接导入并使用各个独立函数:
Example import
import {
  assets,
  assetsBetweenChains,
  assetsFromSource,
  recommendAssets,
  bridges,
  balances,
  chains,
  venues,
  ibcOriginAssets,
  route,
  messages,
  messagesDirect,
  submitTransaction,
  trackTransaction,
  transactionStatus,
  executeRoute,
  setClientOptions,
  setApiOptions,
} from '@skip-go/client';

初始化变更

如果不使用 executeRoute:
  • 在初始化时调用一次 setApiOptions({ apiUrl, apiKey })。
  • 或者,在每次单独调用 API 函数时传入 apiUrl 和 apiKey 参数。
如果使用 executeRoute:
  • 使用与之前传给 SkipClient 构造函数相同的 options 对象调用 setClientOptions()。
  • 例外: getCosmosSigner、getEVMSigner 和 getSVMSigner 已从 setClientOptions 中移除。这些 signer 函数现在会在需要时直接传给 executeRoute。
  • 重命名: getEVMSigner 现已更名为 getEvmSigner,getSVMSigner 现已更名为 getSvmSigner。
Example migration
- const client = new SkipClient(options);
+ setClientOptions(options); // Only if using executeRoute

- client.chains();
+ chains(); // Assuming apiUrl/apiKey were set via setApiOptions or passed in

构建格式变更

该库的构建格式已从 CommonJS (CJS) 变更为 ES Modules (ESM)。此变更可带来更好的 tree-shaking 效果,从而显著减小那些不会使用该库全部功能的应用的 bundle 体积。
如果你不使用 executeRoute,并且打包器启用了 tree-shaking,那么最终 bundle 体积应会大幅下降(例如,单个 API 函数的使用场景可能会从约 5MB 降到约 7KB)。

已移除 Axios

axios 不再是依赖项。现在所有 API 调用在内部都使用标准的 window.fetch API。

CamelCase 更新

API 响应和配置对象中的所有属性名现在都严格遵循 camelCase。示例:
之前之后
chainIDchainId
apiURLapiUrl
logoURIlogoUri
asset.isCW20asset.isCw20

API 函数强制使用命名参数

部分方法现在要求使用命名参数或 options 对象,而不是位置参数:

recommendAssets

旧写法:
await client.recommendAssets(request);
// OR
await client.recommendAssets([request1, request2]);
新写法:
await recommendAssets({ requests: [request1, request2] });
请将数组包装在 { requests: [...] } 对象中。

ibcOriginAssets

旧写法:
await client.ibcOriginAssets(assets);
新写法:
await ibcOriginAssets({ assets: [asset1, asset2] });
请将资产数组包装在 { assets: [...] } 对象中。

getFeeInfoForChain

getFeeInfoForChain 的参数现在应以对象形式传递。旧写法:
await client.getFeeInfoForChain(chainID);
新写法:
import { getFeeInfoForChain } from '@skip-go/client'; // Assuming setApiOptions was called

await getFeeInfoForChain({ chainId: chainID });
// Or, if not using setApiOptions globally for apiUrl/apiKey:
// await getFeeInfoForChain({ chainId: chainID, apiUrl: YOUR_API_URL, apiKey: YOUR_API_KEY });

getRecommendedGasPrice

getRecommendedGasPrice 的参数现在应以对象形式传递。旧写法:
await client.getRecommendedGasPrice(chainID);
新写法:
import { getRecommendedGasPrice } from '@skip-go/client'; // Assuming setApiOptions was called

await getRecommendedGasPrice({ chainId: chainID });
// Or, if not using setApiOptions globally for apiUrl/apiKey:
// await getRecommendedGasPrice({ chainId: chainID, apiUrl: YOUR_API_URL, apiKey: YOUR_API_KEY });

已移除内部函数

以下这些此前导出的函数在 v1.0.0 中已不可用。它们属于内部函数,并不打算供集成方直接使用,因为它们由 executeRoute 在内部使用:
  • executeTxs
  • executeEvmMsg (merged with executeEvmTransaction)
  • executeCosmosMessage (merged with executeCosmosTransaction)
  • executeEVMTransaction
  • executeSVMTransaction
  • signCosmosMessageDirect
  • signCosmosMessageAmino
  • getRpcEndpointForChain
  • getRestEndpointForChain
  • validateGasBalances
  • validateEvmGasBalance
  • validateEvmTokenApproval
  • validateSvmGasBalance
  • validateUserAddresses
  • getMainnetAndTestnetChains
  • getMainnetAndTestnetAssets
  • getAccountNumberAndSequence
如果你的应用之前直接使用了这些函数,建议改用 executeRoute,它会在内部处理所有交易执行流程。如果你的特定用例确实需要访问其中某些函数,请在我们的 Discord 上提交工单。
@skip-router/core v4.0.0

重大变更

  • 在 SkipClient 中移除了 clientID 参数
  • 在 SkipClient 中新增了 apiKey 参数
  • 在 SkipClient.route 响应中新增了 requiredChainAddresses
  • 在 SkipClient.route 请求中新增了 smartSwapOptions
Type signature
smartSwapOptions: {
	splitRoutes: boolean
}
@skip-router/core v3.0.0

重大变更

  • 将 userAddresses 的参数类型从 chainID 到 address 的映射改为 UserAddress 类型数组
Type signature
export interface UserAddress {
  chainID: string;
  address: string;
}
@skip-router/core v2.0.0

重大变更

  • 移除了 SkipClient.executeMultiChainMessage 方法
  • 将 SkipClient.getGasAmountForMessage 方法重命名为 SkipClient.getCosmosGasAmountForMessage
  • 将 SkipClient.getFeeForMessage 重命名为 SkipClient.getCosmosFeeForMe
  • 将 MultiChainMsg 类型重命名为 CosmosMsg
  • 将 SkipClient.executeMultiChainMsgs 重命名为 SkipClient.executeTxs,并修改了其参数
Diff
const client = new SkipClient({
  apiURL: SKIP_API_URL,
// ... rest of your configs
});
- client.executeMultiChainMsgs({
+ client.executeTxs({
	...options
-	msgs: types.Msg[]
+	txs: types.Tx[]
})
  • SkipClient.executeCosmosMessage 的参数已从 message:MultiChainMsg 改为 messages: CosmosMsg[]
Diff
const client = new SkipClient({
  apiURL: SKIP_API_URL,
// ... rest of your configs
});
client.executeCosmosMessage({
	...options
-	message: MultiChainMsg
+	messages: CosmosMsg[]
})

Both the Skip Router SDK (@skip-router/core) and Skip Go Core (@skip-go/core) are deprecated. Please migrate to Skip Go Client (@skip-go/client), our actively maintained client package.
@skip-go/client v1.0.0

Breaking changes

This section details the migration from previous versions to the latest @skip-go/client.

No More SkipClient Class

The SkipClient class has been removed. Instead, import and use individual functions directly:
Example import
import {
  assets,
  assetsBetweenChains,
  assetsFromSource,
  recommendAssets,
  bridges,
  balances,
  chains,
  venues,
  ibcOriginAssets,
  route,
  messages,
  messagesDirect,
  submitTransaction,
  trackTransaction,
  transactionStatus,
  executeRoute,
  setClientOptions,
  setApiOptions,
} from '@skip-go/client';

Initialization Changes

If not using executeRoute:
  • Call setApiOptions({ apiUrl, apiKey }) once at initialization.
  • Alternatively, pass apiUrl and apiKey as arguments to each individual API function call.
If using executeRoute:
  • Call setClientOptions() with the same options object previously passed to the SkipClient constructor.
  • Exception: getCosmosSigner, getEVMSigner, and getSVMSigner have been removed from setClientOptions. These signer functions are now passed directly to executeRoute when needed.
  • Renamed: getEVMSigner is now getEvmSigner, and getSVMSigner is now getSvmSigner.
Example migration
- const client = new SkipClient(options);
+ setClientOptions(options); // Only if using executeRoute

- client.chains();
+ chains(); // Assuming apiUrl/apiKey were set via setApiOptions or passed in

Build Format Change

The library build format has changed from CommonJS (CJS) to ES Modules (ESM).This change enables better tree-shaking, leading to significantly smaller bundle sizes for applications that don’t use all the library’s features.
If you’re not using executeRoute, your final bundle size should decrease dramatically (e.g., from ~5MB to potentially ~7KB for a single API function usage), assuming tree-shaking is enabled in your bundler.

Axios Removed

axios is no longer a dependency. All API calls now utilize the standard window.fetch API internally.

CamelCase Update

All property names in API responses and configuration objects now strictly adhere to camelCase.Examples:
BeforeAfter
chainIDchainId
apiURLapiUrl
logoURIlogoUri
asset.isCW20asset.isCw20

Named parameter enforcement for API functions

Some methods now require named parameters or an options object instead of positional arguments:

recommendAssets

Old:
await client.recommendAssets(request);
// OR
await client.recommendAssets([request1, request2]);
New:
await recommendAssets({ requests: [request1, request2] });
Wrap the array in a { requests: [...] } object.

ibcOriginAssets

Old:
await client.ibcOriginAssets(assets);
New:
await ibcOriginAssets({ assets: [asset1, asset2] });
Wrap the assets array in a { assets: [...] } object.

getFeeInfoForChain

Parameters for getFeeInfoForChain should now be passed as an object.Old:
await client.getFeeInfoForChain(chainID);
New:
import { getFeeInfoForChain } from '@skip-go/client'; // Assuming setApiOptions was called

await getFeeInfoForChain({ chainId: chainID });
// Or, if not using setApiOptions globally for apiUrl/apiKey:
// await getFeeInfoForChain({ chainId: chainID, apiUrl: YOUR_API_URL, apiKey: YOUR_API_KEY });

getRecommendedGasPrice

Parameters for getRecommendedGasPrice should now be passed as an object.Old:
await client.getRecommendedGasPrice(chainID);
New:
import { getRecommendedGasPrice } from '@skip-go/client'; // Assuming setApiOptions was called

await getRecommendedGasPrice({ chainId: chainID });
// Or, if not using setApiOptions globally for apiUrl/apiKey:
// await getRecommendedGasPrice({ chainId: chainID, apiUrl: YOUR_API_URL, apiKey: YOUR_API_KEY });

Removed Internal Functions

The following functions that were previously exported are no longer available in v1.0.0. These were internal functions that were not intended for direct use by integrators, as they are used internally by executeRoute:
  • executeTxs
  • executeEvmMsg (merged with executeEvmTransaction)
  • executeCosmosMessage (merged with executeCosmosTransaction)
  • executeEVMTransaction
  • executeSVMTransaction
  • signCosmosMessageDirect
  • signCosmosMessageAmino
  • getRpcEndpointForChain
  • getRestEndpointForChain
  • validateGasBalances
  • validateEvmGasBalance
  • validateEvmTokenApproval
  • validateSvmGasBalance
  • validateUserAddresses
  • getMainnetAndTestnetChains
  • getMainnetAndTestnetAssets
  • getAccountNumberAndSequence
If your application was using any of these functions directly, consider using executeRoute instead, which handles all transaction execution internally. If you have a specific use case that requires access to any of these functions, please open a ticket on our Discord.
@skip-router/core v4.0.0

Breaking changes

  • Removed clientID param in SkipClient
  • Added apiKey param in SkipClient
  • Added requiredChainAddresses in SkipClient.route response
  • Added smartSwapOptions in SkipClient.routerequest
Type signature
smartSwapOptions: {
	splitRoutes: boolean
}
@skip-router/core v3.0.0

Breaking changes

  • Changed parameter type of userAddresses from a map of chainIDs to addresses to an array of UserAddress types
Type signature
export interface UserAddress {
  chainID: string;
  address: string;
}
@skip-router/core v2.0.0

Breaking changes

  • Removed SkipClient.executeMultiChainMessage method
  • Renamed SkipClient.getGasAmountForMessage method to SkipClient.getCosmosGasAmountForMessage
  • Renamed SkipClient.getFeeForMessage to SkipClient.getCosmosFeeForMe
  • Renamed MultiChainMsg type to CosmosMsg
  • Renamed and changed parameters of SkipClient.executeMultiChainMsgs to SkipClient.executeTxs
Diff
const client = new SkipClient({
  apiURL: SKIP_API_URL,
// ... rest of your configs
});
- client.executeMultiChainMsgs({
+ client.executeTxs({
	...options
-	msgs: types.Msg[]
+	txs: types.Tx[]
})
  • Param of SkipClient.executeCosmosMessage changed from message:MultiChainMsg to messages: CosmosMsg[]
Diff
const client = new SkipClient({
  apiURL: SKIP_API_URL,
// ... rest of your configs
});
client.executeCosmosMessage({
	...options
-	message: MultiChainMsg
+	messages: CosmosMsg[]
})