@reyaxyz/common 0.259.0 → 0.260.1
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
|
-
|  |  |  |  |
|
|
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
|
|
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,
|
|
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
|
-
|
|
12
|
-
|
|
11
|
+
exports.SBT_ROOT_EXTRA_OGS = (_b = {},
|
|
12
|
+
_b[types_1.ReyaChainId.reyaNetwork] = '0xbc6264e25255e1b3d456ec287615879c2525828345a3d4d4c09eb11baa2d201f',
|
|
13
|
+
_b[types_1.ReyaChainId.reyaCronos] = '0xdb3908dd08c4ccc9a39a3699999ff7043780ce76b245fffc4d551dc903594b61',
|
|
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,
|
|
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 '0xbc6264e25255e1b3d456ec287615879c2525828345a3d4d4c09eb11baa2d201f',\n [ReyaChainId.reyaCronos]:\n '0xdb3908dd08c4ccc9a39a3699999ff7043780ce76b245fffc4d551dc903594b61',\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.
|
|
3
|
+
"version": "0.260.1",
|
|
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": "
|
|
47
|
+
"gitHead": "43c99189261f08b0485d7d7e5f8baa9751dbb3c6"
|
|
48
48
|
}
|
package/src/utils/sbt-helpers.ts
CHANGED
|
@@ -8,8 +8,20 @@ export const SBT_ROOT: Record<ReyaChainId, string> = {
|
|
|
8
8
|
'0x01f4d29a3aca5cb40663851d2d40d605636dd6448f251d77765dd0e40c422136',
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
export const
|
|
12
|
-
|
|
11
|
+
export const SBT_ROOT_EXTRA_OGS: Record<ReyaChainId, string> = {
|
|
12
|
+
[ReyaChainId.reyaNetwork]:
|
|
13
|
+
'0xbc6264e25255e1b3d456ec287615879c2525828345a3d4d4c09eb11baa2d201f',
|
|
14
|
+
[ReyaChainId.reyaCronos]:
|
|
15
|
+
'0xdb3908dd08c4ccc9a39a3699999ff7043780ce76b245fffc4d551dc903594b61',
|
|
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
|