From 774142ae1b052f58a4c1874e7b4bcd1d6ec0642d Mon Sep 17 00:00:00 2001 From: SIDANWhatever Date: Wed, 24 Apr 2024 00:37:15 +0800 Subject: [PATCH 1/3] feat: testing bigint json stringify --- .github/workflows/npm-publish.yml | 1 + packages/module/package.json | 3 ++- .../transaction/meshTxBuilder/meshTxBuilderCore.ts | 7 ++++--- packages/react/package.json | 2 +- yarn.lock | 12 ++++++++++++ 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 2ff6c7e18..8cbb5b6be 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -9,6 +9,7 @@ on: - closed branches: - main + - fix/bigint-data jobs: build: diff --git a/packages/module/package.json b/packages/module/package.json index 44ca17f5a..ab11cd22c 100644 --- a/packages/module/package.json +++ b/packages/module/package.json @@ -3,7 +3,7 @@ "description": "Rapidly build Web3 apps on the Cardano Blockchain.", "homepage": "https://meshjs.dev", "author": "MeshJS", - "version": "1.5.14", + "version": "1.5.15-beta", "license": "Apache-2.0", "type": "module", "repository": { @@ -75,6 +75,7 @@ "@emurgo/cip14-js": "3.0.1", "axios": "1.6.3", "bip39": "3.0.4", + "json-bigint": "^1.0.0", "nanoid": "3.3.4", "zod": "3.22.4" } diff --git a/packages/module/src/transaction/meshTxBuilder/meshTxBuilderCore.ts b/packages/module/src/transaction/meshTxBuilder/meshTxBuilderCore.ts index 1a3b8251a..e84b198da 100644 --- a/packages/module/src/transaction/meshTxBuilder/meshTxBuilderCore.ts +++ b/packages/module/src/transaction/meshTxBuilder/meshTxBuilderCore.ts @@ -40,6 +40,7 @@ import { TxInParameter, } from './type'; import { selectUtxos } from '@mesh/core/CPS-009'; +import JSONbig from 'json-bigint'; export class MeshTxBuilderCore { txHex = ''; @@ -1390,7 +1391,7 @@ export class MeshTxBuilderCore { poolOwners, relays, poolParams.metadata - ? csl.PoolMetadata.from_json(JSON.stringify(poolParams.metadata)) + ? csl.PoolMetadata.from_json(JSONbig.stringify(poolParams.metadata)) : undefined ); }; @@ -1520,7 +1521,7 @@ export class MeshTxBuilderCore { allMetadata.forEach(({ tag, metadata }) => { this.txBuilder.add_json_metadatum( csl.BigNum.from_str(tag), - JSON.stringify(metadata) + JSONbig.stringify(metadata) ); }); }; @@ -1567,7 +1568,7 @@ export class MeshTxBuilderCore { protected castRawDataToJsonString = (rawData: object | string) => { if (typeof rawData === 'object') { - return JSON.stringify(rawData); + return JSONbig.stringify(rawData); } else { return rawData as string; } diff --git a/packages/react/package.json b/packages/react/package.json index 447db1793..b37fd771c 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -62,7 +62,7 @@ "vite": "3.1.4" }, "peerDependencies": { - "@meshsdk/core": "1.5.14", + "@meshsdk/core": "1.5.15-beta", "react-dom": "17.x || 18.x", "react": "17.x || 18.x" }, diff --git a/yarn.lock b/yarn.lock index 3ce54597d..9a66485e6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6359,6 +6359,11 @@ big.js@^5.2.2: resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== +bignumber.js@^9.0.0: + version "9.1.2" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.2.tgz#b7c4242259c008903b13707983b5f4bbd31eda0c" + integrity sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug== + binary-extensions@^1.0.0: version "1.13.1" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" @@ -11968,6 +11973,13 @@ jsesc@~0.5.0: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== +json-bigint@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-bigint/-/json-bigint-1.0.0.tgz#ae547823ac0cad8398667f8cd9ef4730f5b01ff1" + integrity sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ== + dependencies: + bignumber.js "^9.0.0" + json-buffer@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" From 07327c3d4ff80d72b77952dd82f242bacb7a7e31 Mon Sep 17 00:00:00 2001 From: SIDANWhatever Date: Wed, 24 Apr 2024 00:38:57 +0800 Subject: [PATCH 2/3] feat: testing bigint json stringify --- .github/workflows/npm-publish.yml | 2 ++ yarn.lock | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 8cbb5b6be..55305cd1c 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -9,6 +9,8 @@ on: - closed branches: - main + push: + branches: - fix/bigint-data jobs: diff --git a/yarn.lock b/yarn.lock index 9a66485e6..927dcb852 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2487,6 +2487,21 @@ resolved "https://registry.yarnpkg.com/@mdx-js/util/-/util-1.6.22.tgz#219dfd89ae5b97a8801f015323ffa4b62f45718b" integrity sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA== +"@meshsdk/core@*", "@meshsdk/core@^1.5.10": + version "1.5.14" + resolved "https://registry.yarnpkg.com/@meshsdk/core/-/core-1.5.14.tgz#d6dd5eeed3f926684b8e05202cc37b5c34a5cb02" + integrity sha512-GI/1GV7OY57n8K5JHAnXIxm5rjZwV6ddmfpzij+ltRoiArnM70+LWexoQ4WJLoIXK3lK6uJY8VxgcYcWamAirg== + dependencies: + "@emurgo/cardano-message-signing-browser" "1.0.1" + "@emurgo/cardano-message-signing-nodejs" "1.0.1" + "@emurgo/cardano-serialization-lib-browser" "11.5.0" + "@emurgo/cardano-serialization-lib-nodejs" "11.5.0" + "@emurgo/cip14-js" "3.0.1" + axios "1.6.3" + bip39 "3.0.4" + nanoid "3.3.4" + zod "3.22.4" + "@meshsdk/mesh-csl@^0.0.1-beta.1": version "0.0.1-beta.2" resolved "https://registry.yarnpkg.com/@meshsdk/mesh-csl/-/mesh-csl-0.0.1-beta.2.tgz#a42d4696f17524dec220c9066c826437fe053984" From 9df2171080434d858347a455a4917a9730a939a3 Mon Sep 17 00:00:00 2001 From: SIDANWhatever Date: Wed, 24 Apr 2024 00:48:22 +0800 Subject: [PATCH 3/3] feat: bumping bigint fix to main version --- .github/workflows/npm-publish.yml | 3 --- packages/contracts/package.json | 2 +- packages/module/package.json | 2 +- packages/react/package.json | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 55305cd1c..2ff6c7e18 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -9,9 +9,6 @@ on: - closed branches: - main - push: - branches: - - fix/bigint-data jobs: build: diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 9016bf6b2..510579005 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -34,7 +34,7 @@ "vitest": "0.28.4" }, "peerDependencies": { - "@meshsdk/core": "1.5.14" + "@meshsdk/core": "1.5.15" }, "dependencies": { "@harmoniclabs/plu-ts": "0.2.2", diff --git a/packages/module/package.json b/packages/module/package.json index ab11cd22c..6f217a435 100644 --- a/packages/module/package.json +++ b/packages/module/package.json @@ -3,7 +3,7 @@ "description": "Rapidly build Web3 apps on the Cardano Blockchain.", "homepage": "https://meshjs.dev", "author": "MeshJS", - "version": "1.5.15-beta", + "version": "1.5.15", "license": "Apache-2.0", "type": "module", "repository": { diff --git a/packages/react/package.json b/packages/react/package.json index b37fd771c..159db2ac8 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -62,7 +62,7 @@ "vite": "3.1.4" }, "peerDependencies": { - "@meshsdk/core": "1.5.15-beta", + "@meshsdk/core": "1.5.15", "react-dom": "17.x || 18.x", "react": "17.x || 18.x" },