@swapkit/helpers 1.0.0-rc.104 → 1.0.0-rc.106

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/package.json CHANGED
@@ -38,5 +38,5 @@
38
38
  },
39
39
  "type": "module",
40
40
  "types": "./src/index.ts",
41
- "version": "1.0.0-rc.104"
41
+ "version": "1.0.0-rc.106"
42
42
  }
@@ -1,3 +1,4 @@
1
+ import { AssetValue } from "../modules/assetValue.ts";
1
2
  import { RequestClient } from "../modules/requestClient.ts";
2
3
  import { BaseDecimal, Chain, ChainToRPC, type EVMChain, EVMChains } from "../types/chains.ts";
3
4
  import type { TokenNames } from "../types/tokens.ts";
@@ -72,6 +73,25 @@ export const getDecimal = ({ chain, symbol }: { chain: Chain; symbol: string })
72
73
  }
73
74
  };
74
75
 
76
+ export const getGasAsset = ({ chain }: { chain: Chain }) => {
77
+ switch (chain) {
78
+ case Chain.Arbitrum:
79
+ case Chain.Optimism:
80
+ return AssetValue.fromStringSync(`${chain}.ETH`);
81
+ case Chain.Maya:
82
+ return AssetValue.fromStringSync(`${chain}.CACAO`);
83
+ case Chain.Cosmos:
84
+ return AssetValue.fromStringSync(`${chain}.ATOM`);
85
+ case Chain.BinanceSmartChain:
86
+ return AssetValue.fromStringSync(`${chain}.BNB`);
87
+ case Chain.THORChain:
88
+ return AssetValue.fromStringSync(`${chain}.RUNE`);
89
+
90
+ default:
91
+ return AssetValue.fromStringSync(`${chain}.${chain}`);
92
+ }
93
+ };
94
+
75
95
  export const isGasAsset = ({ chain, symbol }: { chain: Chain; symbol: string }) => {
76
96
  switch (chain) {
77
97
  case Chain.Arbitrum:
@@ -79,12 +99,8 @@ export const isGasAsset = ({ chain, symbol }: { chain: Chain; symbol: string })
79
99
  return symbol === "ETH";
80
100
  case Chain.Maya:
81
101
  return symbol === "CACAO";
82
- case Chain.Kujira:
83
- return symbol === "KUJI";
84
102
  case Chain.Cosmos:
85
103
  return symbol === "ATOM";
86
- case Chain.Polygon:
87
- return symbol === "MATIC";
88
104
  case Chain.BinanceSmartChain:
89
105
  return symbol === "BNB";
90
106
  case Chain.THORChain:
@@ -47,8 +47,6 @@ export type BaseWallet<T extends EmptyWallet | unknown> = {
47
47
  [key in Chain]: ChainWallet & T[key];
48
48
  };
49
49
 
50
- export type Wallet<T> = BaseWallet<T>;
51
-
52
50
  export type EIP6963ProviderInfo = {
53
51
  walletId: string;
54
52
  uuid: string;