Skip to content

Commit

Permalink
feat: testing bigint json stringify
Browse files Browse the repository at this point in the history
  • Loading branch information
HinsonSIDAN committed Apr 23, 2024
1 parent 44928af commit 774142a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- closed
branches:
- main
- fix/bigint-data

jobs:
build:
Expand Down
3 changes: 2 additions & 1 deletion packages/module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {
TxInParameter,
} from './type';
import { selectUtxos } from '@mesh/core/CPS-009';
import JSONbig from 'json-bigint';

export class MeshTxBuilderCore {
txHex = '';
Expand Down Expand Up @@ -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
);
};
Expand Down Expand Up @@ -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)
);
});
};
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 774142a

Please sign in to comment.