@swapkit/core 1.0.0-rc.110 → 1.0.0-rc.112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -51,7 +51,7 @@ export declare enum ApproveMode {
51
51
  export declare type ApproveReturnType<T extends ApproveMode> = T extends "checkOnly" ? Promise<boolean> : Promise<string>;
52
52
 
53
53
  export declare type AvailableProviders<T> = T | {
54
- [K in ProviderName]?: ProviderMethods;
54
+ [K in PluginName]?: ProviderMethods;
55
55
  };
56
56
 
57
57
  export declare type ChainWallet<T extends Chain> = WalletMethods[T] & {
@@ -105,13 +105,13 @@ export declare type OldWallet = {
105
105
  [key in Chain]: OldChainWallet | null;
106
106
  };
107
107
 
108
+ export declare type PluginName = "thorchain" | "chainflip" | "mayachain";
109
+
108
110
  export declare type ProviderMethods = {
109
111
  swap: (swapParams: SwapParams) => Promise<string>;
110
112
  [key: string]: any;
111
113
  };
112
114
 
113
- export declare type ProviderName = "thorchain" | "chainflip" | "mayachain";
114
-
115
115
  export declare type QuoteRouteV2 = {
116
116
  buyAsset: string;
117
117
  sellAsset: string;
@@ -123,8 +123,8 @@ export declare type QuoteRouteV2 = {
123
123
 
124
124
  export declare type SubstrateBasedWallet<T extends typeof PolkadotToolbox | typeof ChainflipToolbox> = Awaited<ReturnType<T>>;
125
125
 
126
- export declare function SwapKit<ExtendedProviders extends {}, ConnectWalletMethods extends Record<string, ReturnType<SwapKitWallet["connect"]>>>({ stagenet, wallets, providers, config, apis, rpcUrls, }: {
127
- providers: SwapKitProvider[];
126
+ export declare function SwapKit<ExtendedProviders extends {}, ConnectWalletMethods extends Record<string, ReturnType<SwapKitWallet["connect"]>>>({ stagenet, wallets, plugins, config, apis, rpcUrls, }: {
127
+ plugins: SwapKitPlugin[];
128
128
  stagenet: boolean;
129
129
  wallets: SwapKitWallet[];
130
130
  config?: Record<string, any>;
@@ -228,6 +228,9 @@ export declare class SwapKitCore<T = ""> {
228
228
  registerThorname: ({ assetValue, ...param }: ThornameRegisterParam & {
229
229
  assetValue: AssetValue;
230
230
  }) => Promise<string>;
231
+ registerMayaname: ({ assetValue, ...param }: ThornameRegisterParam & {
232
+ assetValue: AssetValue;
233
+ }) => Promise<string>;
231
234
  extend: ({ wallets, config, apis, rpcUrls }: ExtendParams<T>) => void;
232
235
  estimateMaxSendableAmount: ({ chain, params, }: {
233
236
  chain: Chain;
@@ -252,19 +255,19 @@ export declare class SwapKitCore<T = ""> {
252
255
  disconnectChain: (chain: Chain) => void;
253
256
  }
254
257
 
255
- export declare type SwapKitProvider = ({ wallets, stagenet }: {
258
+ export declare type SwapKitPlugin = ({ wallets, stagenet }: {
256
259
  wallets: Wallets;
257
260
  stagenet?: boolean;
258
261
  }) => {
259
- name: ProviderName;
262
+ name: PluginName;
260
263
  methods: ProviderMethods;
261
264
  };
262
265
 
263
- declare type SwapKitProviders = {
264
- [K in ProviderName]?: ProviderMethods;
266
+ declare type SwapKitPlugins = {
267
+ [K in PluginName]?: ProviderMethods;
265
268
  };
266
269
 
267
- export declare type SwapKitReturnType = SwapKitProviders & {
270
+ export declare type SwapKitReturnType = SwapKitPlugins & {
268
271
  getAddress: (chain: Chain) => string;
269
272
  getWallet: (chain: Chain) => ChainWallet<Chain> | undefined;
270
273
  getWalletWithBalance: (chain: Chain, potentialScamFilter?: boolean) => Promise<ChainWallet<Chain>>;
@@ -287,7 +290,7 @@ export declare type SwapKitWallet = {
287
290
 
288
291
  export declare type SwapParams = (SwapWithRouteParams | GenericSwapParams) & {
289
292
  provider?: {
290
- name: ProviderName;
293
+ name: PluginName;
291
294
  config: Record<string, any>;
292
295
  };
293
296
  };