sushi 5.0.1 → 5.0.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # sushi
2
2
 
3
+ ## 5.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#85](https://github.com/sushi-labs/sushi/pull/85) [`1fbfa93`](https://github.com/sushi-labs/sushi/commit/1fbfa93dfecb5cb57b90ac8691fefd1f519c0673) Thanks [@LufyCZ](https://github.com/LufyCZ)! - Add isChainId
8
+
3
9
  ## 5.0.1
4
10
 
5
11
  ### Patch Changes
package/_cjs/chain/id.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ChainId = void 0;
3
+ exports.isChainId = exports.ChainId = void 0;
4
4
  const id_js_1 = require("./evm/id.js");
5
5
  const id_js_2 = require("./non-evm/aptos/id.js");
6
6
  const id_js_3 = require("./non-evm/tron/id.js");
@@ -9,4 +9,6 @@ exports.ChainId = {
9
9
  ...id_js_2.AptosChainId,
10
10
  ...id_js_3.TronChainId,
11
11
  };
12
+ const isChainId = (chainId) => Object.values(exports.ChainId).includes(chainId);
13
+ exports.isChainId = isChainId;
12
14
  //# sourceMappingURL=id.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"id.js","sourceRoot":"","sources":["../../chain/id.ts"],"names":[],"mappings":";;;AAAA,uCAAwC;AACxC,iDAAoD;AACpD,gDAAkD;AAErC,QAAA,OAAO,GAAG;IACrB,GAAG,kBAAU;IACb,GAAG,oBAAY;IACf,GAAG,mBAAW;CACN,CAAA"}
1
+ {"version":3,"file":"id.js","sourceRoot":"","sources":["../../chain/id.ts"],"names":[],"mappings":";;;AAAA,uCAAwC;AACxC,iDAAoD;AACpD,gDAAkD;AAErC,QAAA,OAAO,GAAG;IACrB,GAAG,kBAAU;IACb,GAAG,oBAAY;IACf,GAAG,mBAAW;CACN,CAAA;AAIH,MAAM,SAAS,GAAG,CAAC,OAAe,EAAsB,EAAE,CAC/D,MAAM,CAAC,MAAM,CAAC,eAAO,CAAC,CAAC,QAAQ,CAAC,OAAkB,CAAC,CAAA;AADxC,QAAA,SAAS,aAC+B"}
package/_esm/chain/id.js CHANGED
@@ -6,4 +6,5 @@ export const ChainId = {
6
6
  ...AptosChainId,
7
7
  ...TronChainId,
8
8
  };
9
+ export const isChainId = (chainId) => Object.values(ChainId).includes(chainId);
9
10
  //# sourceMappingURL=id.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"id.js","sourceRoot":"","sources":["../../chain/id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAElD,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,GAAG,UAAU;IACb,GAAG,YAAY;IACf,GAAG,WAAW;CACN,CAAA"}
1
+ {"version":3,"file":"id.js","sourceRoot":"","sources":["../../chain/id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAElD,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,GAAG,UAAU;IACb,GAAG,YAAY;IACf,GAAG,WAAW;CACN,CAAA;AAIV,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,OAAe,EAAsB,EAAE,CAC/D,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,OAAkB,CAAC,CAAA"}
@@ -57,4 +57,5 @@ export declare const ChainId: {
57
57
  readonly HEMI: 43111;
58
58
  };
59
59
  export type ChainId = (typeof ChainId)[keyof typeof ChainId];
60
+ export declare const isChainId: (chainId: number) => chainId is ChainId;
60
61
  //# sourceMappingURL=id.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../chain/id.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIV,CAAA;AAEV,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAA"}
1
+ {"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../chain/id.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIV,CAAA;AAEV,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAA;AAE5D,eAAO,MAAM,SAAS,YAAa,MAAM,KAAG,OAAO,IAAI,OACF,CAAA"}
package/chain/id.ts CHANGED
@@ -9,3 +9,6 @@ export const ChainId = {
9
9
  } as const
10
10
 
11
11
  export type ChainId = (typeof ChainId)[keyof typeof ChainId]
12
+
13
+ export const isChainId = (chainId: number): chainId is ChainId =>
14
+ Object.values(ChainId).includes(chainId as ChainId)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sushi",
3
3
  "description": "Sushi",
4
- "version": "5.0.1",
4
+ "version": "5.0.2",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
7
7
  "types": "./_types/index.d.ts",