Closed ShookLyngs closed 3 weeks ago
an issue was found that if the object key is a hex string, it will also be transformed as snake_case, e.g. 0xe1e to 0_xe_1e. This is unexpected.
Why does a key with 0x-hex-string appear?
Relative imports must end with .js
May I ask why the .js
suffix is needed? It worked fine in my local computer without type: module
and .js
suffix.
Changes
generate_rgbpp_transfer_all_txs
in the rgbpp-sdk-service for batch transferring of RGB++ xUDT assets, previously implemented at https://github.com/ckb-cell/rgbpp-sdk/pull/270toSnakeCase()
andtoCamelCase()
to provide clearer return types"module": "NodeNext"
related import path issuessrc/*
path shortcut does not work.js
test.yml
workflowFound issues
Case transformation issue
The
toSnakeCase()
util transforms all object keys to snake_case, e.g.snakeCase
tosnake_case
. But when transforming theTransactionGroupSummary
object, an issue was found that if the object key is a hex string, it will also be transformed as snake_case, e.g.0xe1e
to0_xe_1e
. This is unexpected.In the current implementation of the
generate_rgbpp_transfer_all_txs
API, I wrapped the result with an utilensureSafeJson()
, which detects if the object key starts with0_x
, then all underscore marks in the key will be removed, reverting it to a regular hex string, e.g.0_xe_1e
to0xe1e
.BigInt to String issue
The requests in the
rgbpp-sdk-service
returns JSON as response. An JSON-related issue was found that it doesn't serialize BIgInt values. When an object that contains such type of value is passed toJSON.stringify()
, the function throws an error:Currently, I just transform all BIgInt values to hex strings: