@reyaxyz/common 0.259.0 → 0.260.0

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/README.md CHANGED
@@ -6,5 +6,5 @@
6
6
 
7
7
  | Statements | Branches | Functions | Lines |
8
8
  | --------------------------- | ----------------------- | ------------------------- | ----------------- |
9
- | ![Statements](https://img.shields.io/badge/statements-17.35%25-red.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-13.46%25-red.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-8.53%25-red.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-18.51%25-red.svg?style=flat) |
9
+ | ![Statements](https://img.shields.io/badge/statements-17.42%25-red.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-13.35%25-red.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-8.53%25-red.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-18.61%25-red.svg?style=flat) |
10
10
 
@@ -2,7 +2,8 @@
2
2
  import { BigNumberish } from 'ethers';
3
3
  import { ReyaChainId } from '../types';
4
4
  export declare const SBT_ROOT: Record<ReyaChainId, string>;
5
- export declare const getSbtRoot: (reyaChainId: ReyaChainId) => string;
5
+ export declare const SBT_ROOT_EXTRA_OGS: Record<ReyaChainId, string>;
6
+ export declare const getSbtRoot: (reyaChainId: ReyaChainId, isSpecialRoot: boolean) => string;
6
7
  export declare const SBT_MINT_DEADLINE = 1743508800;
7
8
  export type SbtLeafInfo = {
8
9
  account: string;
@@ -1 +1 @@
1
- {"version":3,"file":"sbt-helpers.d.ts","sourceRoot":"/","sources":["utils/sbt-helpers.ts"],"names":[],"mappings":";AAAA,OAAO,EAAU,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAKhD,CAAC;AAEF,eAAO,MAAM,UAAU,gBAAiB,WAAW,WAElD,CAAC;AAEF,eAAO,MAAM,iBAAiB,aAAa,CAAC;AAE5C,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,OAAO,YAAa,MAAM,oBAAoB,MAAM,KAAG,MAQnE,CAAC;AAEF,eAAO,MAAM,aAAa,YACf,MAAM,cACH,MAAM,oBACA,MAAM,KACvB,YASF,CAAC"}
1
+ {"version":3,"file":"sbt-helpers.d.ts","sourceRoot":"/","sources":["utils/sbt-helpers.ts"],"names":[],"mappings":";AAAA,OAAO,EAAU,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAKhD,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAK1D,CAAC;AAEF,eAAO,MAAM,UAAU,gBACR,WAAW,iBACT,OAAO,WAKvB,CAAC;AAEF,eAAO,MAAM,iBAAiB,aAAa,CAAC;AAE5C,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,OAAO,YAAa,MAAM,oBAAoB,MAAM,KAAG,MAQnE,CAAC;AAEF,eAAO,MAAM,aAAa,YACf,MAAM,cACH,MAAM,oBACA,MAAM,KACvB,YASF,CAAC"}
@@ -1,15 +1,21 @@
1
1
  "use strict";
2
- var _a;
2
+ var _a, _b;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.getSbtTokenId = exports.getLeaf = exports.SBT_MINT_DEADLINE = exports.getSbtRoot = exports.SBT_ROOT = void 0;
4
+ exports.getSbtTokenId = exports.getLeaf = exports.SBT_MINT_DEADLINE = exports.getSbtRoot = exports.SBT_ROOT_EXTRA_OGS = exports.SBT_ROOT = void 0;
5
5
  var ethers_1 = require("ethers");
6
6
  var types_1 = require("../types");
7
7
  exports.SBT_ROOT = (_a = {},
8
8
  _a[types_1.ReyaChainId.reyaNetwork] = '0x7d8254a884c4e1e8040d592fdbe3ce8986fb6c5c4f7dee3ce7b7f823fa127c52',
9
9
  _a[types_1.ReyaChainId.reyaCronos] = '0x01f4d29a3aca5cb40663851d2d40d605636dd6448f251d77765dd0e40c422136',
10
10
  _a);
11
- var getSbtRoot = function (reyaChainId) {
12
- return exports.SBT_ROOT[reyaChainId];
11
+ exports.SBT_ROOT_EXTRA_OGS = (_b = {},
12
+ _b[types_1.ReyaChainId.reyaNetwork] = '0x4befffbb84f3dc33b939b6a92600404ba3cc67a120549423864b6127772cedd7',
13
+ _b[types_1.ReyaChainId.reyaCronos] = '0x0b994b1d87eb7ee0090dcab536da2c603e37cfbcba5e7fe0602f6c3cc201c918',
14
+ _b);
15
+ var getSbtRoot = function (reyaChainId, isSpecialRoot) {
16
+ return isSpecialRoot
17
+ ? exports.SBT_ROOT_EXTRA_OGS[reyaChainId]
18
+ : exports.SBT_ROOT[reyaChainId];
13
19
  };
14
20
  exports.getSbtRoot = getSbtRoot;
15
21
  exports.SBT_MINT_DEADLINE = 1743508800; // Tue Apr 01 2025 12:00:00 GMT+0000
@@ -1 +1 @@
1
- {"version":3,"file":"sbt-helpers.js","sourceRoot":"/","sources":["utils/sbt-helpers.ts"],"names":[],"mappings":";;;;AAAA,iCAA8C;AAC9C,kCAAuC;AAE1B,QAAA,QAAQ;IACnB,GAAC,mBAAW,CAAC,WAAW,IACtB,oEAAoE;IACtE,GAAC,mBAAW,CAAC,UAAU,IACrB,oEAAoE;QACtE;AAEK,IAAM,UAAU,GAAG,UAAC,WAAwB;IACjD,OAAO,gBAAQ,CAAC,WAAW,CAAC,CAAC;AAC/B,CAAC,CAAC;AAFW,QAAA,UAAU,cAErB;AAEW,QAAA,iBAAiB,GAAG,UAAU,CAAC,CAAC,oCAAoC;AAO1E,IAAM,OAAO,GAAG,UAAC,OAAe,EAAE,gBAAwB;IAC/D,IAAM,WAAW,GAAG,eAAM,CAAC,SAAS,CAClC,eAAM,CAAC,cAAc,CACnB,CAAC,SAAS,EAAE,SAAS,CAAC,EACtB,CAAC,OAAO,EAAE,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CACvC,CACF,CAAC;IACF,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC,CAAC;AARW,QAAA,OAAO,WAQlB;AAEK,IAAM,aAAa,GAAG,UAC3B,OAAe,EACf,UAAkB,EAClB,gBAAwB;IAExB,OAAO,eAAM,CAAC,QAAQ,CACpB,eAAM,CAAC,SAAS,CACd,eAAM,CAAC,cAAc,CACnB,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,EACjC,CAAC,OAAO,EAAE,UAAU,EAAE,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CACnD,CACF,CACF,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,aAAa,iBAaxB","sourcesContent":["import { ethers, BigNumberish } from 'ethers';\nimport { ReyaChainId } from '../types';\n\nexport const SBT_ROOT: Record<ReyaChainId, string> = {\n [ReyaChainId.reyaNetwork]:\n '0x7d8254a884c4e1e8040d592fdbe3ce8986fb6c5c4f7dee3ce7b7f823fa127c52',\n [ReyaChainId.reyaCronos]:\n '0x01f4d29a3aca5cb40663851d2d40d605636dd6448f251d77765dd0e40c422136',\n};\n\nexport const getSbtRoot = (reyaChainId: ReyaChainId) => {\n return SBT_ROOT[reyaChainId];\n};\n\nexport const SBT_MINT_DEADLINE = 1743508800; // Tue Apr 01 2025 12:00:00 GMT+0000\n\nexport type SbtLeafInfo = {\n account: string;\n tokenRootCounter: number;\n};\n\nexport const getLeaf = (address: string, tokenRootCounter: number): Buffer => {\n const messageHash = ethers.keccak256(\n ethers.solidityPacked(\n ['address', 'uint256'],\n [address, tokenRootCounter.toString()],\n ),\n );\n return Buffer.from(messageHash.slice(2), 'hex');\n};\n\nexport const getSbtTokenId = (\n account: string,\n merkleRoot: string,\n tokenRootCounter: number,\n): BigNumberish => {\n return ethers.toBigInt(\n ethers.keccak256(\n ethers.solidityPacked(\n ['address', 'bytes32', 'uint256'],\n [account, merkleRoot, tokenRootCounter.toString()],\n ),\n ),\n );\n};\n"]}
1
+ {"version":3,"file":"sbt-helpers.js","sourceRoot":"/","sources":["utils/sbt-helpers.ts"],"names":[],"mappings":";;;;AAAA,iCAA8C;AAC9C,kCAAuC;AAE1B,QAAA,QAAQ;IACnB,GAAC,mBAAW,CAAC,WAAW,IACtB,oEAAoE;IACtE,GAAC,mBAAW,CAAC,UAAU,IACrB,oEAAoE;QACtE;AAEW,QAAA,kBAAkB;IAC7B,GAAC,mBAAW,CAAC,WAAW,IACtB,oEAAoE;IACtE,GAAC,mBAAW,CAAC,UAAU,IACrB,oEAAoE;QACtE;AAEK,IAAM,UAAU,GAAG,UACxB,WAAwB,EACxB,aAAsB;IAEtB,OAAO,aAAa;QAClB,CAAC,CAAC,0BAAkB,CAAC,WAAW,CAAC;QACjC,CAAC,CAAC,gBAAQ,CAAC,WAAW,CAAC,CAAC;AAC5B,CAAC,CAAC;AAPW,QAAA,UAAU,cAOrB;AAEW,QAAA,iBAAiB,GAAG,UAAU,CAAC,CAAC,oCAAoC;AAO1E,IAAM,OAAO,GAAG,UAAC,OAAe,EAAE,gBAAwB;IAC/D,IAAM,WAAW,GAAG,eAAM,CAAC,SAAS,CAClC,eAAM,CAAC,cAAc,CACnB,CAAC,SAAS,EAAE,SAAS,CAAC,EACtB,CAAC,OAAO,EAAE,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CACvC,CACF,CAAC;IACF,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC,CAAC;AARW,QAAA,OAAO,WAQlB;AAEK,IAAM,aAAa,GAAG,UAC3B,OAAe,EACf,UAAkB,EAClB,gBAAwB;IAExB,OAAO,eAAM,CAAC,QAAQ,CACpB,eAAM,CAAC,SAAS,CACd,eAAM,CAAC,cAAc,CACnB,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,EACjC,CAAC,OAAO,EAAE,UAAU,EAAE,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CACnD,CACF,CACF,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,aAAa,iBAaxB","sourcesContent":["import { ethers, BigNumberish } from 'ethers';\nimport { ReyaChainId } from '../types';\n\nexport const SBT_ROOT: Record<ReyaChainId, string> = {\n [ReyaChainId.reyaNetwork]:\n '0x7d8254a884c4e1e8040d592fdbe3ce8986fb6c5c4f7dee3ce7b7f823fa127c52',\n [ReyaChainId.reyaCronos]:\n '0x01f4d29a3aca5cb40663851d2d40d605636dd6448f251d77765dd0e40c422136',\n};\n\nexport const SBT_ROOT_EXTRA_OGS: Record<ReyaChainId, string> = {\n [ReyaChainId.reyaNetwork]:\n '0x4befffbb84f3dc33b939b6a92600404ba3cc67a120549423864b6127772cedd7',\n [ReyaChainId.reyaCronos]:\n '0x0b994b1d87eb7ee0090dcab536da2c603e37cfbcba5e7fe0602f6c3cc201c918',\n};\n\nexport const getSbtRoot = (\n reyaChainId: ReyaChainId,\n isSpecialRoot: boolean,\n) => {\n return isSpecialRoot\n ? SBT_ROOT_EXTRA_OGS[reyaChainId]\n : SBT_ROOT[reyaChainId];\n};\n\nexport const SBT_MINT_DEADLINE = 1743508800; // Tue Apr 01 2025 12:00:00 GMT+0000\n\nexport type SbtLeafInfo = {\n account: string;\n tokenRootCounter: number;\n};\n\nexport const getLeaf = (address: string, tokenRootCounter: number): Buffer => {\n const messageHash = ethers.keccak256(\n ethers.solidityPacked(\n ['address', 'uint256'],\n [address, tokenRootCounter.toString()],\n ),\n );\n return Buffer.from(messageHash.slice(2), 'hex');\n};\n\nexport const getSbtTokenId = (\n account: string,\n merkleRoot: string,\n tokenRootCounter: number,\n): BigNumberish => {\n return ethers.toBigInt(\n ethers.keccak256(\n ethers.solidityPacked(\n ['address', 'bytes32', 'uint256'],\n [account, merkleRoot, tokenRootCounter.toString()],\n ),\n ),\n );\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reyaxyz/common",
3
- "version": "0.259.0",
3
+ "version": "0.260.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -44,5 +44,5 @@
44
44
  "generate:coverage-badges": "npx istanbul-badges-readme --silent"
45
45
  },
46
46
  "packageManager": "pnpm@8.3.1",
47
- "gitHead": "bd5333c330086f71f69d2fdaad5463c5868efbd6"
47
+ "gitHead": "ae08cbb9d37ec11403c56a699824aeb4e12febb5"
48
48
  }
@@ -8,8 +8,20 @@ export const SBT_ROOT: Record<ReyaChainId, string> = {
8
8
  '0x01f4d29a3aca5cb40663851d2d40d605636dd6448f251d77765dd0e40c422136',
9
9
  };
10
10
 
11
- export const getSbtRoot = (reyaChainId: ReyaChainId) => {
12
- return SBT_ROOT[reyaChainId];
11
+ export const SBT_ROOT_EXTRA_OGS: Record<ReyaChainId, string> = {
12
+ [ReyaChainId.reyaNetwork]:
13
+ '0x4befffbb84f3dc33b939b6a92600404ba3cc67a120549423864b6127772cedd7',
14
+ [ReyaChainId.reyaCronos]:
15
+ '0x0b994b1d87eb7ee0090dcab536da2c603e37cfbcba5e7fe0602f6c3cc201c918',
16
+ };
17
+
18
+ export const getSbtRoot = (
19
+ reyaChainId: ReyaChainId,
20
+ isSpecialRoot: boolean,
21
+ ) => {
22
+ return isSpecialRoot
23
+ ? SBT_ROOT_EXTRA_OGS[reyaChainId]
24
+ : SBT_ROOT[reyaChainId];
13
25
  };
14
26
 
15
27
  export const SBT_MINT_DEADLINE = 1743508800; // Tue Apr 01 2025 12:00:00 GMT+0000